Re: [Django] #15174: Add a required inline on django admin

2011-02-12 Thread Django
#15174: Add a required inline on django admin
+---
   Reporter:  zodman| Owner:  nobody
   
 Status:  closed| Milestone:
   
  Component:  django.contrib.admin  |   Version:  SVN   
   
 Resolution:  duplicate |  Keywords:  
inlines,formset,admin
   Triage Stage:  Accepted  | Has patch:  0 
   
Needs documentation:  0 |   Needs tests:  0 
   
Patch needs improvement:  0 |  
+---
Changes (by julien):

  * status:  new => closed
  * resolution:  => duplicate


Comment:

 This is essentially a dupe of #14832. That is one tough problem to
 solve...

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15174: Add a required inline on django admin

2011-01-26 Thread Django
#15174: Add a required inline on django admin
---+
  Reporter:  zodman| Owner:  nobody 
  
Status:  new   | Milestone: 
  
 Component:  django.contrib.admin  |   Version:  SVN
  
Resolution:|  Keywords:  
inlines,formset,admin
 Stage:  Accepted  | Has_patch:  0  
  
Needs_docs:  0 |   Needs_tests:  0  
  
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * stage:  Unreviewed => Accepted

Comment:

 Broadly, I can accept the use case. However, I'm inclined to say that the
 solution lies in Formsets, not the admin.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15174: Add a required inline on django admin

2011-01-26 Thread Django
#15174: Add a required inline on django admin
---+
  Reporter:  zodman| Owner:  nobody 
  
Status:  new   | Milestone: 
  
 Component:  django.contrib.admin  |   Version:  SVN
  
Resolution:|  Keywords:  
inlines,formset,admin
 Stage:  Unreviewed| Has_patch:  0  
  
Needs_docs:  0 |   Needs_tests:  0  
  
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * needs_better_patch:  => 0
  * needs_docs:  => 0
  * needs_tests:  => 0
  * milestone:  2.0 =>

Old description:

> Here more detailed info:
>
> http://stackoverflow.com/questions/1206903/how-do-i-require-an-inline-in-
> the-django-admin
>
> I propouse to use some like this:
> {{{
> class ProfileInline(admin.StackedInline):
> """
> Allows profile to be added when creating user
> """
> model = Profile
> extra = 1
> max_num = 1
> formset = RequiredInlineFormSet
> formset_required = True
> }}}

New description:

 For example: If you have a User and  UserProfile, you can set up the Admin
 site to display an inline for the UserProfile.

 If the user provides data for the UserProfile, it will be validated and
 saved.

 However, an empty form also passes validation -- there's no easy way to
 require that the user populate the UserProfile inline.

 More details and description [http://stackoverflow.com/questions/1206903
 /how-do-i-require-an-inline-in-the-django-admin on Stack Overflow].

 I propouse to use some like this:
 {{{
 class ProfileInline(admin.StackedInline):
 """
 Allows profile to be added when creating user
 """
 model = Profile
 extra = 1
 max_num = 1
 formset = RequiredInlineFormSet
 formset_required = True
 }}}

Comment:

 In future, please don't use links to external sites like StackOverflow to
 provide a basic description of the problem you're trying to solve.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.