Skip to content

Models

hypha.apply.flags.models

Flag

Bases: Model

STAFF class-attribute instance-attribute

STAFF = 'staff'

USER class-attribute instance-attribute

USER = 'user'

FLAG_TYPES class-attribute instance-attribute

FLAG_TYPES = {STAFF: _('Staff'), USER: _('User')}

target_content_type class-attribute instance-attribute

target_content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)

target_object_id class-attribute instance-attribute

target_object_id = models.PositiveIntegerField()

target class-attribute instance-attribute

target = GenericForeignKey('target_content_type', 'target_object_id')

timestamp class-attribute instance-attribute

timestamp = models.DateTimeField(auto_now_add=True)

type class-attribute instance-attribute

type = models.CharField(choices=FLAG_TYPES.items(), default='user', max_length=15)

user class-attribute instance-attribute

user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT)

Meta

verbose_name class-attribute instance-attribute
verbose_name = pgettext_lazy('computing', 'flag')
verbose_name_plural class-attribute instance-attribute
verbose_name_plural = pgettext_lazy('computing', 'flags')