Re: [mezzanine-users] How to upgrade an existing Mezzanine 3.1.9 project to Mezzanine 4.0.0?

2015-07-12 Thread Stephen McDonald
We could use a guide - would you be interested in trying the upgrade and
documenting the process?

On Sat, Jul 11, 2015 at 12:07 PM, Snowrry Wang  wrote:

> Hi,
>I am really excited about this 4.0 release since it uses latest django
> 1.7 and 1.8 which has many great things. Previously I had to start my
> project with Mezzanine 3.1.9 since the latest version was not stable at
> that time. So now my question is how can I smoothly upgrade my existing
> project to Mezzanine 4.0? I think there are many big changes including
> project directory layout, removing of south, etc. I haven't found any
> documentation about this yet. Thanks in advance.
>
> --
> 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] mezzanine-project mezzanine_project: error: unrecognized arguments: -a

2015-07-12 Thread Stephen McDonald
See here for a work-around:

https://groups.google.com/forum/#!msg/mezzanine-users/q8Cu1obn2BA/JyXCXCafwdQJ

On Sun, Jul 12, 2015 at 7:45 AM, Won Jin Kim  wrote:

> Hi,
>
> I am new user of mezzanine and catridge.
>
> Today, I tried to install mezzanine and install catridge app, but, failed
> as showing following:
>
> # mezzanine-project -a cartridge catrshop
> usage: mezzanine-project mezzanine_project [-h] [--version] [-v {0,1,2,3}]
>[--settings SETTINGS]
>[--pythonpath PYTHONPATH]
>[--traceback] [--no-color]
>[--template TEMPLATE]
>[--extension EXTENSIONS]
>[--name FILES]
>name [directory]
> mezzanine-project mezzanine_project: error: unrecognized arguments: -a
>
>
> # mezzanine-project --help
> usage: mezzanine-project mezzanine_project [-h] [--version] [-v {0,1,2,3}]
>[--settings SETTINGS]
>[--pythonpath PYTHONPATH]
>[--traceback] [--no-color]
>[--template TEMPLATE]
>[--extension EXTENSIONS]
>[--name FILES]
>name [directory]
>
> Creates a Mezzanine project directory structure for the given project name
> in
> the current directory or optionally in the given directory.
>
> positional arguments:
>   name  Name of the application or project.
>   directory Optional destination directory
>
> optional arguments:
>   -h, --helpshow this help message and exit
>   --version show program's version number and exit
>   -v {0,1,2,3}, --verbosity {0,1,2,3}
> Verbosity level; 0=minimal output, 1=normal output,
> 2=verbose output, 3=very verbose output
>   --settings SETTINGS   The Python path to a settings module, e.g.
> "myproject.settings.main". If this isn't provided,
> the
> DJANGO_SETTINGS_MODULE environment variable will be
> used.
>   --pythonpath PYTHONPATH
> A directory to add to the Python path, e.g.
> "/home/djangoprojects/myproject".
>   --traceback   Raise on CommandError exceptions
>   --no-colorDon't colorize the command output.
>   --template TEMPLATE   The path or URL to load the template from.
>   --extension EXTENSIONS, -e EXTENSIONS
> The file extension(s) to render (default: "py").
> Separate multiple extensions with commas, or use -e
> multiple times.
>   --name FILES, -n FILES
> The file name(s) to render. Separate multiple
> extensions with commas, or use -n multiple times.
>
>
> As you can see, there is no -a argument in mezzanine-project at all.
>
> How can I install catridge shopping app with mezzanine-project command?
>
> Thanks in advanced!!
>
> --
> 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] Mezzanine 4.0 with Cartridge

2015-07-12 Thread Stephen McDonald
Loosely in my head it shouldn't be, since it's something that needs to be
coordinated with system administration tasks (installing locale on the
server etc).

I'm guessing Mathias made it editable in order to make it translatable,
which in theory would allow for multiple currencies - I vaguely recall a
conversation around this as well but I don't think we explored it too much.

Thinking more about it, it probably won't work - the MoneyField (which all
monetary values in the DB use) uses the locale to determine the precision
of its underlying DecimalField - I'm pretty sure that setup would break in
conjunction with modeltranslation.

On Mon, Jul 13, 2015 at 3:11 PM, Danny  wrote:

> Thanks Stephen.
>
> Wasn't the SHOP_CURRENCY_LOCALE made editable for a reason? Personally I
> don't mind either way, but in the 0.9.5. tag it's not editable, but on
> master it was, so I'm assuming that was changed for a reason.
>
> Maybe see
>
> https://github.com/stephenmcd/cartridge/commit/79c611bd318ec095073c3b9a729b2bfa7fb4405b#diff-d3220a9516c6f9328cd3c424de02a7ef
> for the change?
>
> Mathias, you made this change, want to comment?
>
>
> Seeya. Danny.
>
> On 13 July 2015 at 15:35, Stephen McDonald  wrote:
>
>> Fixed here:
>> https://github.com/stephenmcd/cartridge/commit/c6aa87003d41ee203f5070f6601c81b844047e94
>>
>> On Mon, Jul 13, 2015 at 2:56 PM, Stephen McDonald  wrote:
>>
>>> I can confirm this bug - the demo site doesn't hit it as it defines
>>> the SHOP_CURRENCY_LOCALE setting in its settings module.
>>>
>>> On Sat, Jul 11, 2015 at 11:49 AM, Danny  wrote:
>>>
 Hi all,

 I was wondering if anyone could help me!

 I've tried the new Mezzanine 4.0 release with cartridge master (which
 Stephen said should work) and am getting AppRegistryNotReady exception from
 shop.models.Priced():

 BACKTRACE:
 
 /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:51:
 UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django
 requires. Will fall back to the domains configured as sites.
   warn("You haven't defined the ALLOWED_HOSTS settings, which "
 /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/generic/fields.py:6:
 RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated
 and will be removed in Django 1.9. Its contents have been moved to the
 fields, forms, and admin submodules of django.contrib.contenttypes.
   from django.contrib.contenttypes.generic import GenericRelation

 Traceback (most recent call last):
   File "manage.py", line 14, in 
 execute_from_command_line(sys.argv)
   File
 "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 338, in execute_from_command_line
 utility.execute()
   File
 "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 312, in execute
 django.setup()
   File
 "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/__init__.py",
 line 18, in setup
 apps.populate(settings.INSTALLED_APPS)
   File
 "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/registry.py",
 line 108, in populate
 app_config.import_models(all_models)
   File
 "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/config.py",
 line 198, in import_models
 self.models_module = import_module(models_module_name)
   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
 import_module
 __import__(name)
   File
 "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
 line 35, in 
 class Priced(models.Model):
   File
 "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
 line 41, in Priced
 unit_price = fields.MoneyField(_("Unit price"))
   File
 "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/fields.py",
 line 46, in __init__
 set_locale()
   File
 "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/utils.py", line
 103, in set_locale
 currency_locale = str(settings.SHOP_CURRENCY_LOCALE)
   File
 "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
 line 236, in __getattr__
 editable_cache = self._get_editable(request=self._current_request)
   File
 "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
 line 152, in _get_editable
 editable_settings = self._editable_caches[request] = self._load()
   File
 "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
 line 191, in _load
 for setting_obj in Setting.objects.a

Re: [mezzanine-users] Mezzanine 4.0 is released

2015-07-12 Thread Stephen McDonald
On Sun, Jul 12, 2015 at 6:27 PM, henri  wrote:

> Happy to see Mezzanine 4.0 is released.
>
> Actually I want to start an new e-commerce project based on Mezzanine and
> Cartridge on which I would like to implement the new Mezzanine project
> structure.
>
> Is there a chance that Cartridge will be upgraded soon or is it possible
> to adapt Cartridge by hand to the new structure?
>

This initially works for me:

- Create a new Mezzanine project (mezzanine-project project_name)
- Copy settings.py and urls.py from cartridge/project_template into the new
project (project_name/project_name)
- In the copied settings.py, change "from local_settings import *" to "from
.local_settings import *" (addition of a period to trigger relative import)


>
> Thanks a lot for creating this great project.
>
> Regards, Henri
>
> --
> 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] Mezzanine 4.0 with Cartridge

2015-07-12 Thread Danny
Thanks Stephen.

Wasn't the SHOP_CURRENCY_LOCALE made editable for a reason? Personally I
don't mind either way, but in the 0.9.5. tag it's not editable, but on
master it was, so I'm assuming that was changed for a reason.

Maybe see
https://github.com/stephenmcd/cartridge/commit/79c611bd318ec095073c3b9a729b2bfa7fb4405b#diff-d3220a9516c6f9328cd3c424de02a7ef
for the change?

Mathias, you made this change, want to comment?


Seeya. Danny.

