Re: a way to display a model formset in a ModelAdmin ?
> > > Create New adminmodel class and define fieldsets... For example > http://www.f2finterview.com/web/Django/22/ it is clearly explain you > > Hi Stephen, thanks for the reply, but it doesn't solve it since every field specified in the fieldset at the Model admin needs to either exist in Model or in the ModelForm, and since the number of Images that I want to display is variable (let's say between 1 and N) I can't have N Image fields at the form, what I need is somewhat of a field that spawns into multiple fields based on the amount of images that I want to display. I'm starting to think that maybe using a many-to-many field with a custom widget might do the job. > On Thu, Oct 25, 2012 at 3:51 AM, Nicolas Emiliani wrote: > >> Hi, >> >> As the subject states, is there a way to display a model formset in a >> ModelForm? >> >> The thing is that I have a Verification model with its ModelAdmin, and >> then I have >> an ImageModel that has no ForeignKey to the Verification model (and I >> intend to keep >> it that way) so I can not inline it into the VerificationAdmin and I >> would like to show >> a list of Images in my VerificationAdmin based on a queryset performed (i >> assume) at >> __init__ method of VerificationAdminForm. How could this be accomplished? >> >> This is how it goes: >> >> class Image(models.Model): >> >> >> class Verification(models.Model): >> >> >> class VerificationAdminForm(forms.ModelForm): >> >> >> class VerificationAdmin(admin.ModelAdmin): >>form = VerificationAdminForm >>model = Verification >>fieldsets = [ ... ] >> >> Any ideas would be greatly appreciated. >> >> Thanks in advance. >> >> -- >> Nicolas Emiliani >> >> Lo unico instantaneo en la vida es el cafe, y es bien feo. >> >> -- >> 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+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> > > > > -- > Thanks & Regards > Stephen S > > > > Website: www.f2finterview.com > Blog: blog.f2finterview.com > Tutorial: tutorial.f2finterview.com > Group:www.charvigroups.com > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: a way to display a model formset in a ModelAdmin ?
Hi, Create New adminmodel class and define fieldsets... For example http://www.f2finterview.com/web/Django/22/ it is clearly explain you On Thu, Oct 25, 2012 at 3:51 AM, Nicolas Emiliani wrote: > Hi, > > As the subject states, is there a way to display a model formset in a > ModelForm? > > The thing is that I have a Verification model with its ModelAdmin, and > then I have > an ImageModel that has no ForeignKey to the Verification model (and I > intend to keep > it that way) so I can not inline it into the VerificationAdmin and I would > like to show > a list of Images in my VerificationAdmin based on a queryset performed (i > assume) at > __init__ method of VerificationAdminForm. How could this be accomplished? > > This is how it goes: > > class Image(models.Model): > > > class Verification(models.Model): > > > class VerificationAdminForm(forms.ModelForm): > > > class VerificationAdmin(admin.ModelAdmin): >form = VerificationAdminForm >model = Verification >fieldsets = [ ... ] > > Any ideas would be greatly appreciated. > > Thanks in advance. > > -- > Nicolas Emiliani > > Lo unico instantaneo en la vida es el cafe, y es bien feo. > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Thanks & Regards Stephen S Website: www.f2finterview.com Blog: blog.f2finterview.com Tutorial: tutorial.f2finterview.com Group:www.charvigroups.com -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
a way to display a model formset in a ModelAdmin ?
Hi, As the subject states, is there a way to display a model formset in a ModelForm? The thing is that I have a Verification model with its ModelAdmin, and then I have an ImageModel that has no ForeignKey to the Verification model (and I intend to keep it that way) so I can not inline it into the VerificationAdmin and I would like to show a list of Images in my VerificationAdmin based on a queryset performed (i assume) at __init__ method of VerificationAdminForm. How could this be accomplished? This is how it goes: class Image(models.Model): class Verification(models.Model): class VerificationAdminForm(forms.ModelForm): class VerificationAdmin(admin.ModelAdmin): form = VerificationAdminForm model = Verification fieldsets = [ ... ] Any ideas would be greatly appreciated. Thanks in advance. -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.