Friday, October 28, 2011

Re: Django inline admin max_num, extra not working

Hi Tom,

Thanks for your reply.

Yes I want to have just one user profile.

And yes I have tried both OneToOne field and ForeignKey with
unique=True but it makes no difference in both cases I have this
problem

Regards,

José

On Oct 28, 11:41 am, Tom Evans <tevans...@googlemail.com> wrote:
> On Fri, Oct 28, 2011 at 9:47 AM, Jose <jlez...@gmail.com> wrote:
> > I have extended the User model as explained here and in many other
> > sites.
>
> > However, when defining the User Profile Inline in admin.py, no matter
> > what values I use for max_num or extra, in the admin site it will
> > always show one inline for the user profile I have already created and
> > another blank one (User Profile #2).
>
> > The only way it does a difference is if I use extra=-1 in which case I
> > only get the blank form.
>
> > I have searched a lot in the Internet but found no solution. I am
> > using Django 1.2.3
>
> > I appreciate your help.
>
> What do you want to happen, just to have exactly the one user profile
> inline for each user?
>
> If you define the UserProfile as having a OneToOneField instead of a
> ForeignKey, then that would happen by default.
>
> Cheers
>
> Tom

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment