Esempio n. 1
0
class ThreadPrunedEvent(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    threadID = UUIDField(default=None, null=False)

    class Meta:
        db_table = Const.Database.TableNames.Logging.THREAD_PRUNED
Esempio n. 2
0
class ModAction(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    result = models.CharField(default=None, null=False, max_length=3)
    contentID = UUIDField(default=None, null=False)
    contentType = models.CharField(
        default=None,
        null=False,
        max_length=Const.Database.MaxLengths.CONTENT_TYPE)

    class Meta:
        db_table = Const.Database.TableNames.Moderation.MOD_ACTION
Esempio n. 3
0
class OnlineContent(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    fromUser = models.ForeignKey(User,
                                 related_name='+',
                                 default=None,
                                 null=False)
    fromSession = models.ForeignKey(Session,
                                    related_name='+',
                                    default=None,
                                    null=False)
    key = models.CharField(default=None,
                           null=True,
                           max_length=Const.Database.MaxLengths.S3_KEY)
    contentType = models.CharField(
        default=None,
        null=False,
        max_length=Const.Database.MaxLengths.CONTENT_TYPE)
    fav = models.BooleanField(default=False, null=False)

    class Meta:
        db_table = Const.Database.TableNames.Content.ONLINE
Esempio n. 4
0
class Hit(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    url = models.CharField(
        default=None,
        null=False,
        max_length=Const.Database.MaxLengths.Security.ERROR_REQUESTED_URL)
    responseCode = models.SmallIntegerField(default=None, null=True)
    messageCode = models.CharField(
        default=None,
        null=True,
        max_length=Const.Database.MaxLengths.MESSAGE_CODE)
    ip = models.GenericIPAddressField(default=None, null=False)
    fromUser = models.ForeignKey(User,
                                 related_name='+',
                                 default=None,
                                 null=True)
    session = models.ForeignKey(Session,
                                related_name='+',
                                default=None,
                                null=True)

    class Meta:
        db_table = Const.Database.TableNames.Security.HIT
Esempio n. 5
0
class NotificationSentEvent(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    messageCode = models.CharField(
        default=None,
        null=False,
        max_length=Const.Database.MaxLengths.MESSAGE_CODE)

    deliveryType = models.CharField(default=None,
                                    null=False,
                                    max_length=Const.Database.MaxLengths.
                                    Logging.NOTIFICATION_DELIVERY_TYPE)
    notificationType = models.CharField(
        default=None,
        null=False,
        max_length=Const.Database.MaxLengths.Logging.NOTIFICATION_TYPE)
    numCollapsedNotifcations = models.IntegerField(
        default=None, null=False
    )  # how many 'notifications' are bundled into this one (many server errors sent in one email, for ex)

    class Meta:
        db_table = Const.Database.TableNames.Logging.NOTIFICATION_SENT
Esempio n. 6
0
class User(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)

    # denormalized field
    timeLastLogin = models.IntegerField(default=None, null=True)

    class Meta:
        db_table = Const.Database.TableNames.Security.USER
Esempio n. 7
0
class Report(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    fromUser = models.ForeignKey(User,
                                 related_name='+',
                                 default=None,
                                 null=False)
    contentID = UUIDField(default=None, null=False)
    modAction = models.ForeignKey(ModAction,
                                  related_name='+',
                                  default=None,
                                  null=True)
    contentType = models.CharField(
        default=None,
        null=False,
        max_length=Const.Database.MaxLengths.CONTENT_TYPE)

    class Meta:
        db_table = Const.Database.TableNames.Moderation.REPORT
Esempio n. 8
0
class Ban(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    timeBanExpires = models.IntegerField(default=None, null=False)
    bannedUser = models.ForeignKey(User,
                                   related_name='+',
                                   default=None,
                                   null=False)

    class Meta:
        db_table = Const.Database.TableNames.Moderation.BAN
Esempio n. 9
0
class StaticContentPrunedEvent(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    messageCode = models.CharField(
        default=None,
        null=False,
        max_length=Const.Database.MaxLengths.MESSAGE_CODE)

    numRequestedForDeleteion = models.IntegerField(default=None, null=False)
    numDeleted = models.IntegerField(default=None, null=False)

    class Meta:
        db_table = Const.Database.TableNames.Logging.STATIC_CONTENT_PRUNED
Esempio n. 10
0
class LocalPostsPrunedEvent(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    messageCode = models.CharField(
        default=None,
        null=False,
        max_length=Const.Database.MaxLengths.MESSAGE_CODE)

    numOldPosts = models.IntegerField(default=None, null=False)
    numDeletedPosts = models.IntegerField(default=None, null=False)

    class Meta:
        db_table = Const.Database.TableNames.Logging.LOCALPOSTS_PRUNED
Esempio n. 11
0
class Error(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    file = models.CharField(
        max_length=Const.Database.MaxLengths.Logging.SERVER_ERROR_FILENAME,
        default=None,
        null=False)
    lineNum = models.IntegerField(default=None, null=False)
    exeptionMessage = models.TextField(default=None, null=False)
    stackTrace = models.TextField(default=None, null=False)

    class Meta:
        db_table = Const.Database.TableNames.Logging.ERROR
Esempio n. 12
0
class Feedback(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    fromUser = models.ForeignKey(User,
                                 related_name='+',
                                 default=None,
                                 null=False)
    text = models.CharField(
        default=None,
        null=False,
        max_length=Const.Database.MaxLengths.Analytics.FEEDBACK)

    class Meta:
        db_table = Const.Database.TableNames.Analytics.FEEDBACK
Esempio n. 13
0
class Session(models.Model):
    id = UUIDField(primary_key=True,
                   default=Utils.CreateSequentialUUIDForDB,
                   null=False)
    timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB,
                                      null=False)
    timeExpires = models.IntegerField(default=None, null=False)
    token = models.CharField(
        default=None,
        null=False,
        max_length=Const.Database.MaxLengths.Security.SESSION_TOKEN)
    fromUser = models.ForeignKey(User,
                                 related_name='+',
                                 default=None,
                                 null=False)

    class Meta:
        db_table = Const.Database.TableNames.Security.SESSION