Re: [mezzanine-users] Template not rendering

2016-01-27 Thread fosi
Hello stephen, looking at the page.html and the code pasted, it seems to me 
that the defined block is been used. If i'm
 missing something kindly point it out to me. Thank you
On Tuesday, January 26, 2016 at 11:56:17 PM UTC+1, Stephen McDonald wrote:
>
> If you're extending a template, don't you need to use the blocks it 
> defines?
>
>
> https://github.com/stephenmcd/mezzanine/blob/a84f38c38bdaee0b21c9e9209cec5148ba0ae108/mezzanine/pages/templates/pages/page.html#L22-L23
>
> On Wed, Jan 27, 2016 at 8:51 AM, fosi > 
> wrote:
>
>>  Hello,
>>
>> I created a Homepage that is powered by the admin, the content of the 
>> homepage should be Images stacked on each other, after creating my model
>> and index.html template, nothing  seems to be coming up even though the 
>> block tags are included in base.html. Some help here please
>>
>> here's what my model looks like:
>> #model.py :
>>
>> class HomePage(Page, RichText):
>> '''
>> A page representing the format of the home page
>> '''
>> 
>> 
>> class Meta:
>> verbose_name = _("Home page")
>> verbose_name_plural = _("Home pages")
>> 
>> 
>> 
>> class Gallery(models.Model):
>> homepage = models.ForeignKey("HomePage", blank =True, null=True)
>> image = FileField(verbose_name=_("Image"),
>> upload_to=upload_to("theme.Gallery.image", "gallery")
>> )
>>  
>> def __unicode__(self):
>> return self.image.name
>>
>>
>> and my index.html :
>>
>> {% extends "pages/page.html" %}
>>
>> {% load mezzanine_tags staticfiles %}
>>
>>
>> {% block all_content %}
>> {% if page.homepage.Gallerys.all %}
>>
>>
>> {% for gallery in page.homepage.Gallerys.all %}
>> 
>> {% endfor %}   
>>
>>
>> {% endif %}
>> {% endblock %}
>>
>>
>>
>> -- 
>> 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.
>>
>
>
>
> -- 
> Stephen McDonald
> http://jupo.org
>

-- 
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 translate url with modeltranslation in Mezzanine

2016-01-27 Thread Cajoline
Hi,


I am creating a multilingual site and I would like to know how to translate 
slug ?

Thank you !




-- 
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 translate slug with modeltranslation

2016-01-27 Thread Cajoline

Hi !
I am creating a multilingual site and I would like to know how to translate 
slug ?

Thank you

-- 
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] Template not rendering

2016-01-27 Thread Ken Bolton
Hi Fosi,

In the link Stephen provided, he highlighted lines 22-23 of page.html, in
which the reader will notice the block you call `all_content` should be
called `main`.

hth.

-ken

On Wed, Jan 27, 2016 at 7:16 AM, fosi  wrote:

> Hello stephen, looking at the page.html and the code pasted, it seems to
> me that the defined block is been used. If i'm
>  missing something kindly point it out to me. Thank you
> On Tuesday, January 26, 2016 at 11:56:17 PM UTC+1, Stephen McDonald wrote:
>>
>> If you're extending a template, don't you need to use the blocks it
>> defines?
>>
>>
>> https://github.com/stephenmcd/mezzanine/blob/a84f38c38bdaee0b21c9e9209cec5148ba0ae108/mezzanine/pages/templates/pages/page.html#L22-L23
>>
>> On Wed, Jan 27, 2016 at 8:51 AM, fosi  wrote:
>>
>>>  Hello,
>>>
>>> I created a Homepage that is powered by the admin, the content of the
>>> homepage should be Images stacked on each other, after creating my model
>>> and index.html template, nothing  seems to be coming up even though the
>>> block tags are included in base.html. Some help here please
>>>
>>> here's what my model looks like:
>>> #model.py :
>>>
>>> class HomePage(Page, RichText):
>>> '''
>>> A page representing the format of the home page
>>> '''
>>>
>>>
>>> class Meta:
>>> verbose_name = _("Home page")
>>> verbose_name_plural = _("Home pages")
>>>
>>>
>>>
>>> class Gallery(models.Model):
>>> homepage = models.ForeignKey("HomePage", blank =True, null=True)
>>> image = FileField(verbose_name=_("Image"),
>>> upload_to=upload_to("theme.Gallery.image", "gallery")
>>> )
>>>
>>> def __unicode__(self):
>>> return self.image.name
>>>
>>>
>>> and my index.html :
>>>
>>> {% extends "pages/page.html" %}
>>>
>>> {% load mezzanine_tags staticfiles %}
>>>
>>>
>>> {% block all_content %}
>>> {% if page.homepage.Gallerys.all %}
>>>
>>>
>>> {% for gallery in page.homepage.Gallerys.all %}
>>> 
>>> {% endfor %}
>>>
>>>
>>> {% endif %}
>>> {% endblock %}
>>>
>>>
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> Stephen McDonald
>> http://jupo.org
>>
> --
> 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] Problem deploying Mezzanine on DigitalOcean

