X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/blobdiff_plain/cc61c5969227c2d49544997ebbf074541029400b..a5c7eb28dded9330101e16c9bcdd720b17bf83e9:/cas_provider/models.py?ds=sidebyside diff --git a/cas_provider/models.py b/cas_provider/models.py index 94023b7..6eecc3e 100644 --- a/cas_provider/models.py +++ b/cas_provider/models.py @@ -1,18 +1,29 @@ from django.db import models from django.contrib.auth.models import User +from django.utils.translation import ugettext_lazy as _ + +__all__ = ['ServiceTicket', 'LoginTicket'] class ServiceTicket(models.Model): - user = models.ForeignKey(User) - service = models.URLField(verify_exists=False) - ticket = models.CharField(max_length=256) - created = models.DateTimeField(auto_now=True) - + user = models.ForeignKey(User, verbose_name=_('user')) + service = models.URLField(_('service'), verify_exists=False) + ticket = models.CharField(_('ticket'), max_length=256) + created = models.DateTimeField(_('created'), auto_now=True) + + class Meta: + verbose_name = _('Service Ticket') + verbose_name_plural = _('Service Tickets') + def __unicode__(self): return "%s (%s) - %s" % (self.user.username, self.service, self.created) - + class LoginTicket(models.Model): - ticket = models.CharField(max_length=32) - created = models.DateTimeField(auto_now=True) - + ticket = models.CharField(_('ticket'), max_length=32) + created = models.DateTimeField(_('created'), auto_now=True) + + class Meta: + verbose_name = _('Login Ticket') + verbose_name_plural = _('Login Tickets') + def __unicode__(self): - return "%s - %s" % (self.ticket, self.created) \ No newline at end of file + return "%s - %s" % (self.ticket, self.created)