From: David ‘Bombe’ Roden Date: Fri, 10 May 2013 23:31:24 +0000 (+0200) Subject: Allow an artist’s groups to be empty. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2b044e52e7c1445d245bf314afa0a655742d2471;p=demoscenemusic.git Allow an artist’s groups to be empty. --- diff --git a/data/models.py b/data/models.py index 11bdc59..482e987 100644 --- a/data/models.py +++ b/data/models.py @@ -12,10 +12,10 @@ class Group(models.Model): class Artist(models.Model): name = models.CharField(max_length = 80) realName = models.CharField(max_length = 80, blank = True) - groups = models.ManyToManyField(Group) + groups = models.ManyToManyField(Group, blank = True) def __unicode__(self): - return "%s%s" % (self.name, (" / %s" % (" ^ ".join(g.shortName if (g.shortName != '') else g.name for g in self.groups.all()), ))) + return "%s%s" % (self.name, (" / %s" % (" ^ ".join(g.shortName if (g.shortName != '') else g.name for g in self.groups.all()), )) if (self.groups.all()) else '') class Party(models.Model): name = models.CharField(max_length = 80)