2016-01-27 Thread Eduardo Rivas
Looks like a migration in your onepage app is referencing the pages.Page
table before it's created in the DB. IMO it has something to do with
your models and migrations. Can you check if the error happens when
running createdb locally in a blank Postgres DB? Might be easier to
debug in your dev machine.

Also, are you using sqlite while developing? It is sometimes more
forgiving with migration issues than Postgres (at least that's been my
experience since Django incorporated migrations in 1.7). My
recommendation is to also use Postgres in development to catch these
errors early; or use sqlite in production :P

-- 
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] Problem deploying Mezzanine on DigitalOcean

2016-01-27 Thread George M
I've been trying all day to deploy my first mezzanine site on DO.
All seemed to be going well until the deployment gets to the database.
Somehow this error will not go away.

[49.109.99.39] out: Operations to perform:
[49.109.99.39] out:   Synchronize unmigrated apps: staticfiles, boot, 
filebrowser_safe, sitemaps, compressor, onepage, grappelli_safe
[49.109.99.39] out:   Apply all migrations: core, redirects, 
django_comments, sessions, admin, twitter, galleries, onepage, auth, sites, 
blog, generic, contenttypes, conf, forms, pages
[49.109.99.39] out: Synchronizing apps without migrations:
[49.109.99.39] out:   Creating tables...
[49.109.99.39] out: Creating table onepage_homepage
[49.109.99.39] out: Creating table onepage_homesection
[49.109.99.39] out: Creating table onepage_about
[49.109.99.39] out: Creating table onepage_aboutsection
[49.109.99.39] out: Creating table onepage_services
[49.109.99.39] out: Creating table onepage_servicesection
[49.109.99.39] out: Creating table onepage_servicesubsection
[49.109.99.39] out: Creating table onepage_blog
[49.109.99.39] out: Creating table onepage_blogimage
[49.109.99.39] out: Creating table onepage_blogslide
[49.109.99.39] out: Creating table onepage_testimonial
[49.109.99.39] out: Creating table onepage_testimonialslide
[49.109.99.39] out: Creating table onepage_contact
[49.109.99.39] out: Creating table onepage_contactsection
[49.109.99.39] out: Running deferred SQL...
[49.109.99.39] out: Traceback (most recent call last):
[49.109.99.39] out:   File "/home/mucheru/mezzanine/akia/manage.py", line 
14, in 
[49.109.99.39] out: execute_from_command_line(sys.argv)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 338, in execute_from_command_line
[49.109.99.39] out: utility.execute()
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 330, in execute
[49.109.99.39] out: 
self.fetch_command(subcommand).run_from_argv(self.argv)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 390, in run_from_argv
[49.109.99.39] out: self.execute(*args, **cmd_options)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 441, in execute
[49.109.99.39] out: output = self.handle(*args, **options)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/mezzanine/core/management/commands/createdb.py",
 
line 60, in handle
[49.109.99.39] out: interactive=self.interactive)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 120, in call_command
[49.109.99.39] out: return command.execute(*args, **defaults)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 441, in execute
[49.109.99.39] out: output = self.handle(*args, **options)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py",
 
