If you're failry strong in python, but not Django and are working with
Mezzanine, then you do need to do some digging into Django. And here's
the main pointers:
- Models are classes that represent the database structure. They can
be extended, they can be marked abstract, but the primary thing to
remember is that model **fields** cannot be overwritten. Model fields
being attributes of the class that are extending
django.db.models.Field. The represent table fields and therefore are
actively prevented from being extended.
- Database tables are migrated using Django migrations. In general
it's not necessary to know the database structure let alone even touch
it. This is only needed for specialized cases, optimizations and
legacy databases.
- Django form fields have a widget kwarg in their __init__, which can
be used to override the widget at runtime. Additionally, the Django
Form class has a metaclass attribute "widgets" which is a dictionary
mapping field names to widgets.
These points are all accessible from
https://docs.djangoproject.com/en/1.11/ and quite a bit of it covered
in the tutorial.
Mezzanine:
- A blog image is already available, when the following is activated
in settings:
# Setting to turn on featured images for blog posts. Defaults to False.
#
# BLOG_USE_FEATURED_IMAGE = True
- The default widget for a Mezzanine FileField is from
filebrowser_safe. It should be possible to set this to
django.forms.ClearableFileInput, though I've not tried it.
Hope this helps.
> --
> 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/d/optout.
--
Melvyn Sopacua