-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solves Issue #447 #802
base: master
Are you sure you want to change the base?
Solves Issue #447 #802
Conversation
This solution for the collection tile is a problem :( |
WIP... Resolving conflicts |
YESSSS GREEN! Done! |
self.config_fields = self.get_tile_configuration() | ||
limit_conf = self.config_fields.get('count', None) | ||
|
||
if limit_conf and 'size' in limit_conf.keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
limit_conf = self.config_fields.get('count', [])
if 'size' in limit_conf:
...
form.omitted('count') | ||
form.no_omit(IDefaultConfigureForm, 'count') | ||
count = schema.Int( | ||
count = schema.List( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change the schema here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as in collection https://github.com/collective/collective.cover/pull/802/files/39181f51604a56eae22ccf300c386012ad810081#r210260938
number_to_show = schema.List( | ||
form.omitted('count') | ||
form.no_omit(IDefaultConfigureForm, 'count') | ||
count = schema.List( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The schema says List, but you are working like if it was a dictionary.. could you please explain the idea behind this schema change? Why a simple Int don't resolve this problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only just kept the model already existing schema in the collection tile, but yes, a simple Int resolve this problem.
|
||
if 'number_to_show' in tile_conf.keys(): | ||
tile_conf['count'] = tile_conf['number_to_show'] | ||
tile_conf.pop('number_to_show') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tile_conf['count'] = tile_conf.pop('number_to_show')
tile = obj.get_tile(tile_id) | ||
tile_conf = tile.get_tile_configuration() | ||
|
||
if 'number_to_show' in tile_conf.keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to keep short indentation
if 'number_to_show' not in tile_conf:
continue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to give some background about the issue and why we are solving it this way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cleberjsantos I appreciate your interest on fixing this; I think we need to be be very careful and give a simpler and cleaner solution, even if it takes more time: having a schema field named count
and making it inherit from List
makes no sense to me neither.
also, we will need a test for the upgrade step.
fixes #802