1 from django.db import models
2 from django.contrib.auth.models import User
3 from django.utils.translation import ugettext_lazy as _
5 class ServiceTicket(models.Model):
6 user = models.ForeignKey(User, verbose_name=_('user'))
7 service = models.URLField(_('service'), verify_exists=False)
8 ticket = models.CharField(_('ticket'), max_length=256)
9 created = models.DateTimeField(_('created'), auto_now=True)
12 verbose_name = _('Service Ticket')
13 verbose_name_plural = _('Service Tickets')
15 def __unicode__(self):
16 return "%s (%s) - %s" % (self.user.username, self.service, self.created)
18 class LoginTicket(models.Model):
19 ticket = models.CharField(_('ticket'), max_length=32)
20 created = models.DateTimeField(_('created'), auto_now=True)
23 verbose_name = _('Login Ticket')
24 verbose_name_plural = _('Login Tickets')
26 def __unicode__(self):
27 return "%s - %s" % (self.ticket, self.created)