Editor update - improving selection restore after operations
[redakcja.git] / apps / apiclient / models.py
1 from django.db import models
2 from django.contrib.auth.models import User
3
4
5 class OAuthConnection(models.Model):
6     user = models.OneToOneField(User)
7     access = models.BooleanField(default=False)
8     token = models.CharField(max_length=64, null=True, blank=True)
9     token_secret = models.CharField(max_length=64, null=True, blank=True)
10
11     @classmethod
12     def get(cls, user):
13         try:
14             return cls.objects.get(user=user)
15         except cls.DoesNotExist:
16             o = cls(user=user)
17             o.save()
18             return o
19
20