Friday, October 28, 2011

Re: Django inline admin max_num, extra not working

On Fri, Oct 28, 2011 at 9:47 AM, Jose <jlezama@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