Hi,
I have a question about best practices / tips for making my models a bit
less verbose and confusing. For example, I often find when making models
for a certain theme that I repeat myself. Let's say we have a page with
multiple elements: a slider, two bodies of text (each with their own
header), an accordion with it's own header, some quotes from clients, and
maybe a some team members. Usually, most of this content layout is
consistent through the site, but with different data (except for a few
cases, ie it's unlikely the team model would have differing data for
different pages). Is there a way to make a class for each element which the
page itself can inherit, much like the RichTextField (even though I know
RichTextField is not the perfect example)? And if so, what should that
model inherit from? Something like this...
class Slider(Orderable):
# eg
image = FileField(verbose_name=_("Image"),
upload_to=upload_to("theme.Slide.image", "slider"),
format="Image", max_length=255, null=True, blank=True)
Class Meta:
# whatever
...would have to define a homepage, and then be initialized as inline in
admin.py. Is there a way to instead have the page inherit the model, or at
least not access everything through inline (even though it is a model
separate from the page)? Or at least, a more streamlined process that
doesn't involved me repeating myself?
Thanks in advance for any insight, I hope I explained myself adequately!
Cheers,
Avery
--
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.