<gh_stars>10-100
from django.db import models
from django.urls import reverse


class Address(models.Model):
    """An address model."""

    street = models.CharField(max_length=255)
    postal_code = models.CharField(max_length=5)
    place = models.CharField(max_length=255, )
    municipality = models.CharField(max_length=255)
    city = models.CharField(max_length=255)
    state = models.CharField(max_length=255)

    def get_absolute_url(self):
        """Return URL of the object's detail view."""
        return reverse('farms:address_detail', args=[str(self.id)])


from django.db import models
from django.urls import reverse


class Address(models.Model):
    """An address model."""

    street = models.CharField(max_length=255)
    postal_code = models.CharField(max_length=5)
    place = models.CharField(max_length=255, )
    municipality = models.CharField(max_length=255)
    city = models.CharField(max_length=255)
    state = models.CharField(max_length=255)

    def get_absolute_url(self):
        """Return URL of the object's detail view."""
        return reverse('farms:address_detail', args=[str(self.id)])
An address model. Return URL of the object's detail view.