Re: [mezzanine-users] Trying to make a section of my site that's like Blog Posts

2017-10-11 Thread Tom Tanner
Oh cool, I didn't know about this video. Thanks. And I've done the basic 
Django tutorial. Though I'm gonna go thru it again to try and better 
understand Mezzanine site-making.

On Wednesday, October 11, 2017 at 9:15:13 PM UTC-4, Eduardo Rivas wrote:
>
> Also (and I know I've posted this a ton lately, but I think it's relevant) 
> here's a talk describing the general steps I follow when building apps for 
> Mezzanine: https://www.youtube.com/watch?v=yVAmMXES2EU
>
> It touches on how to uses Mezzanine's models, admin, and template 
> utilities.
>
> On 2017-10-11 7:08 PM, Eduardo Rivas wrote:
>
> Hi Tom.
>
> You need to register your model in the admin. You can use 
> mezzanine.blog.admin as an example: 
> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/blog/admin.py
> .
>
> This admin configuration is a bit complex, so I recommend you become 
> familiar with Django's admin in general before diving into it. Have you 
> completed the official Django tutorial? It should introduce you to all 
> these concepts: https://docs.djangoproject.com/en/1.11/intro/tutorial01/
>
> On 2017-10-11 7:02 PM, Tom Tanner wrote:
>
>
> 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 mezzanine-use...@googlegroups.com .
> 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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Trying to make a section of my site that's like Blog Posts

2017-10-11 Thread Eduardo Rivas
Also (and I know I've posted this a ton lately, but I think it's 
relevant) here's a talk describing the general steps I follow when 
building apps for Mezzanine: https://www.youtube.com/watch?v=yVAmMXES2EU


It touches on how to uses Mezzanine's models, admin, and template utilities.


On 2017-10-11 7:08 PM, Eduardo Rivas wrote:


Hi Tom.

You need to register your model in the admin. You can use 
mezzanine.blog.admin as an example: 
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/blog/admin.py.


This admin configuration is a bit complex, so I recommend you become 
familiar with Django's admin in general before diving into it. Have 
you completed the official Django tutorial? It should introduce you to 
all these concepts: 
https://docs.djangoproject.com/en/1.11/intro/tutorial01/



On 2017-10-11 7:02 PM, Tom Tanner wrote:


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__ importunicode_literals


fromdjango.db importmodels
fromdjango.core.urlresolvers importreverse
fromdjango.utils.translation importugettext_lazy as_


frommezzanine.conf importsettings
frommezzanine.core.fields importFileField
frommezzanine.core.models importDisplayable,Ownable,RichText,Slugged
frommezzanine.generic.fields importCommentsField,RatingField
frommezzanine.utils.models importAdminThumbMixin,upload_to


# Create your models here.


