2010/9/24 Jason <goodri...@gmail.com> > > "Creating the relationship between User and UserInfo has some > implications I'd like to avoid on a model-level" > > Specifically what are you referring to here? Because anytime you > subclass in Django you are basically doing the exact thing in the > database behind the scenes and as result accessing the data turns out > to be pretty similar (just about as easy both ways). >
Well, first I can to "if X == Student: ...", and I know the fields will be there. Second, User will have no additional properties (as I understand), but once I do "Model --> User" relations ALL users will have that property. So each user might have the .course property, AND the .subject property (which might be for teachers), AND the .function property, which might be for administrative staff (I'm making things up here :). So all properties would be present, they may not be mandatory, cause a teacher is never part of a course, so I have to ensure data consistency in the application logic. That sucks. Subclassing relieves me from this just nicely, AND this is the mother of all prototype examples of OOP - base class, specialized subclasses. The only thing more cliché would be "Car" -> "Van" / "Compact" / ... . I might have a look into groups, but I need certain properties for the users. Groups seem to manage the database permissions just fine, but I'm all in for class / instance properties. The best part is: In theory it is all VERY simple: The subclassing works just fine. It even seems to run a feature of Django - subclassing of models, since version IForgotWhich. Also the model behaves just as expected, the database looks like it should. But then I run into trouble because I cannot display ONE --CENSORED-- FIELD as of now in the admin "create" interface. And so far no one was able to give me an answer, although I found examples on the web - unfortunately they don't work here. And everything I try simply does not work with the magic of that --censored-- UserAdmin manager. (Yes, I am a bit frustrated here). Right now I switch between two different Admin classes to create some test users, which SUCKS. I surely *cannot* be the only guy who does things like this, or who came up with that idea. Can I????? I mean, I posted the articles of other people, who did just the same, right?? Although I still like Django, cause I really just started with it. But ... well, my patience is getting a tiny little bit thin, if I don't get some little successes out of it soon. So --- am I right? Specifically about the "All users have that property then" part? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.