Re: [mezzanine-users] TEMPLATE_ACCESSIBLE_SETTINGS

2016-11-11 Thread Danny

What you've got looks pretty good to me - I have something very similar.

It should be in defaults.py inside an app inside your project. The only 
difference with mine is that the TEMPLATE_ACCESSIBLE_SETTINGS call is at 
the bottom of the list, i.e. after the other settings have been registered.


Hope this helps.

Seeya. Danny.

On 11/11/2016 11:05 PM, JM M wrote:
Hi I'm having trouble showing up the settings for the social media 
here is the code, tried searching but no luck I read the comments 
below of the blog post but still don't work. Anyone want to help? thanks.

from mezzanine.confimport register_setting
from django.utils.translationimport ugettext_lazyas _

register_setting(
 name="TEMPLATE_ACCESSIBLE_SETTINGS", append=True, default=("SOCIAL_LINK_FACEBOOK", 
"SOCIAL_LINK_TWITTER", "SOCIAL_LINK_VIMEO"), )

register_setting(
 name="SOCIAL_LINK_FACEBOOK", label=_("Facebook link"), description=_("If present a Facebook icon 
linking here will be in the " "header."), editable=True, default="https://facebook.com/mezzatheme;, )

register_setting(
 name="SOCIAL_LINK_TWITTER", label=_("Twitter link"), description=_("If present a Twitter icon 
linking here will be in the " "header."), editable=True, default="https://twitter.com/mezzatheme;, )

register_setting(
 name="SOCIAL_LINK_VIMEO", label=_("VIMEO link"), description=_("If present a VIMEO icon linking 
here will be in the " "header."), editable=True, default="https://VIMEO.com/mezzatheme;, )

--
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] Re: Extra model fields at Mezzanine's derived package ?

2016-11-11 Thread Eduardo Rivas
Without knowing exactly which models you're modifying, I would recommend 
to avoid field injection in reusable apps. If you're injecting stuff on 
Page, it might be better to create a custom Page type and distribute 
that with your package. See: 
http://mezzanine.jupo.org/docs/content-architecture.html#creating-custom-content-types


If you still want to go with the field injection route, there are a few 
approaches that I know of:


- Maintain your own migration history for modified models using Django's 
MIGRATION_MODULES 
http://mezzanine.readthedocs.io/en/latest/model-customization.html#field-injection-caveats


- Add support for "out of app" migrations to Django 
http://bitofpixels.com/blog/upgrading-to-mezzanine-4/ (see the 
EXTRA_MODEL_FIELDS section)


- Create a model with your extra fields and couple it with a OneToOne field.

--
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] Re: Extra model fields at Mezzanine's derived package ?

2016-11-11 Thread joanbm
 Fixed *class_prepared* signal call (due to weak reference to handler) but 
issue with migrations remains.
 

-- 
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] Extra model fields at Mezzanine's derived package ?

2016-11-11 Thread joanbm
Hello,

I've built Mezzanine/Cartridge based project with lot of generic code 
suited for other similar projects.
I'd like to separate it in a standalone package - extension and use it as 
other 3rd party Django apps.

There is however a problem. It extends Mezzanine and Cartridge models with 
additional fields by `EXTRA_MODEL_FIELDS` mechanism, but it works AFAIK for 
target project only, in its settings.
I'm looking for some advice how build such extension, without retire to 
subclassing, thus introducing original n+1 query problem.

Played with manual call to `contribute_to_class` new field's method through 
`class_prepared` signal in package's init file, but registered function is 
never called. Also have no idea how write migrations, because Django/South 
couldn't generate them.



-- 
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] TEMPLATE_ACCESSIBLE_SETTINGS

2016-11-11 Thread JM M
Hi I'm having trouble showing up the settings for the social media here is 
the code, tried searching but no luck I read the comments below of the blog 
post but still don't work. Anyone want to help? thanks. 

from mezzanine.conf import register_setting
from django.utils.translation import ugettext_lazy as _

register_setting(
name="TEMPLATE_ACCESSIBLE_SETTINGS",
append=True,
default=("SOCIAL_LINK_FACEBOOK",
 "SOCIAL_LINK_TWITTER",
 "SOCIAL_LINK_VIMEO"),
)

register_setting(
name="SOCIAL_LINK_FACEBOOK",
label=_("Facebook link"),
description=_("If present a Facebook icon linking here will be in the "
  "header."),
editable=True,
default="https://facebook.com/mezzatheme;,
)

register_setting(
name="SOCIAL_LINK_TWITTER",
label=_("Twitter link"),
description=_("If present a Twitter icon linking here will be in the "
  "header."),
editable=True,
default="https://twitter.com/mezzatheme;,
)

register_setting(
name="SOCIAL_LINK_VIMEO",
label=_("VIMEO link"),
description=_("If present a VIMEO icon linking here will be in the "
  "header."),
editable=True,
default="https://VIMEO.com/mezzatheme;,
)


-- 
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] Re: Upgrading from 4.1 to 4.2 fails

