Re: [mezzanine-users] cartridge - multiple select for product category

2014-02-14 Thread Andrey M
Hi Josh,

The idea is the following.
I'd like to create two main categories with sub categories like
 Category1
   C1.1
   C1.2
 Category2
   C2.1
   C2.2
   C2.3

So, an user can select at the same time, for example (C1.1 and C2.2) or 
(Category1 and C2.3) and etc. However the user should not have an ailbity 
to select C2.1 and C2.2.

If two categories are selected (they should be highlighted in menu) all 
products with both categories selected should be displayed

Regards

понедельник, 10 февраля 2014 г., 21:49:09 UTC+4 пользователь Josh Cartmell 
написал:

 Hey Andrey, I don't think I understand what you are trying to do.  Could 
 you go into some more details about what you want to accomplish?


 On Sat, Feb 8, 2014 at 2:38 AM, Andrey M andrey@gmail.comjavascript:
  wrote:

 Hi All,

 I'd like to make some of my product categories be selectable at the same 
 time.
 I did not find this in cartridge by default.

 Does anyone know available forks including this functionality or a way to 
 implement it with minimum effort?

 Regards

 -- 
 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 javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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/groups/opt_out.


[mezzanine-users] How to split menu for categories (first level in top, second and other levels in left menu)

2014-02-14 Thread Andrey M
Hi All,

Could you please advise if it is possible to 'split' menu for Product 
categories?
I'd like to show first level categories in top menu but second (and all 
other) levels are only in left menu.
So when an user selects category in top level menu, only subcategories 
related to this category should be displayed in left menu.
Currenly it doesn't work.

I realize that it is possible to override page_menu tag, views/tempalates 
and do everything needed, however, I do not want to change core mezzanine 
functionality to avoid issues with upgrades later.

Regards

-- 
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/groups/opt_out.


[mezzanine-users] add group item (without dedicated page) to page manu

2014-02-14 Thread Andrey M
Hi All,

Could you please advise if it is possible to add some 'grouping' elements 
(configurable in admin) to categories menu which doesn't have a page inself.
So only grouping menu element if required like the following and without 
overriding core functionality.

 Cat1
   Group1 (no page, no link)
 Cat1.1
 Cat1.2
   Group2 (no page, no link)
 Cat2.1

Regards

-- 
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/groups/opt_out.


[mezzanine-users] Re: Add main menu items for blog categories

2014-02-01 Thread Andrey M
Hi Alex

You can create 'Link' page, put it to any menu and set up the link in the 
page properties to the blog category manually like
/blog/category/YOUR_CATEGORY_NAME



суббота, 1 февраля 2014 г., 11:55:31 UTC+4 пользователь Alex Warren написал:

 Hello :)

 I am new to django/mezzanine and I noticed that the default blog page is 
 special and that it appends blogs entries to whatever you have as the main 
 content. I wanted to be able to make it so that it only contained blog 
 entries of a certain category and also would it be possible to have 
 multiple such pages in the main menu?


-- 
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/groups/opt_out.


Re: [mezzanine-users] Re: to add blog category and month as filters to keywords_for tag

2014-02-01 Thread Andrey M
I made it working in this way

 (my copy of kewords_tags.py):
..
if len(args)  1:
   filters = {args[1]: args[2]}
else:
   filters = {}

content_type = ContentType.objects.get(app_label=app_label, model=model)
contents = ContentType.get_all_objects_for_this_type(content_type, 
**filters)
assigned = AssignedKeyword.objects.filter(object_pk__in=contents)
keywords = Keyword.objects.filter(assignments__in=assigned)
keywords = keywords.annotate(item_count=Count(assignments))
..

and the following usage is applied in this case:
{% keywords_for blog.blogpost categories category as tags %}

It is working now but I have the following questions:

1) from performance perspective it seems for me to be not optimal because 
it cases execution of sub-query which selects all blog posts
2) this code with len(args)1 check and get_all_objects_for_this_type is 
not perfect

Can any improvements be done for this code?

суббота, 1 февраля 2014 г., 2:33:01 UTC+4 пользователь Josh Cartmell 
написал:

 I think you would need to write your own keywords_for template tag that 
 takes the current category into account and only finds keywords in blog 
 posts in the current category.

 Here is the current keywords_for:

 https://bitbucket.org/stephenmcd/mezzanine/src/f1ec23fedac2eaeae18a963c2fea382e23f7ccea/mezzanine/generic/templatetags/keyword_tags.py?at=default


 On Fri, Jan 31, 2014 at 2:22 PM, Andrey M andrey@gmail.comjavascript:
  wrote:

 Any ideas?

 среда, 29 января 2014 г., 0:33:35 UTC+4 пользователь Andrey M написал:

 Hi All

 I develop the blog where blog categories are shown on different pages.
 So I'd like to  show Tags and Archive (months) items only for current 
 category.

 As I can see, currently, it is not supported.  keywords_for doesn't 
 have category/archive filters.
 Could you please advise what the best way to implement it?

 May it be added to the next Mezzanine release? 

 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-use...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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/groups/opt_out.


[mezzanine-users] Use smth like block.super.super for block overriding in mezzanine/django pages

2014-01-28 Thread Andrey M
Hi All,

I have created my own version of block_post_list.html (it uses overextends 
to extend original page) and I would like to override {% block 
breadcrumb_menu %}
However, I would like to execute super block in base.html and do not copy 
past it.

So, it seems I would like something like block.super.super which is not 
supported.

I understand it is common django noob question and I did not found direct 
answer but asking if any work around exists like 'overextends' feature to 
do it?
I have a lot of places which I need to replace/override but I'd like to 
keep original 'super.super' code working if possible and do not copy-paste 
it

Any ideas?

