Re: Adding ManyToManyField to Django models

2008-03-04 Thread Michael Irani
Michael, Your opinion on this makes sense and in the end I will probably just go with the wrapper approach, since it probably won't make that much of a difference anyways. My biggest qualm is that I'm trying to put together a strong foundation for the projects I'm working on and feel like this is

Re: Adding ManyToManyField to Django models

2008-03-04 Thread Malcolm Tredinnick
On Tue, 2008-03-04 at 13:06 -0800, Michael Irani wrote: > I was wondering if it's possible to add a ManyToManyField onto a > prebuilt Django model such as User... I know that it would look like > this if I were to have created the model myself: > class User(models.Model): > watch = models.M

Re: Adding ManyToManyField to Django models

2008-03-04 Thread Michael
Michael; Think of it this way: the auth model is just one way to provide authentication into your architecture. It wouldn't make much sense to have too much more information about the person inside of this model. There is an effort to try to be able to extend models, but as far as I know it has b

Re: Adding ManyToManyField to Django models

2008-03-04 Thread Michael Irani
One thing I dislike about the approach that's being pushed by the community, which is to have a one-to-one relationship between auth.User and your own 'Profile' model (or whatever you want to call it) adding all the functionality and relationships to the user-created Model is a bit much. I mean ye

Re: Adding ManyToManyField to Django models

2008-03-04 Thread Michael Irani
Evert, the situation is that I was trying to use the auth.User as my model and wanted to have it point to itself. Thereby not having my own model at all. I was curious as well about being able to subclass a prebuilt model, but from the reactions I've gotten towards this, it doesn't seem to be an

Re: Adding ManyToManyField to Django models

2008-03-04 Thread Evert Rol
> I was wondering if it's possible to add a ManyToManyField onto a > prebuilt Django model such as User... I know that it would look like > this if I were to have created the model myself: > class User(models.Model): > watch = models.ManyToManyField('self', null=True, blank=True) > > I'm unsu

Re: Adding ManyToManyField to Django models

2008-03-04 Thread Michael
The amazing thing about Django contrib is that, in general, it uses the same features as are available to you in your models. So there is no reason that you need to even install the auth system. You could copy the code out of django.contrib.auth and customize it as you see fit. The only thing is t

Re: Adding ManyToManyField to Django models

2008-03-04 Thread [EMAIL PROTECTED]
Yep here's a good article on it: http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/ On Mar 4, 5:36 pm, Michael Irani <[EMAIL PROTECTED]> wrote: > I got some help on IRC and here's the conclusion. There is no way to > add that mapping from auth.User to itself without hack

Re: Adding ManyToManyField to Django models

2008-03-04 Thread Michael Irani
I got some help on IRC and here's the conclusion. There is no way to add that mapping from auth.User to itself without hacking the django code, so what needs to happen is that I add a wrapper Model such as 'Profile' and add the ManyToManyField to 'Profile'. Thereby the mappings will happen within

Adding ManyToManyField to Django models

2008-03-04 Thread Michael Irani
I was wondering if it's possible to add a ManyToManyField onto a prebuilt Django model such as User... I know that it would look like this if I were to have created the model myself: class User(models.Model): watch = models.ManyToManyField('self', null=True, blank=True) I'm unsure how to ad