Skip to content

Commit

Permalink
Adds description field to IPRange model.
Browse files Browse the repository at this point in the history
Fixes #51.
  • Loading branch information
Tamas Szabo committed Oct 5, 2018
1 parent 618d533 commit 228a964
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion iprestrict/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class IPRangeInline(admin.TabularInline):
model = models.IPRange
form = IPRangeForm

fields = ['first_ip', 'cidr_prefix_length', 'last_ip', 'ip_type']
fields = ['first_ip', 'cidr_prefix_length', 'last_ip', 'ip_type', 'description']
readonly_fields = ['ip_type']
extra = 2

Expand Down
20 changes: 20 additions & 0 deletions iprestrict/migrations/0007_iprange_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-05 13:00
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('iprestrict', '0006_auto_20161013_1327'),
]

operations = [
migrations.AddField(
model_name='iprange',
name='description',
field=models.CharField(blank=True, max_length=500),
),
]
1 change: 1 addition & 0 deletions iprestrict/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class Meta:
first_ip = models.GenericIPAddressField()
cidr_prefix_length = models.PositiveSmallIntegerField(null=True, blank=True)
last_ip = models.GenericIPAddressField(null=True, blank=True)
description = models.CharField(max_length=500, blank=True)

@property
def start(self):
Expand Down

0 comments on commit 228a964

Please sign in to comment.