2 from django.conf import settings
3 from django.db import models
6 class Favorite(models.Model):
7 owner = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=u"Właściciel", related_name='favorites')
8 host = models.CharField(u"Host", max_length=256)
9 path = models.CharField(u"Ścieżka", max_length=1024, default='~')
11 created = models.DateTimeField(u"Utworzono", auto_now_add=True)
12 updated = models.DateTimeField(u"Uaktualniono", auto_now=True)
15 verbose_name = u"Ulubiona lokalizacja"
16 verbose_name_plural = u"Ulubione lokalizacje"
17 unique_together = ('owner', 'host', 'path')
19 def __unicode__(self):
20 return u'{}{} ({})'.format(self.host, self.path, self.owner)