On 13 July 2015 at 15:35, Stephen McDonald  wrote:

> Fixed here:
> https://github.com/stephenmcd/cartridge/commit/c6aa87003d41ee203f5070f6601c81b844047e94
>
> On Mon, Jul 13, 2015 at 2:56 PM, Stephen McDonald  wrote:
>
>> I can confirm this bug - the demo site doesn't hit it as it defines
>> the SHOP_CURRENCY_LOCALE setting in its settings module.
>>
>> On Sat, Jul 11, 2015 at 11:49 AM, Danny  wrote:
>>
>>> Hi all,
>>>
>>> I was wondering if anyone could help me!
>>>
>>> I've tried the new Mezzanine 4.0 release with cartridge master (which
>>> Stephen said should work) and am getting AppRegistryNotReady exception from
>>> shop.models.Priced():
>>>
>>> BACKTRACE:
>>> 
>>> /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:51:
>>> UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django
>>> requires. Will fall back to the domains configured as sites.
>>>   warn("You haven't defined the ALLOWED_HOSTS settings, which "
>>> /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/generic/fields.py:6:
>>> RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated
>>> and will be removed in Django 1.9. Its contents have been moved to the
>>> fields, forms, and admin submodules of django.contrib.contenttypes.
>>>   from django.contrib.contenttypes.generic import GenericRelation
>>>
>>> Traceback (most recent call last):
>>>   File "manage.py", line 14, in 
>>> execute_from_command_line(sys.argv)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> line 338, in execute_from_command_line
>>> utility.execute()
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> line 312, in execute
>>> django.setup()
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/__init__.py",
>>> line 18, in setup
>>> apps.populate(settings.INSTALLED_APPS)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/registry.py",
>>> line 108, in populate
>>> app_config.import_models(all_models)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/config.py",
>>> line 198, in import_models
>>> self.models_module = import_module(models_module_name)
>>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
>>> import_module
>>> __import__(name)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
>>> line 35, in 
>>> class Priced(models.Model):
>>>   File
>>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
>>> line 41, in Priced
>>> unit_price = fields.MoneyField(_("Unit price"))
>>>   File
>>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/fields.py",
>>> line 46, in __init__
>>> set_locale()
>>>   File
>>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/utils.py", line
>>> 103, in set_locale
>>> currency_locale = str(settings.SHOP_CURRENCY_LOCALE)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>>> line 236, in __getattr__
>>> editable_cache = self._get_editable(request=self._current_request)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>>> line 152, in _get_editable
>>> editable_settings = self._editable_caches[request] = self._load()
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>>> line 191, in _load
>>> for setting_obj in Setting.objects.all():
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/manager.py",
>>> line 228, in all
>>> return self.get_queryset()
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/core/managers.py",
>>> line 349, in get_queryset
>>> return super(DjangoCSM, self).get_queryset().filter(**lookup)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/query.py",
>>> line 679, in filter
>>> return self._filter_or_exclude(False, *args, **kwargs)
>>>   File
>>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/query.py",
>>> line 697, in _filter_or_exclude
>>> clone.query.add_q(Q(*args, **kwargs))
>>>   File
>>> "/home/danny/.virtual

Re: [mezzanine-users] Mezzanine 4.0 with Cartridge

2015-07-12 Thread Stephen McDonald
Fixed here:
https://github.com/stephenmcd/cartridge/commit/c6aa87003d41ee203f5070f6601c81b844047e94

On Mon, Jul 13, 2015 at 2:56 PM, Stephen McDonald  wrote:

> I can confirm this bug - the demo site doesn't hit it as it defines
> the SHOP_CURRENCY_LOCALE setting in its settings module.
>
> On Sat, Jul 11, 2015 at 11:49 AM, Danny  wrote:
>
>> Hi all,
>>
>> I was wondering if anyone could help me!
>>
>> I've tried the new Mezzanine 4.0 release with cartridge master (which
>> Stephen said should work) and am getting AppRegistryNotReady exception from
>> shop.models.Priced():
>>
>> BACKTRACE:
>> 
>> /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:51:
>> UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django
>> requires. Will fall back to the domains configured as sites.
>>   warn("You haven't defined the ALLOWED_HOSTS settings, which "
>> /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/generic/fields.py:6:
>> RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated
>> and will be removed in Django 1.9. Its contents have been moved to the
>> fields, forms, and admin submodules of django.contrib.contenttypes.
>>   from django.contrib.contenttypes.generic import GenericRelation
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 14, in 
>> execute_from_command_line(sys.argv)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 338, in execute_from_command_line
>> utility.execute()
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 312, in execute
>> django.setup()
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/__init__.py",
>> line 18, in setup
>> apps.populate(settings.INSTALLED_APPS)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/registry.py",
>> line 108, in populate
>> app_config.import_models(all_models)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/config.py",
>> line 198, in import_models
>> self.models_module = import_module(models_module_name)
>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
>> import_module
>> __import__(name)
>>   File
>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
>> line 35, in 
>> class Priced(models.Model):
>>   File
>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
>> line 41, in Priced
>> unit_price = fields.MoneyField(_("Unit price"))
>>   File
>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/fields.py",
>> line 46, in __init__
>> set_locale()
>>   File
>> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/utils.py", line
>> 103, in set_locale
>> currency_locale = str(settings.SHOP_CURRENCY_LOCALE)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>> line 236, in __getattr__
>> editable_cache = self._get_editable(request=self._current_request)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>> line 152, in _get_editable
>> editable_settings = self._editable_caches[request] = self._load()
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
>> line 191, in _load
>> for setting_obj in Setting.objects.all():
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/manager.py",
>> line 228, in all
>> return self.get_queryset()
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/core/managers.py",
>> line 349, in get_queryset
>> return super(DjangoCSM, self).get_queryset().filter(**lookup)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/query.py",
>> line 679, in filter
>> return self._filter_or_exclude(False, *args, **kwargs)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/query.py",
>> line 697, in _filter_or_exclude
>> clone.query.add_q(Q(*args, **kwargs))
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>> line 1309, in add_q
>> clause, require_inner = self._add_q(where_part, self.used_aliases)
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>> line 1337, in _add_q
>> allow_joins=allow_joins, split_subq=split_subq,
>>   File
>> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>> line 1149, in build_filter
>> lookups, parts, reffed_expression = self.solve_lookup_type(arg)
>>   File
>> "/home/danny/

Re: [mezzanine-users] Mezzanine 4.0 with Cartridge

2015-07-12 Thread Stephen McDonald
I can confirm this bug - the demo site doesn't hit it as it defines
the SHOP_CURRENCY_LOCALE setting in its settings module.

On Sat, Jul 11, 2015 at 11:49 AM, Danny  wrote:

> Hi all,
>
> I was wondering if anyone could help me!
>
> I've tried the new Mezzanine 4.0 release with cartridge master (which
> Stephen said should work) and am getting AppRegistryNotReady exception from
> shop.models.Priced():
>
> BACKTRACE:
> 
> /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:51:
> UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django
> requires. Will fall back to the domains configured as sites.
>   warn("You haven't defined the ALLOWED_HOSTS settings, which "
> /home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/generic/fields.py:6:
> RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated
> and will be removed in Django 1.9. Its contents have been moved to the
> fields, forms, and admin submodules of django.contrib.contenttypes.
>   from django.contrib.contenttypes.generic import GenericRelation
>
> Traceback (most recent call last):
>   File "manage.py", line 14, in 
> execute_from_command_line(sys.argv)
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 338, in execute_from_command_line
> utility.execute()
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 312, in execute
> django.setup()
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/__init__.py",
> line 18, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/registry.py",
> line 108, in populate
> app_config.import_models(all_models)
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/apps/config.py",
> line 198, in import_models
> self.models_module = import_module(models_module_name)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
> import_module
> __import__(name)
>   File
> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
> line 35, in 
> class Priced(models.Model):
>   File
> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/models.py",
> line 41, in Priced
> unit_price = fields.MoneyField(_("Unit price"))
>   File
> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/fields.py",
> line 46, in __init__
> set_locale()
>   File
> "/home/danny/.virtualenvs/mez4/src/cartridge/cartridge/shop/utils.py", line
> 103, in set_locale
> currency_locale = str(settings.SHOP_CURRENCY_LOCALE)
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
> line 236, in __getattr__
> editable_cache = self._get_editable(request=self._current_request)
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
> line 152, in _get_editable
> editable_settings = self._editable_caches[request] = self._load()
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/conf/__init__.py",
> line 191, in _load
> for setting_obj in Setting.objects.all():
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/manager.py",
> line 228, in all
> return self.get_queryset()
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/mezzanine/core/managers.py",
> line 349, in get_queryset
> return super(DjangoCSM, self).get_queryset().filter(**lookup)
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 679, in filter
> return self._filter_or_exclude(False, *args, **kwargs)
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 697, in _filter_or_exclude
> clone.query.add_q(Q(*args, **kwargs))
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
> line 1309, in add_q
> clause, require_inner = self._add_q(where_part, self.used_aliases)
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
> line 1337, in _add_q
> allow_joins=allow_joins, split_subq=split_subq,
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
> line 1149, in build_filter
> lookups, parts, reffed_expression = self.solve_lookup_type(arg)
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
> line 1035, in solve_lookup_type
> _, field, _, lookup_parts = self.names_to_path(lookup_splitted,
> self.get_meta())
>   File
> "/home/danny/.virtualenvs/mez4/local/lib/python2.7/sit

Re: [mezzanine-users] Text processing code?

2015-07-12 Thread Brandon Keith Biggs

Hello,
I found the problem! The append argument is a bool and not a tuple or 
list. The correct function should be:
register_setting(name="RICHTEXT_FILTERS", append=True, 
default=('shortcodes.shortcodes.shortcodes_main',))


I think the documentation should state that append is a boolian and that 
one needs to pass in a tuple to the default function. The text could 
read as follows:
• append: If registering an existing setting and append is set to True, 
the value given to default will be appended to the current default value.


 Then for RICHTEXT_FILTER:
RICHTEXT_FILTER
Deprecated, use RICHTEXT_FILTERS
Dotted path to the function to call on a RichTextField value before it 
is rendered to the template.

Default: None
Thanks,

Brandon Keith Biggs 
On 7/12/2015 8:53 PM, Eduardo Rivas wrote:


RICHTEXT_FILTER is deprecated and kept around only for backwards 
compatibility as far as I know. runserver shows a deprecation warning 
every time it finds it.


You are right that default setting values should be lists and not 
tuples. Could you please test it and submit a patch?


In the meantime, you can simply rewrite the setting to your liking 
directly in your settings module, no need to do it in defaults.py if 
you find it inappropriate for your purposes.


--
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] Text processing code?

