[Dev-flock] user/userExtended
Lucy R Mendel
lmendel at MIT.EDU
Mon Oct 8 10:42:31 EDT 2007
> If you want, I can merge more properties into the User class itself, but
> I'm hesitant to add too much since I don't know the internals.
agreed.
>As it is now, to get actions, do:
> u = User.get(name="dan")
> u.profile.actions[0:10] <- to get just the first 10, since there are
>about 20k actions by each user in the fixtures
>To get status points, its: u.profile.status
word.
>I haven't made any clever way to get or sort visit-logging info....if
>you have any ideas/requests, I'm all ears.
ok.
---------- Forwarded message ----------
Date: Mon, 08 Oct 2007 10:37:33 -0400
From: Daniel Ring <danring at MIT.EDU>
To: Lucy R Mendel <lmendel at mit.edu>
Subject: Re: [Dev-flock] r281 - in huginmunin/trunk/web: . src/database/db
I meant to mention it - there's a Django-standard way to assign it a
'user profile', but all that does is make 'user.get_profile()' return
the profile (in our case, a UserExtended instnace). I couldn't figure
out how to make that work, so I added a user.profile property that will
create the UserExtended object on the first access.
If you want, I can merge more properties into the User class itself, but
I'm hesitant to add too much since I don't know the internals.
As it is now, to get actions, do:
u = User.get(name="dan")
u.profile.actions[0:10] <- to get just the first 10, since there are
about 20k actions by each user in the fixtures
To get status points, its: u.profile.status
I haven't made any clever way to get or sort visit-logging info....if
you have any ideas/requests, I'm all ears.
Dan
Lucy R Mendel wrote:
>> many model files
> word.
>
>> The model API is pretty well documented, except ...
> word.
>
>> Things to note (maybe?):
> most definitely! these are all good notes to give the rest of us a heads
> up on what methods to use, etc.
> good work!!
>
> I'll have to look through the logging/user stuff tonight--- I'm not sure
> right now how to retrieve UserExtended info (actions, status points) and
> logging info. I'll ask if I have questions, though.
>
> Eggar, please pipe up if you have questions, too.
>
> Yeah team!
> Lucy.
>
>>
>> Added:
>> huginmunin/trunk/web/src/database/db/citation.py
>> huginmunin/trunk/web/src/database/db/graph.py
>> huginmunin/trunk/web/src/database/db/log.py
>> huginmunin/trunk/web/src/database/db/rating.py
>> huginmunin/trunk/web/src/database/db/search.py
>> huginmunin/trunk/web/src/database/db/state.py
>> huginmunin/trunk/web/src/database/db/tag.py
>> huginmunin/trunk/web/src/database/db/user.py
>> huginmunin/trunk/web/src/database/db/utils.py
>> Modified:
>> huginmunin/trunk/web/
>> huginmunin/trunk/web/src/database/db/models.py
>> huginmunin/trunk/web/src/database/db/tests.py
>> huginmunin/trunk/web/src/database/db/views.py
>> _______________________________________________
>> Dev-flock mailing list
>> Dev-flock at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/dev-flock
>>
> _______________________________________________
> Dev-flock mailing list
> Dev-flock at mit.edu
> http://mailman.mit.edu/mailman/listinfo/dev-flock
More information about the Dev-flock
mailing list