mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Updates to person model. Removed comments for now in favour of a simple notes section that can be easily modified as a text field. Will look at introducing this again in the future.
This commit is contained in:
@@ -16,12 +16,6 @@ class Profile(AbstractUser):
|
||||
url = "https://www.gravatar.com/avatar/" + hashlib.md5(self.email).hexdigest() + "?d=identicon&s=500"
|
||||
return url
|
||||
|
||||
class ModelComment(models.Model):
|
||||
user = models.ForeignKey(settings.AUTH_USER_MODEL)
|
||||
postedAt = models.DateTimeField(auto_now=True)
|
||||
|
||||
message = models.TextField()
|
||||
|
||||
@reversion.register
|
||||
class Person(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
@@ -30,10 +24,10 @@ class Person(models.Model):
|
||||
|
||||
address = models.TextField(blank=True, null=True)
|
||||
|
||||
comments = models.ManyToManyField('ModelComment', blank=True)
|
||||
notes = models.TextField(blank=True, null=True)
|
||||
|
||||
def __unicode__(self):
|
||||
string = self.name
|
||||
if self.comments.count() > 0:
|
||||
if len(self.notes) > 0:
|
||||
string += "*"
|
||||
return string
|
||||
Reference in New Issue
Block a user