2015-06-16 20:27:44 -05:00
|
|
|
"""Twitter settings models."""
|
|
|
|
|
|
|
|
import logging
|
|
|
|
|
|
|
|
from django.db import models
|
|
|
|
|
2016-01-24 17:50:46 -06:00
|
|
|
from ircbot.models import IrcChannel
|
|
|
|
|
2015-06-16 20:27:44 -05:00
|
|
|
|
|
|
|
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)
|
2015-06-20 10:08:51 -05:00
|
|
|
|
2016-01-24 17:50:46 -06:00
|
|
|
mentions_output_channel = models.ForeignKey(IrcChannel, related_name='mentions_twitter_client', default=None,
|
2019-06-21 10:05:40 -05:00
|
|
|
null=True, blank=True, on_delete=models.CASCADE)
|
2016-01-24 18:46:06 -06:00
|
|
|
mentions_since_id = models.PositiveIntegerField(default=1, blank=True)
|
2016-01-24 17:50:46 -06:00
|
|
|
|
2015-06-20 10:08:51 -05:00
|
|
|
class Meta:
|
|
|
|
permissions = (
|
|
|
|
('send_tweets', "Can send tweets via IRC"),
|
2016-01-26 23:14:42 -06:00
|
|
|
('manage_threads', "Can start/stop polling threads via IRC"),
|
2015-06-20 10:08:51 -05:00
|
|
|
)
|