line 179, in handle
[49.109.99.39] out: created_models = self.sync_apps(connection, 
executor.loader.unmigrated_apps)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py",
 
line 317, in sync_apps
[49.109.99.39] out: cursor.execute(statement)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/db/backends/utils.py",
 
line 64, in execute
[49.109.99.39] out: return self.cursor.execute(sql, params)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/db/utils.py",
 
line 97, in __exit__
[49.109.99.39] out: six.reraise(dj_exc_type, dj_exc_value, traceback)
[49.109.99.39] out:   File 
"/home/mucheru/.virtualenvs/akia/local/lib/python2.7/site-packages/django/db/backends/utils.py",
 
line 62, in execute
[49.109.99.39] out: return self.cursor.execute(sql)
[49.109.99.39] out: django.db.utils.ProgrammingError: relation "pages_page" 
does not exist


Fatal error: run() encountered an error (return code 1) while executing 
'/home/mucheru/.virtualenvs/akia/bin/python 
/home/mucheru/mezzanine/akia/manage.py createdb --noinput --nodata'

Any help appreciated.

-- 
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] Problem deploying Mezzanine on DigitalOcean

2016-01-27 Thread Eduardo Rivas
Never mind, I think the problem is that you're not using migrations with
your onepage app. I believe that any app that depends on another app
that uses migrations (like mezzanine.pages) must also use migrations itself.

-- 
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] Blog archive context has English month_name, even on a Dutch site.

2016-01-27 Thread Wim Feijen
Hi, I clarified the subject.

I propose to pass the selected month in the blog archives as an integer to 
the template to solve the mentioned problem and will commit a pull request 
for this.

WIm

On Wednesday, 23 December 2015 15:43:15 UTC+1, Wim Feijen wrote:
>
> Hello,
>
> For my blog archive pages, I like to use a pull-down where the selected 
> month is selected. 
>
> For that, I want to compare the selected year and month - which are in the 
> url, for example /blog/archive/2015/12/ and passed as context variables 
> into the template - and compare them with the year and month of all the 
> months in the archive pull-down.
>
> For me it gets difficult because the month from the url is converted using 
> a dictionary.
>
> See: 
> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/blog/views.py
> line 4.  from calendar import month_name
> line 38.  month = month_name[int(month)]
>
> My site is Dutch, but month_name gives me English names. In another 
> multilingual site, the English version works fine, but the Dutch site does 
> not. Compare:
> https://www.roominreturn.nl/en/blog/archive/2015/7/ 
> https://www.roominreturn.nl/nl/blog/archive/2015/7/ 
>
> What would be a proper solution? 
>
> For me, one solution would be if the blog views passed the selected month 
> as an integer into the context. But maybe there are other solutions?
>
> Currently, I am using in my template:
>   
> {% with year as selected_year %}
> {% with month as selected_month %}
> {# YEAR: {{ selected_year }} MONTH: {{ 
> selected_month }} for debugging #}
> {% block blog_months %}
> {% blog_months as months %}
> {% if months %}
>
> Nieuwsarchief
>
>  id="archive-dropdown">
> Kies een 
> maand...
>
> {% for month in months %}
>
> {% ifchanged 
> archive_month.date.year %}
>  disabled="disabled">{{ month.date.year }}
> {% endifchanged %}
>
>  if month.date|date:"Y" == selected_year and month.date|date:"F" == 
> selected_month|lower %} selected="selected" {% endif %}>
> {{ month.date|date:"F" }}  ({{ 
> month.post_count }})
>
> 
> 
>
> {% endfor %}
>
> 
>
> {% endif %}
> {% endblock %}
> {% endwith %}
> {% endwith %}
> 
>
>
> Thanks for your help!
>

-- 
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 style the Contact page?

2016-01-27 Thread Márcio Moreira

Hello,

I would like to know how to style the default Contact page.

More precisely I just need to change this:




into this (inserting *class="form-control"):*




My goal is simply to have the input fields to fill 100% of the width, but I 
just could not figure out how to do this.

Thanks,
Marcio




-- 
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] site permissions not automatically created with ldap users

2016-01-27 Thread David Hoese

