I suppose the best bet, in an ideal world, world be model inheritance.
As you're probably aware, this is incomplete at the moment, so you
can't really do that. A better solution may be to have a wrapper
model, and have your Buyer/Seller classes create one to one
relationship this extension class. To top things off, one-to-one is
also going to be changing syntax soon.. but I think this is your best
bet for now...
class UserExtension(models.Model):
pass
class Buyer(models.Model):
# Buyer specific profile data here
pass
Then, you could set AUTH_PROFILE_MODULE. To keep your code pretty dry,
you'll probably want to have a "get_data" method in UserExtension:
def get_data(self):
if self.buyer:
return self.buyer
if self.seller:
return self.seller
return None # No profile data
I'm also looking for a nice solution to this, as I'Hope this helps
On Apr 19, 9:05 am, checco <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I already posted this question
> herehttp://groups.google.com/group/django-users/browse_thread/thread/2dfb...
> but I then realized I had not been very clear and decided to rewrite
> it.
>
> In this entry from the James Bennet
> bloghttp://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-mo...
> are clear instructions on how to extend the User model to fit the
> particular needs of an application.
>
> In the application I'm developing there two different kind of users,
> for example a Buyer and a Seller, which have different fields. This
> means that I have to extend the User model twice. The problem I'm
> facing is: which value should I specify for the parameter
> AUTH_PROFILE_MODULE in settings.py? 'myapp.Buyer', 'myapp.Seller',
> both of them?
>
> Any help will be appreciated
> Francesco
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---