OK, my custom gpuser object (which extends User) keeps a post count in
the model:
   post_count = models.IntegerField(blank=True)

this is incremented when they make a board post:
   gp_user.post_count = gp_user.post_count +1
   gp_user.save()

So far so good. My problem is that whenever someone edits their
profile, post_count defaults back to 0

def edit_profile(request, slug):
    from django.views.generic.create_update import update_object
    auth_user = User.objects.get(username=slug)
    user_id = auth_user.id
    username = auth_user.username
    gpuser = GpUser.objects.get(user=user_id)

    return update_object(
        request,
        model=GpUser,
        object_id=gpuser.id,
        login_required=True,
        template_name="users/user_edit_form.html",
    )

Do I need to carry over post_count int he edit_profile function
somehow, or put it in a hidden field in the form, or what?


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to