2015-07-12 Thread Eduardo Rivas
RICHTEXT_FILTER is deprecated and kept around only for backwards
compatibility as far as I know. runserver shows a deprecation warning every
time it finds it.

You are right that default setting values should be lists and not tuples.
Could you please test it and submit a patch?

In the meantime, you can simply rewrite the setting to your liking directly
in your settings module, no need to do it in defaults.py if you find it
inappropriate for your purposes.

-- 
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] Text processing code?

2015-07-12 Thread Brandon Keith Biggs

Hello,
I got this to work using the loading into a template file, but I think 
it is a little too complex.

What is the
RICHTEXT_FILTERS

setting from:
http://mezzanine.jupo.org/docs/configuration.html#richtext-filters
I ran:
register_setting(name="RICHTEXT_FILTERS", 
append='shortcodes.templatetags.shortcodes.shortcodes_main')

But got the following error:

  File 
"c:\python27\lib\site-packages\mezzanine-3.1.10-py2.7.egg\mezzanine\conf\

__init__.py", line 44, in register_setting
registry[name]["default"] += default
TypeError: can only concatenate tuple (not "NoneType") to tuple

I also did:

register_setting(name="RICHTEXT_FILTERS", 
default=['mezzanine.utils.html.thumbnails', 
'shortcodes.templatetags.shortcodes.shortcodes_main'])


