Can you subclass a gallery?

87 views
Skip to first unread message

Evan Cordulack

unread,
Feb 13, 2014, 8:02:47 PM2/13/14
to mezzani...@googlegroups.com
Hi All,

I couldn't find this in the documentation or with a search, so I feel like I am missing something simple.

Can you subclass a gallery or do you need to use field injection?

I am wondering if something like this is possible:

models.py
-------------------
from mezzanine.galleries.models import Gallery

class sampleContentType(Gallery):
  extraFieldName = models.BooleanField(verbose_name="This field is just an example and could be anything")

admin.py
--------------------
from mezzanine.galleries.admin import GalleryAdmin

admin.site.register(sampleContentType, GalleryAdmin)

When I tried something like this, I got an "Key u'gallery_ptr' not found in Form" error message.
  
Thanks!

Evan

Stephen McDonald

unread,
Feb 13, 2014, 8:04:18 PM2/13/14
to mezzani...@googlegroups.com
More generally, you can't subclass concrete page classes, see the note just above this docs section:



--
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 mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Stephen McDonald
http://jupo.org

Evan Cordulack

unread,
Feb 13, 2014, 8:21:37 PM2/13/14
to mezzani...@googlegroups.com
Got it! Thank you for the quick explanation and link. That clears it up.
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/mVtXuUniCTE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages