Re: Adding ForeignKey on self to User with add_to_class causes endless loop in the server

2007-07-31 Thread Daniel Kvasnicka jr.

On Jul 31, 9:30 am, "Ben Ford" <[EMAIL PROTECTED]> wrote:
> I'm not sure about the mechanics of add_to_class, but usually a self
> referential ForeignKey should look like:
> models.ForeignKey('self', ..)
> Have you tried it like this?

Yes I have, and unfortunately it does the same.

Cheers,
Dan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Adding ForeignKey on self to User with add_to_class causes endless loop in the server

2007-07-31 Thread Ben Ford
I'm not sure about the mechanics of add_to_class, but usually a self
referential ForeignKey should look like:
models.ForeignKey('self', ..)
Have you tried it like this?
Ben

On 31/07/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
> in my models.py I'm tring to add some fields to User with add_to_class
> (so I can access them in admin). Everything works fine, only when I
> try to add a ForeignKey on User itself, Django dev server gets in a
> loop and has to be killed or it consumes every byte of memory and all
> processor time.
>
> I do it like this:
> User.add_to_class('parent', models.ForeignKey('User', blank = True,
> default = 0))
>
> Anybody experienced something similar?
>
> Thanks for every thought,
> Dan
>
>
> >
>


-- 
Regards,
Ben Ford
[EMAIL PROTECTED]
+628111880346

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Adding ForeignKey on self to User with add_to_class causes endless loop in the server

2007-07-30 Thread Daniel Kvasnicka jr.

Hi,
in my models.py I'm tring to add some fields to User with add_to_class
(so I can access them in admin). Everything works fine, only when I
try to add a ForeignKey on User itself, Django dev server gets in a
loop and has to be killed or it consumes every byte of memory and all
processor time.

I do it like this:
User.add_to_class('parent', models.ForeignKey('User', blank = True,
default = 0))

Anybody experienced something similar?

Thanks for every thought,
Dan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---