info  = RichTextField(("Content"), blank=True, null=True)


On Friday, February 13, 2015 at 5:17:52 PM UTC-5, Melvin Ramos wrote:
>
>
> Hello,
>
> At Stephen McDonald's request, I post here in the Mailing List.
>
> I'm new to Django and therefore to Mezzanine. I'm creating a model and I 
> want to have a RichText field in one of the attributes of the class (code 
> below):
>
> models.py
>
> from django.db import models
> from mezzanine.pages.models import Page
> from mezzanine.core.models import RichText
>
>
> class KeyDocument(Page):
>     pass
>
>
> class KeyDoc(models.Model):
>     ref_page = models.ForeignKey("KeyDocument")
>     title = models.CharField("Title*", max_length=1000)
>     author = models.CharField("Author(s)*", max_length=1000)
>     year = models.PositiveSmallIntegerField("Year*")
>     month = models.CharField("Month", max_length=10, null=True, blank=True
> )
>     info = RichText("Additional Information")
>     laguange = models.CharField("Language(s)", max_length=100)
>     slug = models.SlugField("Slug", max_length=100, null=True, blank=True)
>
>
>     class Meta:
>         ordering = ['-year', 'title']
>
>
> admin.py
>
> from copy import deepcopy
> from django.contrib import admin
> from mezzanine.pages.admin import PageAdmin
> from references.models import KeyDocument, KeyDoc
>
>
> keydoc_extra_fieldsets = ((None, {"fields": ()}),)
>
>
> class KeyDocInline(admin.TabularInline):
>     model = KeyDoc
>
>
> class KeyDocsAdmin(PageAdmin):
>     inlines = (KeyDocInline,)
>     fieldsets = deepcopy(PageAdmin.fieldsets) + keydoc_extra_fieldsets
>
>
> admin.site.register(KeyDocument, KeyDocsAdmin)
>
>
> admin.site.register(KeyDoc)
>
>
> The result is that the field of Additional Info (which its variable is 
> info) is not showing at all.
>
> Can anyone help me with this?
>
> 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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to