-- 
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/groups/opt_out.


[mezzanine-users] to add blog category and month as filters to keywords_for tag

2014-01-28 Thread Andrey M
Hi All

I develop the blog where blog categories are shown on different pages.
So I'd like to  show Tags and Archive (months) items only for current 
category.

As I can see, currently, it is not supported.  keywords_for doesn't have 
category/archive filters.
Could you please advise what the best way to implement it?

May it be added to the next Mezzanine release? 

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/groups/opt_out.


Re: [mezzanine-users] Buy Product fails if Product contains non ASCII chars

2014-01-13 Thread Andrey M
Stephen,

Thanks, now it works fine!

понедельник, 13 января 2014 г., 13:07:25 UTC+4 пользователь Stephen 
McDonald написал:

 I can't reproduce the error, but may have resolved it with this change:


 https://github.com/stephenmcd/cartridge/commit/d57997947549ef4116565a161c4fd6dc5251b8a1

 Can you try that out and report back, thanks.


 On Mon, Jan 13, 2014 at 8:28 AM, Andrey M andrey@gmail.comjavascript:
  wrote:

 Hi All,

 I've started working with Mezzanine/Cartridge few weeks ago and they are 
 very interesting projects for me.
 My testing app is deployed on Openshift  (character_set_database  in 
 MySQL is utf8 )

 And I faced with the following issue. 
 When a product contains non ascii symbols (but URL is translitirated) I 
 can open the Product in the shop but I can not Buy it because of an 
 exception

 Traceback:
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/core/handlers/base.py
  
 in get_response
   107. response = middleware_method(request, 
 callback, callback_args, callback_kwargs)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Mezzanine-3.0.4-py2.7.egg/mezzanine/pages/middleware.py
  
 in process_view
   78. response = view_func(request, *view_args, **view_kwargs)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/views.py
  
 in product
   61. request.cart.add_item(add_product_form.variation, 
 quantity)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/utils.py
  
 in add_item
   52. cart.add_item(*args, **kwargs)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/models.py
  
 in add_item
   567. item.save()
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/models.py
  
 in save
   650. super(SelectedProduct, self).save(*args, **kwargs)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
  
 in save
   545.force_update=force_update, 
 update_fields=update_fields)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
  
 in save_base
   573. updated = self._save_table(raw, cls, force_insert, 
 force_update, using, update_fields)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
  
 in _save_table
   635.   forced_update)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
  
 in _do_update
   679. return filtered._update(values)  0
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/query.py
  
 in _update
   507. return query.get_compiler(self.db).execute_sql(None)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/sql/compiler.py
  
 in execute_sql
   975. cursor = super(SQLUpdateCompiler, 
 self).execute_sql(result_type)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/sql/compiler.py
  
 in execute_sql
   781. cursor.execute(sql, params)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py
  
 in execute
   69. return super(CursorDebugWrapper, self).execute(sql, 
 params)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py
  
 in execute
   53. return self.cursor.execute(sql, params)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/mysql/base.py
  
 in execute
   124. return self.cursor.execute(query, args)
 File 
 /opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py 
 in execute
   159. query = query % db.literal(args)
 File 
 /opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/connections.py
  
 in literal
   264. return self.escape(o, self.encoders)
 File 
 /opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/connections.py
  
 in string_literal
   197

[mezzanine-users] Buy Product fails if Product contains non ASCII chars

2014-01-12 Thread Andrey M
Hi All,

I've started working with Mezzanine/Cartridge few weeks ago and they are 
very interesting projects for me.
My testing app is deployed on Openshift  (character_set_database  in MySQL 
is utf8 )

And I faced with the following issue. 
When a product contains non ascii symbols (but URL is translitirated) I can 
open the Product in the shop but I can not Buy it because of an exception

Traceback:
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/core/handlers/base.py
 
in get_response
  107. response = middleware_method(request, callback, 
callback_args, callback_kwargs)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Mezzanine-3.0.4-py2.7.egg/mezzanine/pages/middleware.py
 
in process_view
  78. response = view_func(request, *view_args, **view_kwargs)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/views.py
 
in product
  61. request.cart.add_item(add_product_form.variation, 
quantity)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/utils.py
 
in add_item
  52. cart.add_item(*args, **kwargs)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/models.py
 
in add_item
  567. item.save()
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/models.py
 
in save
  650. super(SelectedProduct, self).save(*args, **kwargs)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
 
in save
  545.force_update=force_update, 
update_fields=update_fields)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
 
in save_base
  573. updated = self._save_table(raw, cls, force_insert, 
force_update, using, update_fields)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
 
in _save_table
  635.   forced_update)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
 
in _do_update
  679. return filtered._update(values)  0
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/query.py
 
in _update
  507. return query.get_compiler(self.db).execute_sql(None)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/sql/compiler.py
 
in execute_sql
  975. cursor = super(SQLUpdateCompiler, 
self).execute_sql(result_type)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/sql/compiler.py
 
in execute_sql
  781. cursor.execute(sql, params)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py
 
in execute
  69. return super(CursorDebugWrapper, self).execute(sql, 
params)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py
 
in execute
  53. return self.cursor.execute(sql, params)
File 
/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/mysql/base.py
 
in execute
  124. return self.cursor.execute(query, args)
File 
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py 
in execute
  159. query = query % db.literal(args)
File 
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/connections.py
 
in literal
  264. return self.escape(o, self.encoders)
File 
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/connections.py
 
in string_literal
  197. return db.string_literal(obj)

Exception Type: UnicodeEncodeError at /shop/product/noski-multik/
Exception Value: 'ascii' codec can't encode characters in position 0-4: 
ordinal not in range(128)

Is it known issue?



-- 
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/groups/opt_out.