> 1.  I need to enhance the underlying solution.  I need to do some more
> in depth table wide caculations, working out averages etc, but based on
> a user-id.   The documentation suggests that the table wide code would
> best be placed in a model manager.

Here's a thought:

class UserPoint(models.Manager):
      def for_user(self, username):
          return
super(UserPoint,self).get_query_set().filter(user=username)

Then, where you want to use it:

qs = PointTransaction.userpoint.for_user(username)

Doesn't really add much to the direct QuerySet but perhaps you can
extend this to include your table wide calculations and see if it
helps. Or, list here some of the calculations you are trying to work
out so you can get more feedback on this.

>
> 2. In trying to learn Django and python - I'm trying to discover how
> everything works.  Django seems very powerful but it is not immediately
> intuitive which of the possible options (views, template tags, models
> and managers etc) one should use.

Fair enough :)


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to