Hey all,
When I go to the Admin section of my site, I see the "Blog posts" under
"Content" on the left. I want to make a new "Content" section called
"Projects." It would be similar to a page of blog posts. But I'm not sure
how to start doing this.
Here's what my app's `models.py` looks like.
from __future__ import unicode_literals
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.fields import FileField
from mezzanine.core.models import Displayable, Ownable, RichText, Slugged
from mezzanine.generic.fields import CommentsField, RatingField
from mezzanine.utils.models import AdminThumbMixin, upload_to
# Create your models here.
class ProjectsPage(Displayable):
'''
A page representing the format of the page that
has links to standalone, project projects
'''
categories = models.ManyToManyField("ProjectCategory",
verbose_name=_("Categories"),
blank=True, related_name="projectposts")
allow_comments = models.BooleanField(verbose_name=_("Allow comments"),
default=True)
comments = CommentsField(verbose_name=_("Comments"))
featured_image = FileField(verbose_name=_("Featured Image"),
upload_to=upload_to("project.ProjectPost.featured_image", "project"),
format="Image", max_length=255, null=True, blank=True)
related_posts = models.ManyToManyField("self",
verbose_name=_("Related posts"), blank=True)
admin_thumb_field = "featured_image"
class Meta:
verbose_name=_("Project link")
verbose_name_plural=_("Project links")
ordering=("-publish_date",)
class ProjectCategory(Slugged):
'''
A category for grouping project links into a series
'''
class Meta:
verbose_name=_("Project Category")
verbose_name_plural=_("Project Categories")
ordering=("title",)
I basically copied a section of `mezzanine/blog/models.py`.
But "Projects" won't show up in my Admin menu. What am I doing wrong?
--
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.