Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

CIRCLE / cloud

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 94
  • Merge Requests 10
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Merged
Merge request !83 opened May 29, 2014 by Bach Dániel@bachdaniel 
  • Report abuse
Report abuse

Feature New Macfield

  • Discussion 3
  • Commits 4
  • Changes
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Őry Máté
    @orymate started a discussion on the diff Jun 03, 2014
    circle/firewall/fields.py
    34 34 ipv6_template_re = re.compile(r'^(%\([abcd]\)[dxX]|[A-Za-z0-9:-])+$')
    35 35  
    36 36  
    37 class MACAddressFormField(fields.RegexField):
    37 class MACAddressFormField(forms.Field):
    38 38 default_error_messages = {
    39 'invalid': _(u'Enter a valid MAC address.'),
    39 'invalid': _(u'Enter a valid MAC address. %s'),
    40 40 }
    41 41  
    42 def __init__(self, *args, **kwargs):
    43 super(MACAddressFormField, self).__init__(mac_re, *args, **kwargs)
    • Őry Máté @orymate commented Jun 03, 2014
      Owner

      Couldn't remove firewall.fields.mac_re? fixed (4aaf5188)

      Edited Jun 05, 2014
      ~~Couldn't remove `firewall.fields.mac_re`?~~ fixed (4aaf5188)
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jun 03, 2014
    circle/firewall/fields.py
    67 return value
    68
    69 return EUI(value, dialect=MACAddressField.mac_custom)
    70
    53 71 def get_internal_type(self):
    54 72 return 'CharField'
    55 73  
    56 74 def to_python(self, value):
    57 if not mac_re.search(str(value)):
    58 raise ValidationError(
    59 MACAddressFormField.default_error_messages['invalid'])
    60 return str(value)
    75 return MACAddressField.from_str(value)
    76
    77 def get_db_prep_value(self, value, connection, prepared=False):
    78 if not value or value == "":
    • Őry Máté @orymate commented Jun 03, 2014
      Owner

      if not value:? fixed(8f38c8c5)

      Edited Jun 05, 2014
      ~~`if not value:`?~~ fixed(8f38c8c50)
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Jun 03, 2014
    circle/firewall/fields.py
    76
    77 def get_db_prep_value(self, value, connection, prepared=False):
    78 if not value or value == "":
    79 return None
    80
    81 if isinstance(value, EUI):
    82 return str(value)
    83 return value
    84
    85 def value_to_string(self, obj):
    86 value = self._get_val_from_obj(obj)
    87 return str(self.get_prep_value(value))
    88
    89 def clean(self, value, model_instance):
    90 value = super(MACAddressField, self).clean(value, model_instance)
    91 return self.get_prep_value(value)
    • Őry Máté @orymate commented Jun 03, 2014
      Owner

      Did you try this? get_prep_value isn't mentioned elsewhere at all. fixed(8f38c8c5)

      Edited Jun 05, 2014
      ~~Did you try this? `get_prep_value` isn't mentioned elsewhere at all.~~ fixed(8f38c8c50)
    Please register or sign in to reply
  • Bach Dániel
    @bachdaniel started a discussion on commit 4aaf5188 Jun 05, 2014
    • Bach Dániel @bachdaniel

      mentioned in merge request !83 (merged)

      Jun 05, 2014

      mentioned in merge request !83 (merged)

      mentioned in merge request !83
      Toggle commit list
    Please register or sign in to reply
  • Bach Dániel
    @bachdaniel started a discussion on commit 8f38c8c5 Jun 05, 2014
    Last updated by Bach Dániel Jun 05, 2014
    • Bach Dániel @bachdaniel

      mentioned in merge request !83 (merged)

      Jun 05, 2014

      mentioned in merge request !83 (merged)

      mentioned in merge request !83
      Toggle commit list
    • Bach Dániel @bachdaniel

      mentioned in merge request !83 (merged)

      Jun 05, 2014

      mentioned in merge request !83 (merged)

      mentioned in merge request !83
      Toggle commit list
    Please register or sign in to reply
  • Write
  • Preview
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
Bach Dániel
Assignee
Bach Dániel @bachdaniel
Assign to
Nice to have
Milestone
Nice to have
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
2
2 participants
Reference: circle/cloud!83