Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

A simple docstring to clarify a part of the code that might be confusing to understand #1143

Merged
merged 1 commit into from

2 participants

@AndreaCrotti

Python2 and how metaclasses are defined

@mjtamlyn
Collaborator

Thanks!

@mjtamlyn mjtamlyn merged commit 726e576 into django:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 19, 2013
  1. @AndreaCrotti

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

    AndreaCrotti authored
    Python2 and how metaclasses are defined
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 tests/base/models.py
View
4 tests/base/models.py
@@ -14,8 +14,10 @@ class CustomBaseModel(models.base.ModelBase):
class MyModel(six.with_metaclass(CustomBaseModel, models.Model)):
- """Model subclass with a custom base using six.with_metaclass."""
+ """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):
Something went wrong with that request. Please try again.