I would like to be able to log in / authenticate the user either as a "store" or as a "client."
Is there any way to make this work with the model above?
Yes, but.
http://docs.djangoproject.com/en/1.2/topics/auth/#storing-additional-information-about-users
If you want to use automatic functions, you get one (one) object of the profile class associated with the user.
, . AUTH_PROFILE_MODULE get_profile()
a User.
try:
CustomerProfile.objects.get( user=request.user )
except CustomerProfile.DoesNotExist:
,
" ".
@login_required, . , ?
save() , . ClientProfile , CustomerProfile.save() StoreProfile , .
. .
, . , , uber.
@customer_required @store_required. , @login_required, , . customer_required CustomerProfile . store_required StoreProfile .
http://docs.djangoproject.com/en/1.2/topics/auth/#groups
, , Django. , - .
"" .
Django Group ( "", "" ) .
@store_required @customer_required .