dr.botzo/twitter/models.py

29 lines
843 B
Python

"""Twitter settings models."""
import logging
from django.db import models
from ircbot.models import IrcChannel
log = logging.getLogger('twitter.models')
class TwitterClient(models.Model):
"""Track twitter settings and similar."""
oauth_token = models.CharField(max_length=256, default='', blank=True)
oauth_token_secret = models.CharField(max_length=256, default='', blank=True)
mentions_output_channel = models.ForeignKey(IrcChannel, related_name='mentions_twitter_client', default=None,
null=True, blank=True)
mentions_since_id = models.PositiveIntegerField(default=1, blank=True)
class Meta:
permissions = (
('send_tweets', "Can send tweets via IRC"),
('manage_threads', "Can start/stop polling threads via IRC"),
)