class UserOption(Model): """ User options apply only to a user, and optionally a project. Options which are specific to a plugin should namespace their key. e.g. key='myplugin:optname' """ user = models.ForeignKey(User) project = models.ForeignKey(Project, null=True) key = models.CharField(max_length=64) value = PickledObjectField() objects = UserOptionManager() class Meta: unique_together = (('user', 'project', 'key',),) __repr__ = sane_repr('user_id', 'project_id', 'key', 'value')
class UserOption(Model): """ User options apply only to a user, and optionally a project. Options which are specific to a plugin should namespace their key. e.g. key='myplugin:optname' """ user = models.ForeignKey(User) project = models.ForeignKey(Project, null=True) key = models.CharField(max_length=64) value = PickledObjectField() objects = UserOptionManager() class Meta: unique_together = (('user', 'project', 'key',),) def __unicode__(self): return u'user=%s, project=%s, key=%s, value=%s' % (self.user_id, self.project_id, self.key, self.value)
class UserOption(Model): """ User options apply only to a user, and optionally a project. Options which are specific to a plugin should namespace their key. e.g. key='myplugin:optname' """ user = models.ForeignKey(settings.AUTH_USER_MODEL) project = models.ForeignKey('sentry.Project', null=True) key = models.CharField(max_length=64) value = PickledObjectField() objects = UserOptionManager() class Meta: app_label = 'sentry' db_table = 'sentry_useroption' unique_together = (( 'user', 'project', 'key', ), ) __repr__ = sane_repr('user_id', 'project_id', 'key', 'value')