I just updated to Mezzanine 4.1 from 4.0.1 and made the jump to Django 
1.9.1 on python 3. I'm also using django_auth_ldap to authenticate users 
and create them automatically. This has always worked fine, but after the 
updates it doesn't seem to behave anymore. What happens now is that user 
accounts are created and added to the auth_user table in the DB, but 
nothing is added to the "core_sitepermission" table to say the user has 
access to the site. So when the user tries to log in to the admin site they 
are told they don't have permission. Users who previously had an account 
are still able to log in because they have entries in the site permissions. 
If I log in as the super user I'm able to edit the "broken" user, select 
the listed site under Site Permissions, and click Save. This adds the user 
to the site permissions table. Note that all I had to do was *select* the 
site to get it to add the permission.

Has anyone had anything like this happen to them? Any ideas where I should 
start looking in the source code to debug this? It's been a while since 
I've touched this site so I could be missing something obvious. Thanks.

-- 
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 style the Contact page?

2016-01-27 Thread Eduardo Rivas
I recommend writing new CSS rules or tweaking the selectors instead of
trying to change the markup of the form. If I remember correctly, form
fields are wrapped in a div with a particular class, which should let
you write something like:

.wrapper-class > input {width: 100%}

-- 
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] Blog archive context has English month_name, even on a Dutch site.

2016-01-27 Thread Stephen McDonald
Thanks for the info - I've fixed it here:

https://github.com/stephenmcd/mezzanine/commit/cf7f7eadd138d9635751d2c2825492ef4749b238

On Thu, Jan 28, 2016 at 3:35 AM, Wim Feijen  wrote:

> Hi, I clarified the subject.
>
> I propose to pass the selected month in the blog archives as an integer to
> the template to solve the mentioned problem and will commit a pull request
> for this.
>
> WIm
>
> On Wednesday, 23 December 2015 15:43:15 UTC+1, Wim Feijen wrote:
>>
>> Hello,
>>
>> For my blog archive pages, I like to use a pull-down where the selected
>> month is selected.
>>
>> For that, I want to compare the selected year and month - which are in
>> the url, for example /blog/archive/2015/12/ and passed as context variables
>> into the template - and compare them with the year and month of all the
>> months in the archive pull-down.
>>
>> For me it gets difficult because the month from the url is converted
>> using a dictionary.
>>
>> See:
>> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/blog/views.py
>> line 4.  from calendar import month_name
>> line 38.  month = month_name[int(month)]
>>
>> My site is Dutch, but month_name gives me English names. In another
>> multilingual site, the English version works fine, but the Dutch site does
>> not. Compare:
>> https://www.roominreturn.nl/en/blog/archive/2015/7/
>> https://www.roominreturn.nl/nl/blog/archive/2015/7/
>>
>> What would be a proper solution?
>>
>> For me, one solution would be if the blog views passed the selected month
>> as an integer into the context. But maybe there are other solutions?
>>
>> Currently, I am using in my template:
>>   
>> {% with year as selected_year %}
>> {% with month as selected_month %}
>> {# YEAR: {{ selected_year }} MONTH: {{
>> selected_month }} for debugging #}
>> {% block blog_months %}
>> {% blog_months as months %}
>> {% if months %}
>>
>> Nieuwsarchief
>>
>> > id="archive-dropdown">
>> Kies een
>> maand...
>>
>> {% for month in months %}
>>
>> {% ifchanged
>> archive_month.date.year %}
>> > disabled="disabled">{{ month.date.year }}
>> {% endifchanged %}
>>
>> > if month.date|date:"Y" == selected_year and month.date|date:"F" ==
>> selected_month|lower %} selected="selected" {% endif %}>
>> {{ month.date|date:"F" }}
>>  ({{ month.post_count }})
>>
>>
>> 
>>
>> {% endfor %}
>>
>> 
>>
>> {% endif %}
>> {% endblock %}
>> {% endwith %}
>> {% endwith %}
>> 
>>
>>
>> Thanks for your help!
>>
> --
> 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.
>



-- 
Stephen McDonald
http://jupo.org

-- 
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 style the Contact page?

2016-01-27 Thread Márcio Moreira
Eduardo,

You are right, CSS is the way. 

Thanks,
Márcio

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