Saving the service protectively. Also using user from the request for socialauth...
[django-cas-provider.git] / cas_provider / models.py
1 from django.db import models
2 from django.contrib.auth.models import User
3
4 class ServiceTicket(models.Model):
5     user = models.ForeignKey(User)
6     service = models.URLField(verify_exists=False)
7     ticket = models.CharField(max_length=256)
8     created = models.DateTimeField(auto_now=True)
9     
10     def __unicode__(self):
11         return "%s (%s) - %s" % (self.user.username, self.service, self.created)
12         
13 class LoginTicket(models.Model):
14     ticket = models.CharField(max_length=32)
15     created = models.DateTimeField(auto_now=True)
16     
17     def __unicode__(self):
18         return "%s - %s" % (self.ticket, self.created)