Skip to content

Commit

Permalink
string representation
Browse files Browse the repository at this point in the history
Starting from Python 3, the __str__ method was introduced as a replacement for __unicode__ to provide a string representation of an object.
  • Loading branch information
cherijs committed Jul 9, 2023
1 parent 1ad7809 commit 605a03b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions django_walletpass/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ def get_pass_builder(self):
def __unicode__(self):
return self.serial_number

def __str__(self):
return self.serial_number

class Meta:
verbose_name_plural = "passes"
unique_together = (
Expand All @@ -308,6 +311,9 @@ class Registration(models.Model):
def __unicode__(self):
return self.device_library_identifier

def __str__(self):
return self.device_library_identifier


class Log(models.Model):
"""
Expand All @@ -317,3 +323,6 @@ class Log(models.Model):

def __unicode__(self):
return self.message

def __str__(self):
return self.message

0 comments on commit 605a03b

Please sign in to comment.