<commit_before>from django.db import models
from devices.models import Device
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
# Create your models here.

class IpAddress(models.Model):
	address = models.IPAddressField()
	device = models.ForeignKey(Device, blank=True, null=True)

	def __unicode__(self):
		return self.address

	class Meta:
		verbose_name = _('IP-Address')
		verbose_name_plural = _('IP-Addresses')

	def get_absolute_url(self):
		return reverse('ipaddress-detail', kwargs={'pk': self.pk})<commit_msg>IP-Addresses should be unique<commit_after>from django.db import models
from devices.models import Device
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
# Create your models here.

class IpAddress(models.Model):
	address = models.IPAddressField(unique=True)
	device = models.ForeignKey(Device, blank=True, null=True)

	def __unicode__(self):
		return self.address

	class Meta:
		verbose_name = _('IP-Address')
		verbose_name_plural = _('IP-Addresses')

	def get_absolute_url(self):
		return reverse('ipaddress-detail', kwargs={'pk': self.pk})
{'fraction_non_alphanumeric': 0.10454155955441302, 'fraction_numerical': 0.0, 'mean_word_length': 5.911242603550296, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '303285', 'n_tokens_mistral': 371, 'n_tokens_neox': 358, 'n_words': 92}