Thank you for the response.. I have gone through the Django tutorial and it 
works fine, in isolation. I tried to integrate the polls into a mezzanine 
project, (After fighting that for a day could not get that to work). 

So I thought the next thing to try was using the authors example and trying 
to integrate it into Mezzanine. Created all the files under a directory 
"authors": (admin.py, apps.py, models.py, tests.py, urls.py, views.py)

I don't know how to modify the urls.py within the mysite directory without 
breaking it. I would like to be able to call <site>/authors and get to the 
custom content.

Thanks,
Larry





On Tuesday, May 7, 2019 at 11:32:51 AM UTC-6, Eduardo Rivas wrote:
>
> Hi Larry.
>
>  
>
> You’re correct; the tutorial assumes you’re comfortable writing Django 
> applications. In this particular instance it assumes you have an app (a 
> top-level directory, let’s call it “authors”) and you’d add the code to 
> “authors/models.py” and “authors/admin.py”.
>
>  
>
> I recommend you go over the official Django tutorial where you’ll create 
> an app called “polls” and learn how to modify its model and admin 
> definitions. That knowledge will be essential when working with Mezzanine 
> sites. Good luck!
>
>  
>
> *From: *[email protected] <javascript:>
> *Sent: *Tuesday, May 7, 2019 11:14 AM
> *To: *Mezzanine Users <javascript:>
> *Subject: *[mezzanine-users] Newbe question on Creating Custom Content
>
>  
> The tutorial says:
>
> _______________________________________________________________
>
>  
> 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* models
>
> *from* *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* admin
>
> *from* *mezzanine.pages.admin* *import* PageAdmin
>
> *from* *.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] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mezzanine-users/00999e73-f3da-41e3-b161-f61d13f42031%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/mezzanine-users/00999e73-f3da-41e3-b161-f61d13f42031%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>  
>

-- 
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/63bf2a72-c618-4de5-b5aa-a0c2d4422bdd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to