Commit d655afda by Őry Máté

convert firewall app to south

parent 39ac72bc
...@@ -3,11 +3,9 @@ from django.db import models ...@@ -3,11 +3,9 @@ from django.db import models
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from south.modelsinspector import add_introspection_rules
import re import re
#from south.modelsinspector import add_introspection_rules
#add_introspection_rules([], ["^teszt.firewall.models.MACAddressField"])
mac_re = re.compile(r'^([0-9a-fA-F]{2}([:-]?|$)){6}$') mac_re = re.compile(r'^([0-9a-fA-F]{2}([:-]?|$)){6}$')
alfanum_re = re.compile(r'^[A-Za-z0-9_-]+$') alfanum_re = re.compile(r'^[A-Za-z0-9_-]+$')
domain_re = re.compile(r'^([A-Za-z0-9_-]\.?)+$') domain_re = re.compile(r'^([A-Za-z0-9_-]\.?)+$')
...@@ -33,6 +31,7 @@ class MACAddressField(models.Field): ...@@ -33,6 +31,7 @@ class MACAddressField(models.Field):
defaults = {'form_class': MACAddressFormField} defaults = {'form_class': MACAddressFormField}
defaults.update(kwargs) defaults.update(kwargs)
return super(MACAddressField, self).formfield(**defaults) return super(MACAddressField, self).formfield(**defaults)
add_introspection_rules([], ["^firewall\.models\.MACAddressField"])
def val_alfanum(value): def val_alfanum(value):
if not alfanum_re.search(value): if not alfanum_re.search(value):
......
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 sign in to comment