classProjectsPage(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"


classMeta:
   verbose_name=_("Project link")
   verbose_name_plural=_("Project links")
   ordering=("-publish_date",)




classProjectCategory(Slugged):
'''
 A category for grouping project links into a series
 '''


classMeta:
   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 mezzanine-users+unsubscr...@googlegroups.com 
.

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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Trying to make a section of my site that's like Blog Posts

2017-10-11 Thread Eduardo Rivas

Hi Tom.

You need to register your model in the admin. You can use 
mezzanine.blog.admin as an example: 
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/blog/admin.py.


This admin configuration is a bit complex, so I recommend you become 
familiar with Django's admin in general before diving into it. Have you 
completed the official Django tutorial? It should introduce you to all 
these concepts: https://docs.djangoproject.com/en/1.11/intro/tutorial01/



On 2017-10-11 7:02 PM, Tom Tanner wrote:


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__ importunicode_literals


fromdjango.db importmodels
fromdjango.core.urlresolvers importreverse
fromdjango.utils.translation importugettext_lazy as_


frommezzanine.conf importsettings
frommezzanine.core.fields importFileField
frommezzanine.core.models importDisplayable,Ownable,RichText,Slugged
frommezzanine.generic.fields importCommentsField,RatingField
frommezzanine.utils.models importAdminThumbMixin,upload_to


# Create your models here.


classProjectsPage(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"


classMeta:
   verbose_name=_("Project link")
   verbose_name_plural=_("Project links")
   ordering=("-publish_date",)




classProjectCategory(Slugged):
'''
 A category for grouping project links into a series
 '''


classMeta:
   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 mezzanine-users+unsubscr...@googlegroups.com 
.

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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Trying to make a section of my site that's like Blog Posts

2017-10-11 Thread Tom Tanner

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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Newbie user -- How do I change where `about/` goes to?

2017-10-11 Thread Tom Tanner
Hm, I'm still doing something wrong. Here's what 
`PROJECT/myTheme/theme/templates/about/about-canvas.html` looks like now:


{% extends "base.html" %}
{% load mezzanine_tags i18n %}


{% block meta_title %}
 {% if page %}
 {{ page.meta_title }}
 {% else %}
 {% trans "About" %}
 {% endif %}
{% endblock %}


TESTING HERE


{% include "includes/contact_form.html" %}


`PROJECT/myTheme/theme/templates/about/includes/contact_form.html still 
looks the same, though I did change the hyphens in the filenames to 
underscores, as you may notice. 

I copied the contact form HTML from one of the core Mezzanine templates, so 
I'm not totally sure what I'm doing. 

To give you a better idea of what I'm trying to do... If you open the Admin 
section of a new Mezzanine site, check out the "Pages" section. There's a 
"Contact" page. I'm trying to change that page into my "About" page. I'd 
like the page to include info about the site, along with the contact form 
that comes along with it by default. I thought copying the template at 
`mezzanine/forms/templates/pages/form.html` would help with this.

On Wednesday, October 11, 2017 at 3:35:40 AM UTC-4, Joseph Mohan wrote:
>
> Your url has to match the filename (or vise-versa)
>
> So in Content/Pages/About  In the Meta section, the Url should be 
> /about-canvas 
> (http://127.0.0.1:8000/about-canvas)
>
> *or* 
>
> Rename about-canvas.html to about.html
>
> Also, always make sure to restart the development server when adding new 
> files.
>
> Hope that helps
>
> On Tue, Oct 10, 2017 at 10:39 PM, Tom Tanner  > wrote:
>
>> Hello,
>>
>> I've started learning Mezzanine over the past few weeks. I'm making my 
>> own theme. I want to make an `about/` page containing the default "contact 
>> us" form Mezzanine comes with. Here's what part of my project looks like in 
>> directory. `PROJECT/myTheme/theme/templates/about`.
>>
>> In the `about/` folder, I have `about-canvas.html` and 
>> `includes/contact-form.html`.
>>
>> `about-canvas.html` looks like this. 
>>
>> {% extends "base.html" %}
>>
>>
>> {% load mezzanine_tags i18n %}
>>
>>
>> TESTING HERE
>>
>>
>> {% include "includes/contact-form.html" %}
>>
>> `includes/contact-form.html` looks like this 
>>
>> {% load mezzanine_tags i18n %}
>>
>>
>> {% block extra_head %}
>>  {{ block.super }}
>>  {{ form.media }}
>> {% endblock %}
>>
>>
>> {% block main %}
>> {{ block.super }}
>> {% if request.GET.sent %}
>>  {% editable page.form.response %}
>>  {{ page.form.response|richtext_filters|safe }}
>>  {% endeditable %}
>> {% else %}
>>  {% with page.form as page_form %}
>>  {% editable page_form.content %}
>>  {{ page_form.content|richtext_filters|safe }}
>>  {% endeditable %}
>>  {% endwith %}
>>
>>
>>  {% errors_for form %}
>>  
>>  > enctype="multipart/form-data"{% endif %}>
>>  {% fields_for form %}
>>  
>>  >  value="{% if page.form.button_text %}{{ page.form.button_text }}{% else 
>> %}{% trans "Submit" %}{% endif %}">
>>  
>>  
>>  
>>
>>
>> {% endif %}
>>
>>
>> {% endblock %}
>>
>>
>>
>>
>> {% block extra_js %}
>> {{ block.super }}
>> 
>> $(function() {$('.mezzanine-form 
>> :input:visible:enabled:first').focus();});
>> 
>> {% endblock %}
>>
>>
>> Yet when I fire up `python manage.py runserver`, and head to "
>> http://127.0.0.1:8000/about/;, it does not appear anything changed. I 
>> don't see the phrase "TESTING HERE" on the page to indicate that Mezzanine 
>> reads from my custom template.
>>
>> What must I change so that Mezzanine will read `about-canvas.html` when I 
>> go to "http://127.0.0.1:8000/about/;?
>>
>> -- 
>> 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.
>>
>
>

-- 
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.


Re: [mezzanine-users] Forcing Page Link to open in new window

2017-10-11 Thread Erwin Sterrenburg
Just to let you guys know that I also really want/like this functionality.
For now, I'll either go for the jquery solution or inject an extra model 
field, but I'd like to see this as a part of the core functionality :)

Kind regards,
Erwin


On Tuesday, September 5, 2017 at 8:01:29 PM UTC+2, Christian Wiegand wrote:
>
> Hi Wim, 
>
> you got the point. This change is now a year old and since i'm not sure if 
> i'm still able to merge my changes to the actual mezzanine version, i 
> created a new fork where i checked in only the raw changes (9a85262 
> ).
>  
> The repository lacks all translation changes and the migrations file. Hope 
> that makes it more clear.
>
> Best regards,
>
> Christian
>
> 
> 
>

-- 
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.


Re: [mezzanine-users] How to use mezzanine.forms?

2017-10-11 Thread Eduardo Rivas

Hello Rainell.

mezzanine.forms is not a like django.forms. mezzanine.forms is meant for 
admin users to create forms from the admin. It is basically a "form 
builder" for your end users.


To use it make sure it is in you INSTALLED_APPS and in the admin create 
a new page of type "Form". When editing that page you'll see the inlines 
that allow users to create their custom forms.



On 2017-10-11 10:10 AM, Rainell Dilou Gómez wrote:

Hello everyone,
in the project that I am doing I will start working with forms. I know 
what I can and should do if I work with django.forms, and I suppose 
mezzanine.forms can help me even more, but how? In the Mezzanine 
documentation there are no explanations and examples on how to use 
mezzanine.forms.
Can anyone tell me where to find explanations and examples about using 
mezzanine.forms?

--
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.


--
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.


[mezzanine-users] How to use mezzanine.forms?

2017-10-11 Thread Rainell Dilou Gómez
Hello everyone,
in the project that I am doing I will start working with forms. I know what 
I can and should do if I work with django.forms, and I suppose 
mezzanine.forms can help me even more, but how? In the Mezzanine 
documentation there are no explanations and examples on how to use 
mezzanine.forms. 
Can anyone tell me where to find explanations and examples about using 
mezzanine.forms?

-- 
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.


Re: [mezzanine-users] Newbie user -- How do I change where `about/` goes to?

2017-10-11 Thread Joseph Mohan
Your url has to match the filename (or vise-versa)

So in Content/Pages/About  In the Meta section, the Url should be /about-canvas
(http://127.0.0.1:8000/about-canvas)

*or*

Rename about-canvas.html to about.html

Also, always make sure to restart the development server when adding new
files.

Hope that helps

On Tue, Oct 10, 2017 at 10:39 PM, Tom Tanner 
wrote:

> Hello,
>
> I've started learning Mezzanine over the past few weeks. I'm making my own
> theme. I want to make an `about/` page containing the default "contact us"
> form Mezzanine comes with. Here's what part of my project looks like in
> directory. `PROJECT/myTheme/theme/templates/about`.
>
> In the `about/` folder, I have `about-canvas.html` and
> `includes/contact-form.html`.
>
> `about-canvas.html` looks like this.
>
> {% extends "base.html" %}
>
>
> {% load mezzanine_tags i18n %}
>
>
> TESTING HERE
>
>
> {% include "includes/contact-form.html" %}
>
> `includes/contact-form.html` looks like this
>
> {% load mezzanine_tags i18n %}
>
>
> {% block extra_head %}
>  {{ block.super }}
>  {{ form.media }}
> {% endblock %}
>
>
> {% block main %}
> {{ block.super }}
> {% if request.GET.sent %}
>  {% editable page.form.response %}
>  {{ page.form.response|richtext_filters|safe }}
>  {% endeditable %}
> {% else %}
>  {% with page.form as page_form %}
>  {% editable page_form.content %}
>  {{ page_form.content|richtext_filters|safe }}
>  {% endeditable %}
>  {% endwith %}
>
>
>  {% errors_for form %}
>  
>   enctype="multipart/form-data"{% endif %}>
>  {% fields_for form %}
>  
>value="{% if page.form.button_text %}{{ page.form.button_text }}{% else
> %}{% trans "Submit" %}{% endif %}">
>  
>  
>  
>
>
> {% endif %}
>
>
> {% endblock %}
>
>
>
>
> {% block extra_js %}
> {{ block.super }}
> 
> $(function() {$('.mezzanine-form :input:visible:enabled:first')
> .focus();});
> 
> {% endblock %}
>
>
> Yet when I fire up `python manage.py runserver`, and head to "
> http://127.0.0.1:8000/about/;, it does not appear anything changed. I
> don't see the phrase "TESTING HERE" on the page to indicate that Mezzanine
> reads from my custom template.
>
> What must I change so that Mezzanine will read `about-canvas.html` when I
> go to "http://127.0.0.1:8000/about/;?
>
> --
> 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.
>

-- 
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.