On Tue, 2009-01-13 at 22:39 +0000, Mengsong Chen wrote:
> Just wonder if anyone have achieved such a temporary user model to
> allow unregistered user to use some features,
> but will clean up the data after the session completed if the user is
> not going to register.

You could use a user profile model to help with this (see [1]). In your
user profile, have a flag that indicates whether the user is registered
or not. Then periodically go around and clean up (delete) any users that
do have registered=True in the user profile.

You cannot automatically do this "when the session is completed", since
you won't know when that is. Most users don't bother to log out of
websites or anything like that. How can you tell the difference between
"user has gone to lunch and will be back in 20 minutes" and "user has
finished using the site and will never be back"? You can't. You just
have to do something like deleting temporary users after 24 hours.

[1]
http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to