Add str repr for role and register role in admin

This commit is contained in:
PCoder 2021-11-22 15:46:20 +05:30
parent 7461bea49c
commit 17131dc91c
2 changed files with 4 additions and 0 deletions

View file

@ -245,3 +245,4 @@ admin.site.register(RangesPeople, PeopleRangeAdmin)
admin.site.register(TaxonRange, TaxonRangeAdmin)
admin.site.register(PeopleResource, PeopleResourceAdmin)
admin.site.register(RangeCountry, RangeCountryAdmin)
admin.site.register(Role)

View file

@ -683,6 +683,9 @@ class Role(models.Model):
id = models.AutoField(primary_key=True)
role = models.TextField(blank=True, null=True)
def __str__(self):
return self.role if self.role else '--'
class PeopleResource(models.Model):
id = models.AutoField(primary_key=True)