Ah, just re-read your question and realized it was slightly different.
For reusable apps, I guess o2o field might be the best solution. Subclassing User is not a good idea for a reusable app because you might be stepping on the toes of another app.
-I On Sep 1, 2009, at 12:23 PM, ofri raviv wrote:
Hi,I have a question about pluggable apps design: many times, you'd like a new app to add some fields to the basic models you already have. for example, if I have a users app, and i want to add karma (everything good you do on the site gives you good karma points, when you post, when your posts are voted up, etc). it doesn't really matter how the karma app works, in the end, it has to add a karma field to the user model that is already defined in another app.the solution seems to be, add another model, UserKarma, that hasuser = models.OneToOneField(User, primary_key=True, related_name='karma')and then we can use user.karma.foo to access the fields that karma app added.is that a good solution? how is it performance-wise compared to just adding the fields to User?--~--~---------~--~----~------------~-------~--~----~You received this message because you are subscribed to the Google Groups "PyWeb-IL" 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/pyweb-il?hl=en -~----------~----~----~----~------~----~------~--~---
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Python-il mailing list [email protected] http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il
