Tuesday, June 29, 2010

Re: Admin with only inlines, no fields

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
vinicius@solucione.info


On Tue, Jun 29, 2010 at 12:14 PM, felix <crucialfelix@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.
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