attachment list for links + bad links in red
[redakcja.git] / apps / apiclient / models.py
1 # -*- coding: utf-8 -*-
2 from django.db import models
3 from django.contrib.auth.models import User
4
5
6 class OAuthConnection(models.Model):
7     user = models.OneToOneField(User)
8     access = models.BooleanField(default=False)
9     token = models.CharField(max_length=64, null=True, blank=True)
10     token_secret = models.CharField(max_length=64, null=True, blank=True)
11
12     @classmethod
13     def get(cls, user):
14         try:
15             return cls.objects.get(user=user)
16         except cls.DoesNotExist:
17             o = cls(user=user)
18             o.save()
19             return o