and that seemed to do the trick, but that is not very friendly to any 
other applications that may be installed along with mezzanine that 
filter text.
I don't know how to grab the current list of settings to resubmit the 
list of current filters.

It appears that the default for RICHTEXT_FILTERS is:
('mezzanine.utils.html.thumbnails',)
so that may be why I can't append anything to it. This seems to be a 
bug, any of these iterative settings should be lists so the user can do 
append on them.


I also see there is a setting:
RICHTEXT_FILTER
and the default is None. Why is this different than RICHTEXT_FILTERS? 
Does it automatically reset the tuple with the new filter added? If so, 
could it say so in the documentation?


From what it looks like, RICHTEXT_FILTERS and RICHTEXT_FILTER are 
redundant and RICHTEXT_FILTER should be removed.

Thanks,

Brandon Keith Biggs 
On 7/1/2015 6:07 PM, Eduardo Rivas wrote:
Mezzanine provides the RICHTEXT_FILTERS setting for you to plug in any 
function to process text. You could implement a micro template 
language and call it from there. This is done in templates like so {{ 
page.richtextpage.content|richtext_filters|safe }}. Docs: 
http://mezzanine.jupo.org/docs/configuration.html#richtext-filters.


I prefer this approach rather than enabling full support of the Django 
template language in RichText fields to keep things safe.




