Released:
Latest version
MAC address model and form fields for Django apps.
Project description
MAC Address model and form fields for Django
Django-users mailing list Search for information in the archives of the django-users mailing list, or post a question. #django IRC channel Ask a question in the #django IRC channel, or search the IRC logs to see if it’s been asked before. Ticket tracker Report bugs with Django or Django documentation in our ticket tracker. How to Install Django on Windows 10, 8, 7. Install Python version 3.6.2, pip version 9.0.1, and D. Check the “Add Python 3.8 to PATH” box before installing. Once Python is installed, restart Windows.
We use netaddr to parse and validate the MAC address. The tests aren’tcomplete yet.
Patches welcome: http://github.com/django-macaddress/django-macaddress
Release Notes:
For release info: https://github.com/django-macaddress/django-macaddress/releases Download photoshop with crack for mac.
Getting Startedsettings.MACADDRESS_DEFAULT_DIALECT
To specify a default dialect for presentation (and storage, see below), specify:
where the specified value is a string composed of a parent python module nameand the child dialect class name. For example:
PS: old default of macaddress.mac_linux (uppercase and divided by ‘:’ ) will be used by default.
If the custom dialect is defined in a package module, you will need to define theclass in or import into the package’s __init__.py.
default_dialect and format_mac
To get the default dialect for your project, import and call the default_dialect function:
This function may, optionally, be called with an netaddr.EUI class instance as its argument. If nodefault is defined in settings, it will return the dialect of the provided EUI object.
The format_mac function takes an EUI instance and a dialect class (netaddr.mac_eui48 or asubclass) as its arguments. The dialect class may be specified as a string in the same manner assettings.MACADDRESS_DEFAULT_DIALECT:
MACAddressField (ModelField)
This is an example model using MACAddressField:
The default behavior is to store the MAC Address in the database is a BigInteger.If you would, rather, store the value as a string (to, for instance, facilitatesub-string searches), you can specify integer=False and the value will be storedas a string:
If you want to set unique=True on a MACAddressField that is stored as a string, you will needto set null=True and create custom clean_<foo> methods on your forms.ModelForm class foreach MACAddressField that return None when the value provided is an ' (empty string):
You should avoid changing the value of integer after running managy.py syncdb,unless you are using a schema migration solution like South or Django’s built-in migrations.
To Do
Release historyRelease notifications | RSS feed
1.7.0
1.6.0
1.5.0
1.4.1
![]()
1.4.0
1.3.2
1.3.0
1.2.2
1.2.1
1.2.0
1.1.0
1.0.1
1.0.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Django Download FileCloseHashes for django_macaddress-1.7.0-py2.py3-none-any.whl
Hashes for django-macaddress-1.7.0.tar.gz
This document will get you up and running with Django.
Install Python¶
Django is a Python Web framework. See What Python version can I use with Django? fordetails.
Get the latest version of Python at https://www.python.org/downloads/ or withyour operating system’s package manager.
Python on Windows
If you are just starting with Django and using Windows, you may findHow to install Django on Windows useful.
Install Apache and
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |