We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Under python3 I see the following although I have set MACADDRESS_DEFAULT_DIALECT = 'netaddr.mac_eui48'
MACADDRESS_DEFAULT_DIALECT = 'netaddr.mac_eui48'
In [1]: from infrabrowser.models import Unit In [2]: Unit.objects.first().mac Out[2]: '207369326246'
Following patch (suggested by 2to3) fixes this issue
--- /usr/local/lib/python2.7/site-packages/macaddress/fields.py (original) +++ /usr/local/lib/python2.7/site-packages/macaddress/fields.py (refactored) @@ -9,10 +9,9 @@ import warnings -class MACAddressField(models.Field): +class MACAddressField(models.Field, metaclass=models.SubfieldBase): description = "A MAC address validated by netaddr.EUI" empty_strings_allowed = False - __metaclass__ = models.SubfieldBase dialect = None def __init__(self, *args, **kwargs):
The text was updated successfully, but these errors were encountered:
Hmm, this is new syntax. let me find a workaround for python 2.x series as well.
Sorry, something went wrong.
Have to use with_metaclass from six or future.utils to maintain backward compatibility.
with_metaclass
six
future.utils
Thanks @jlec for pointing out this bug.
Fix has been submitted with pull request #21. Therefor Closing. @jlec please try the latest repo checkout.
No branches or pull requests
Under python3 I see the following although I have set
MACADDRESS_DEFAULT_DIALECT = 'netaddr.mac_eui48'
Following patch (suggested by 2to3) fixes this issue
The text was updated successfully, but these errors were encountered: