mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-05 23:20:19 +00:00
1 line
2.3 KiB
JSON
1 line
2.3 KiB
JSON
[{"user_id": 33167, "stars": [], "topic_id": 35943, "date_created": 1305814090.3085649, "message": "how can I substitute current_user.field to real attribute name? like \"current_user.login\", current_user.name\" etc.", "group_id": 292, "id": 1111464}, {"user_id": 18256, "stars": [], "topic_id": 35943, "date_created": 1305815081.3170471, "message": "Using \"setattr\", in your code it would be setattr(current_user, field, val)", "group_id": 292, "id": 1111583}, {"user_id": 3354, "stars": [], "topic_id": 35943, "date_created": 1305813567.1457291, "message": "Perhaps you'd like to try that again, making it legible? I think Convore's formatting functions have got in the way because you pasted your question in (but I am not absolutely sure).", "group_id": 292, "id": 1111380}, {"user_id": 3354, "stars": [], "topic_id": 35943, "date_created": 1305813640.2696781, "message": "Also, it is much better to indicate the specific area of help you are looking for. Most people will probably skip over this because you don't indicate what it's about.", "group_id": 292, "id": 1111391}, {"user_id": 33167, "stars": [], "topic_id": 35943, "date_created": 1305813987.654115, "message": "1. current_user = models.User.objects.get(login=user_login)\n2. if request.method == 'POST':\n3. profform = forms.ProfileEditForm(request.POST)\n4. \n5. if profform.is_valid():\n6. cd = profform.cleaned_data.items()\n7. for field, val in cd:\n8. current_user.field = val\n9. current_user.save()\n10. return render_to_response('profile.html')\n\nThis is my source.... It's something like profile_edit function...\n\nproblem at line 8... I want to set the current_user fields... but script sets only \"current_user.field\" (attribute called \"field\")...\n\n\n\n", "group_id": 292, "id": 1111444}, {"user_id": 33167, "stars": [], "topic_id": 35943, "date_created": 1305815175.7605751, "message": "loldamn :) so easy ))) I've really forgot 'bout this func :) thanks ^___^", "group_id": 292, "id": 1111601}, {"user_id": 2588, "stars": [], "topic_id": 35943, "date_created": 1305827400.3793859, "message": "The code as you've written it looks like a good candidate for using ModelForms http://docs.djangoproject.com/en/1.3/topics/forms/modelforms/", "group_id": 292, "id": 1114254}] |