2016-11-11 Thread Gerhard Spitzlsperger
Hi Ryne,

thanks a lot, I guess I was not precise enough. In case of fresh install it 
works for me as well. But what I essentially want to do is to upgrade from 
4.1 to 4.2.2. And here I got so far reproducible the same problem cannot 
add subpages.

What I do is create a fresh projects, copy over all the files including 
settings from the 4.1 project and then I get the described behaviour. I 
guess my mistake is somehow in that procedure.

The code that generates the menus look the same in both cases (two 
different files) :

  {% if model.perms.add %}
{{ model.meta_verbose_name|capfirst 
}}
  {% endif %}

As it seems that some checks are done maybe due to my upgrade procedure 
something strange happend.

Thanks a lot
Gerhard


Am Freitag, 11. November 2016 01:34:40 UTC+1 schrieb Ryne Everett:
>
> I followed the installation docs (
> http://mezzanine.jupo.org/docs/overview.html#installation), went to the 
> default pages, and was able to add subpages no problem.
>
>
> On 11/10/2016 04:09 AM, Gerhard Spitzlsperger wrote:
>
> Hi Ryne,
>
> thanks for your quick answer. I tried again with a fresh install, for me 
> it does not fix the issue. I have installed as well django-modeltranslation 
> and mezzanine-pagedown.
> It works under 4.1 could you please let me know what you  exactly do.
>
> Thank you very much
> Gerhard
>
>
>
> Am Mittwoch, 14. September 2016 12:26:26 UTC+2 schrieb Gerhard 
> Spitzlsperger: 
>>
>> Dear All,
>>
>> I tried to upgrade mezzanine from 4.1 to 4.2 and the system crashed. As I 
>> did not find somethin different I did a naive pip3 --upgrade. I tried to 
>> sites (one pretty fresh created under 4.1)
>>
>> both sites are deployed using apache2.4 and mod_wsgi
>>
>> after downgrading again to 4.1 everything worked.
>>
>> Thanks a lot for any hint
>> Gerhard
>>
>> Traceback (most recent call last):
>> [:error] [pid 9181] [remote ...:40070]   File 
>> "/home/django/mezzanine/blueberrye/blueberrye/wsgi.py", line 29, in 
>> [:error] [pid 9181] [remote ...:40070] application = 
>> get_wsgi_application()
>> [:error] [pid 9181] [remote ...:40070]   File 
>> "/home/django/mezzanine/lib/python3.4/site-packages/django/core/wsgi.py", 
>> line 13, in get_wsgi_application
>> [:error] [pid 9181] [remote ...:40070] django.setup(set_prefix=False)
>> [:error] [pid 9181] [remote ...:40070]   File 
>> "/home/django/mezzanine/lib/python3.4/site-packages/django/__init__.py", 
>> line 27, in setup
>> [:error] [pid 9181] [remote ...:40070] 
>> apps.populate(settings.INSTALLED_APPS)
>> [:error] [pid 9181] [remote ...:40070]   File 
>> "/home/django/mezzanine/lib/python3.4/site-packages/django/apps/registry.py",
>>  
>> line 78, in populate
>> [:error] [pid 9181] [remote ...:40070] raise RuntimeError("populate() 
>> isn't reentrant")
>> [:error] [pid 9181] [remote ...:40070] RuntimeError: populate() isn't 
>> reentrant
>> [[:info] [pid 9181] mod_wsgi (pid=9181): Shutdown requested 
>> 'blueberrye.cc'.
>> [:info] [pid 9181] mod_wsgi (pid=9181): Stopping process 'blueberrye.cc'.
>> [:info] [pid 9181] mod_wsgi (pid=9181): Destroying interpreters.
>> [:info] [pid 9181] mod_wsgi (pid=9181): Destroy interpreter 
>> 'blueberrye.cc|'.
>> [:error] [pid 9181] Exception ignored in: > '/usr/lib/python3.4/threading.py'>
>> [:error] [pid 9181] Traceback (most recent call last):
>> [:error] [pid 9181]   File "/usr/lib/python3.4/threading.py", line 1288, 
>> in _shutdown
>> [:error] [pid 9181] assert tlock is not None
>> [:error] [pid 9181] AssertionError: 
>> [:info] [pid 9181] mod_wsgi (pid=9181): Cleanup interpreter ''.
>> [:info] [pid 9181] mod_wsgi (pid=9181): Terminating Python.
>> [:error] [pid 9181] Exception ignored in: > '/usr/lib/python3.4/threading.py'>
>> [:error] [pid 9181] Traceback (most recent call last):
>> [:error] [pid 9181]   File "/usr/lib/python3.4/threading.py", line 1288, 
>> in _shutdown
>> [:error] [pid 9181] assert tlock is not None
>> AssertionError: 
>>
>>
>> -- 
> 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.