Kaydet (Commit) 5124ab76 authored tarafından Andrea Crotti's avatar Andrea Crotti

add comment to explain why it's necessary to do an explicit check for

Python2 and how metaclasses are defined
üst c70ca487
......@@ -16,6 +16,8 @@ class CustomBaseModel(models.base.ModelBase):
class MyModel(six.with_metaclass(CustomBaseModel, models.Model)):
"""Model subclass with a custom base using six.with_metaclass."""
# This is done to ensure that for Python2 only, defining metaclasses
# still does not fail to create the model.
if not six.PY3:
class MyModel(models.Model):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment