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
Fixed #25068 -- Added metaclassmaker to resolve metaclass conflicts in migrations state. #5183
Conversation
@MarkusH - could you run your benchmarks on this or share how we can do it? I'll happily review the patch for style, etc. if it passes that stage of review. |
I just use https://github.com/MarkusH/django-migrations-benchmark as some kind of benchmarking tool and uncomment the code in Django I don't want to have affect on the timing. |
@MarkusH I used your benchmark, it seems my current solution doesn't slow down migrations. I have two thoughts after using your benchmark :) Please add Here are results, I ran it when working as I don't have spare computer so it's not best measurement, but I think is enough. As you can see it's almost the same, even better with fix, but difference is caused by IO.
|
pass | ||
|
||
# Create the same Model without metaclassmaker as you would normally do. | ||
class MetaclassTestModel(six.with_metaclass(ItermidiateMetaClass, models.Model, Mixin)): |
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.
Mixin
should come before models.Model
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 will change it, but you know that this doesn't really matter here? ;) It's just for you.
Can you make |
|
|
||
class DummyMetaClass(type): | ||
dummy_attr = 'dummy' | ||
pass |
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.
You don't need this pass
anymore.
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.
hehe, you are right :) You want to tire me with this topic to death ;) will fix in minutes.
@timgraham if you want to merge, patch looks good to me. |
Closed in favor of #5334 |
#4968
Now it's faster, or more like it's not slowing down ;)