Skip to content

Solves Issue #447#802

Open
cleberjsantos wants to merge 11 commits intomasterfrom
issue_447
Open

Solves Issue #447#802
cleberjsantos wants to merge 11 commits intomasterfrom
issue_447

Conversation

@cleberjsantos
Copy link
Member

@cleberjsantos cleberjsantos commented Aug 10, 2018

fixes #802

@cleberjsantos
Copy link
Member Author

This solution for the collection tile is a problem :(

@cleberjsantos
Copy link
Member Author

WIP... Resolving conflicts

@cleberjsantos
Copy link
Member Author

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():
Copy link
Member

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(
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

number_to_show = schema.List(
form.omitted('count')
form.no_omit(IDefaultConfigureForm, 'count')
count = schema.List(
Copy link
Member

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?

Copy link
Member Author

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')
Copy link
Member

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():
Copy link
Member

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

Copy link
Member

@rodfersou rodfersou left a 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?

Copy link
Member

@hvelarde hvelarde left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants