Tuesday, June 29, 2010

Re: Admin with only inlines, no fields

well yes, its adding all the fields in again. the errors thrown are
about missing required fields.

obviously this isn't a good approach since I'm not really editing the
model object, I'm just trying to fool the admin into letting me use
the inlines interface.

so I've opted to avoid using the admin in this case

and in any case I have bug issues with the inlines throwing errors
("management form has been tampered with")

On Jun 29, 5:49 pm, Vinicius Mendes <vbmen...@gmail.com> wrote:
> Try to debug this using PDB. You can insert some breakpoints where the form
> is not validated and see what are the errors.
>
> Atenciosamente,
> Vinicius Mendes
> Solucione Sistemas
> vinic...@solucione.info
>
>
>
> On Tue, Jun 29, 2010 at 12:14 PM, felix <crucialfe...@gmail.com> wrote:
>
> > I need to present an admin form that has no fields from the model and
> > only offers admin inlines.
>
> > class AptTranslationForm(DefaultModelForm):
>
> >    class Meta:
> >        model = AptTranslation
>
> > class AptTranslationsAdmin(models.Admin):
>
> >    inlines = [AptTranslation_Inline,]
>
> >    fields = []
>
> > the empty fields list is ignored and the admin delivers all fields
> > from the model
>
> > class AptTranslationsAdmin(models.Admin):
>
> >    inlines = [AptTranslation_Inline,]
>
> >    fieldsets = []
>
> > same thing, all fields are shown
>
> > class AptTranslationsAdmin(models.Admin):
>
> >    inlines = [AptTranslation_Inline,]
>
> >    fieldsets = ( ("",{'fields':[]}), )
>
> > this displays as wished (with a barely visible grouping at the top),
> > but always returns an error on save:
>
> > Please correct the errors below.
>
> > but no errors are listed.
>
> > class AptTranslationsAdmin(models.Admin):
>
> >    inlines = [AptTranslation_Inline,]
>
> >    fields = ['headline']
> >    readonly_fields = ['headline']
>
> > same as above: Please correct the errors below,
> > but no errors are shown
>
> > I also tried using a dummy form class, but an empty field list is not
> > respected there either
>
> > thanks for any help
>
> > --
> > 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<django-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

--
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