--
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] Mezzanine 4.0 is released

2015-07-12 Thread henri
Happy to see Mezzanine 4.0 is released.

Actually I want to start an new e-commerce project based on Mezzanine and 
Cartridge on which I would like to implement the new Mezzanine project 
structure.

Is there a chance that Cartridge will be upgraded soon or is it possible to 
adapt Cartridge by hand to the new structure? 

Thanks a lot for creating this great project.

Regards, Henri 

-- 
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] mezzanine-project mezzanine_project: error: unrecognized arguments: -a

2015-07-12 Thread Won Jin Kim
Hi,

I am new user of mezzanine and catridge.

Today, I tried to install mezzanine and install catridge app, but, failed 
as showing following:

# mezzanine-project -a cartridge catrshop
usage: mezzanine-project mezzanine_project [-h] [--version] [-v {0,1,2,3}]
   [--settings SETTINGS]
   [--pythonpath PYTHONPATH]
   [--traceback] [--no-color]
   [--template TEMPLATE]
   [--extension EXTENSIONS]
   [--name FILES]
   name [directory]
mezzanine-project mezzanine_project: error: unrecognized arguments: -a


# mezzanine-project --help
usage: mezzanine-project mezzanine_project [-h] [--version] [-v {0,1,2,3}]
   [--settings SETTINGS]
   [--pythonpath PYTHONPATH]
   [--traceback] [--no-color]
   [--template TEMPLATE]
   [--extension EXTENSIONS]
   [--name FILES]
   name [directory]

Creates a Mezzanine project directory structure for the given project name 
in
the current directory or optionally in the given directory.

positional arguments:
  name  Name of the application or project.
  directory Optional destination directory

optional arguments:
  -h, --helpshow this help message and exit
  --version show program's version number and exit
  -v {0,1,2,3}, --verbosity {0,1,2,3}
Verbosity level; 0=minimal output, 1=normal output,
2=verbose output, 3=very verbose output
  --settings SETTINGS   The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't provided, 
the
DJANGO_SETTINGS_MODULE environment variable will be
used.
  --pythonpath PYTHONPATH
A directory to add to the Python path, e.g.
"/home/djangoprojects/myproject".
  --traceback   Raise on CommandError exceptions
  --no-colorDon't colorize the command output.
  --template TEMPLATE   The path or URL to load the template from.
  --extension EXTENSIONS, -e EXTENSIONS
The file extension(s) to render (default: "py").
Separate multiple extensions with commas, or use -e
multiple times.
  --name FILES, -n FILES
The file name(s) to render. Separate multiple
extensions with commas, or use -n multiple times.


As you can see, there is no -a argument in mezzanine-project at all.

How can I install catridge shopping app with mezzanine-project command?

Thanks in advanced!!

-- 
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] Text processing code?

2015-07-12 Thread Brandon Keith Biggs

Hello,
Where exactly do I place that to substitute all text that is rendered to 
the page? I tried placing

{{ page.richtextpage.content|shortcodes_main|richtext_filters|safe }}
(where shortcodes_main is the name of the function in my app) on the top 
of base.html, but that just shows the correct text on the top of the 
document. down in the main block the wrong text is shown.

I believe the main text comes from the line that says:
{% block main %}{% endblock %}

but adding the above text does nothing:
{% block main %}{{ 
page.richtextpage.content|shortcodes_main|richtext_filters|safe }}{% 
endblock %}

I replaced the tags above so we had something like:


{{page.richtextpage.content|shortcodes_main|richtext_filters|safe }}



Is this OK, it looks perfect to my screen-reader, but I don't know if it 
looks OK to other people.

thanks,

Brandon Keith Biggs 
On 7/1/2015 6:07 PM, Eduardo Rivas wrote:
Mezzanine provides the RICHTEXT_FILTERS setting for you to plug in any 
function to process text. You could implement a micro template 
language and call it from there. This is done in templates like so {{ 
page.richtextpage.content|richtext_filters|safe }}. Docs: 
http://mezzanine.jupo.org/docs/configuration.html#richtext-filters.


I prefer this approach rather than enabling full support of the Django 
template language in RichText fields to keep things safe.




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