The tutorial says:
_______________________________________________________________

Creating Custom Content Types 
<http://mezzanine.jupo.org/docs/content-architecture.html#creating-custom-content-types>

In order to handle different types of pages that require more structured 
content than provided by the RichTextPage 
<http://mezzanine.jupo.org/docs/packages.html#mezzanine.pages.models.RichTextPage>
 model, 
you can simply create your own models that inherit from Page 
<http://mezzanine.jupo.org/docs/packages.html#mezzanine.pages.models.Page>. 
For example if we wanted to have pages that were authors with books:

from django.db import modelsfrom mezzanine.pages.models import Page
# The members of Page will be inherited by the Author model, such# as title, 
slug, etc. For authors we can use the title field to# store the author's name. 
For our model definition, we just add# any extra fields that aren't part of the 
Page model, in this# case, date of birth.
class Author(Page):
    dob = models.DateField("Date of birth")
class Book(models.Model):
    author = models.ForeignKey("Author")
    cover = models.ImageField(upload_to="authors")

Next you’ll need to register your model with Django’s admin to make it 
available as a content type. If your content type only exposes some new 
fields that you’d like to make editable in the admin, you can simply 
register your model using the mezzanine.pages.admin.PageAdmin 
<http://mezzanine.jupo.org/docs/packages.html#mezzanine.pages.admin.PageAdmin>
 class:

from django.contrib import adminfrom mezzanine.pages.admin import PageAdminfrom 
.models import Author
admin.site.register(Author, PageAdmin)


Questions:
1) I assume the first block of code is a new .py file, called Author.py?  
In what directory does it go?
2) The second block goes in some existing file? Which one?

I think the Tutorial assumes some knowledge of structure that I don't 
understand.

Thanks in advance for your help.

Larry
. 

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/00999e73-f3da-41e3-b161-f61d13f42031%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to