dr.botzo/dr_botzo/twitter/models.py
Brian S. Stephan 772df777ba ircbot: tie bot users to django auth user, part 3
get rid of is_admin(), instead check for django permissions. a couple
things were using is_admin(), so now there's an example of the
permission adding and usage, as those were ported
2015-06-20 10:08:51 -05:00

26 lines
634 B
Python

"""Twitter settings models."""
from __future__ import unicode_literals
import logging
from django.db import models
log = logging.getLogger('twitter.models')
class TwitterClient(models.Model):
"""Track twitter settings and similar."""
since_id = models.PositiveIntegerField()
output_channel = models.CharField(max_length=200, default='', blank=True)
oauth_token = models.CharField(max_length=256, default='', blank=True)
oauth_token_secret = models.CharField(max_length=256, default='', blank=True)
class Meta:
permissions = (
('send_tweets', "Can send tweets via IRC"),
)