Here is the link to the stack overflow post as well:
http://stackoverflow.com/questions/32916023/mezzanine-custom-content-type-relationship-with-gallery
On Friday, October 2, 2015 at 11:54:35 PM UTC-4, Nick V wrote:
>
> Hello,
>
> I've created a custom content type from Page which works fine. I would
> like each one of these types to link to a particular gallery for images and
> then display these images on the page. My goal is to have a field on the
> page create/edit screen with a drop down of available galleries that I can
> select from. It would be nice if I can specify the path to the media
> library and pull all of the images from there; however I can go through and
> create separate galleries for this purpose.
>
> I've added gallery field using ManyToManyField as below:
>
> from django.db import models
> from django.utils.translation import ugettext_lazy as _
> from mezzanine.pages.models import Page, RichText
> from mezzanine.galleries.models import Gallery
>
> class DocPage(Page, RichText):
>
> banner_text
> =models.CharField(blank=True,max_length=500,help_text=_("Banner Text"))
> header_background = models.ImageField(blank=True, help_text=_("Image
> for about us header page"))
> gallery = models.ManyToManyField(Gallery, help_text=_("Gallery"))
>
> class Meta:
> verbose_name = _("DocPage")
> verbose_name_plural = _("DocPage")
>
>
> I ran through the migrations and it looked like everything worked fine;
> but I don't see the extra gallery field in the admin user interface.
> However, I can see DocPage and the other fields (banner_text and
> header_background).
>
> What am I missing here?
>
> Thanks in advance
>
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.