Project

General

Profile

« Previous | Next » 

Revision 8759c981

Added by Serghei Mihai over 9 years ago

api: subscriptions management endpoint (#10794)

View differences:

corbo/models.py
class Broadcast(models.Model):
announce = models.ForeignKey(Announce, verbose_name=_('announce'))
channel = models.CharField(_('channel'), max_length=32,
choices=channel_choices, blank=False)
time = models.DateTimeField(_('sent time'), auto_now_add=True)
result = models.TextField(_('result'), blank=True)
......
class Meta:
verbose_name = _('sent')
ordering = ('-time',)
unique_together = ('announce', 'channel')
class SubscriptionType(models.Model):
subscription = models.ForeignKey('Subscription')
identifier = models.CharField(_('identifier'), max_length=128, blank=True,
help_text=_('ex.: email, mobile phone number, jabber id'))
class Subscription(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'),
blank=True, null=True)
category = models.ForeignKey('Category', verbose_name=_('category'))
category = models.ForeignKey('Category', verbose_name=_('Category'))
uuid = models.CharField(_('User identifier'), max_length=128, blank=True)
identifier = models.CharField(_('identifier'), max_length=128, blank=True,
help_text=_('ex.: mailto, homepage, ...'))
class Meta:
unique_together = ('user', 'category')
unique_together = ('category', 'identifier', 'uuid')

Also available in: Unified diff