Skip to content

Commit

Permalink
Add the office name to the Django admin.
Browse files Browse the repository at this point in the history
Django models should always have a __str__; otherwise, when the model is in a
select field, it'll just say, e.g. "Agency Object".
  • Loading branch information
CM Lubinski committed Jun 9, 2017
1 parent 3417783 commit c0ed15f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions reqs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class PolicyTypes(Enum):
class Office(models.Model):
name = models.CharField(max_length=256)

def __str__(self):
return self.name


class Policy(models.Model):
class Meta:
Expand Down

0 comments on commit c0ed15f

Please sign in to comment.