If you're writing code that needs to use fields in your customer and
seller profile models then you're obviously going to have to know which
you're using, so there's no benefit to abstracting the
user.seller_profile.get() to user.get_profile(), and it makes the intent
less obvious.
Ok, thannks i will try, and let you know...
Cheers
ignacio Soto Reveco
Staff IngeHost
El 11-06-2011 11:41, "Shawn Milochik" <shawn...@gmail.com> escribió:
Oops, correction: You'd use user.seller_profile and user.customer_profile if you've set it up as a OneToOneField -- the get() is unnecessary (and won't work).
You'd use get() if you used a ForeignKey with unique = True, but that's silly because a OneToOneField does exactly that but more explicitly.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/0weLEapbyMYJ.
--
You received this message because you are subscribed to the Google Groups "Django users" grou...
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group,...
can the same person be both customer and seller?
--
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/
No, the same person cant be costumer and seller.
ignacio Soto Reveco
Staff IngeHost
El 11-06-2011 21:37, "Kenneth Gonsalves" <law...@thenilgiris.com> escribió:
On Fri, 2011-06-10 at 23:51 -0400, Ignacio Soto wrote:
> i want to create 2 user profile: cutomer an...
can the same person be both customer and seller?
--
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more op...
No, the same person cant be costumer and seller.
I have a basic profile with information common to both customer and
seller called Person and separate models called customer and seller with
foreign key to person. Thus one person may have multiple roles.
Ok, kenneth i havent seen it that way.
I will use your model.
I really apreciate it
Thanks
ignacio Soto Reveco
Staff IngeHost
El 12-06-2011 0:39, "Kenneth Gonsalves" <law...@thenilgiris.com> escribió:
On Sat, 2011-06-11 at 21:12 -0400, Ignacio Soto wrote:
> No, the same person cant be costumer and se...
I have a basic profile with information common to both customer and
seller called Person and separate models called customer and seller with
foreign key to person. Thus one person may have multiple roles.
--
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/
--
You re...For more options, visit this group at http://groups.google.com/group/django-users?hl=en.