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

ordered post_generation functions #240

Closed
zdelagrange opened this Issue Oct 28, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@zdelagrange

zdelagrange commented Oct 28, 2015

Order of post_generation function calls does not seem obvious. currently it seems that post_generation functions are run in a sorted order based on function name. I would like to be able to run my post_generation functions in a specific order without having to confuse the function name.

@rbarrois

This comment has been minimized.

Show comment
Hide comment
@rbarrois

rbarrois Nov 7, 2015

Member

This could be implemented; do you have an idea of the API you'd like to see?

Member

rbarrois commented Nov 7, 2015

This could be implemented; do you have an idea of the API you'd like to see?

@zdelagrange

This comment has been minimized.

Show comment
Hide comment
@zdelagrange

zdelagrange Nov 7, 2015

What about an int argument to the post_generation decorator? so I could decorate my functions like

@post_generation(1)
@post_generation(2)

This was inspired by locust.io's use of their weighted tasks. http://docs.locust.io/en/latest/api.html?highlight=task#locust.core.task

zdelagrange commented Nov 7, 2015

What about an int argument to the post_generation decorator? so I could decorate my functions like

@post_generation(1)
@post_generation(2)

This was inspired by locust.io's use of their weighted tasks. http://docs.locust.io/en/latest/api.html?highlight=task#locust.core.task

@olegpidsadnyi

This comment has been minimized.

Show comment
Hide comment
@olegpidsadnyi

olegpidsadnyi Jun 29, 2016

I'm suffering from this a lot. How about I implement it?
There's absolutely no need in passing an integer parameter. Let's do it like Django does in the forms.
All we need is to preserve the order of the declaration.
So all instantiations of the declaration can simply increment one global creation counter and store the value on the declaration instance. This way they can be sorted when needed.

olegpidsadnyi commented Jun 29, 2016

I'm suffering from this a lot. How about I implement it?
There's absolutely no need in passing an integer parameter. Let's do it like Django does in the forms.
All we need is to preserve the order of the declaration.
So all instantiations of the declaration can simply increment one global creation counter and store the value on the declaration instance. This way they can be sorted when needed.

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