class UserLogin(models.Model): email = fields.CharPGPSymmetricKeyField(max_length=255, blank=True, null=True, default='') ip = fields.CharPGPSymmetricKeyField(max_length=255, blank=True, null=True, default='') device = fields.CharPGPSymmetricKeyField(max_length=255, blank=True, null=True, default='') try_of_login = fields.CharPGPSymmetricKeyField(max_length=255, blank=True, null=True, default='') created = fields.DateTimePGPSymmetricKeyField(default=now, blank=True, editable=False) last_status_change = fields.DateTimePGPSymmetricKeyField(default=now, blank=True, editable=True) is_active = models.BooleanField(default=True) class Meta: app_label = 'accounts'
class Session(models.Model): session_token = fields.TextDigestField(blank=True, default='') session_profile = fields.CharPGPSymmetricKeyField(max_length=50, blank=True, null=True, default='') session_ip = fields.CharPGPSymmetricKeyField(max_length=50, blank=True, null=True, default='') session_setted_at = fields.DateTimePGPSymmetricKeyField(default=now, blank=True, editable=False) session_finished_at = fields.DateTimePGPSymmetricKeyField(default='', blank=True, null=True, editable=True) user_session = models.ForeignKey(User, null=True, blank=False, related_name="user_session", on_delete=models.SET_NULL) created = fields.DateTimePGPSymmetricKeyField(default=now, blank=True, editable=False) last_status_change = fields.DateTimePGPSymmetricKeyField(default=now, blank=True, editable=True) is_active = models.BooleanField(default=True) class Meta: app_label = 'accounts'
class Details(models.Model): person = models.ForeignKey(Person, blank=True, null=True, on_delete=models.SET_NULL) name = fields.CharPGPSymmetricKeyField(max_length=150) address = fields.TextPGPSymmetricKeyField() def __str__(self): return self.name
class User(PermissionsMixin, AbstractBaseUser): digest_field = fields.TextDigestField(blank=True, default='') digest_with_original_field = fields.TextDigestField(original='', default='') hmac_field = fields.TextHMACField(blank=True, default='') hmac_with_original_field = fields.TextHMACField(original='', default='') varopago_id = fields.TextPGPSymmetricKeyField(editable=False, blank=False, default='-') username = fields.CharPGPSymmetricKeyField(max_length=255, blank=False, null=False, unique=True, default='') name = fields.CharPGPSymmetricKeyField(max_length=200, blank=False, null=False, default='') second_name = fields.CharPGPSymmetricKeyField(max_length=200, blank=False, null=False, default='') first_lastname = fields.CharPGPSymmetricKeyField(max_length=250, blank=True, null=True, default='') second_lastname = fields.CharPGPSymmetricKeyField(max_length=250, blank=True, null=True, default='') country = fields.CharPGPSymmetricKeyField(max_length=250, blank=True, null=True, default='') email = fields.EmailPGPSymmetricKeyField(unique=True) phone = fields.CharPGPSymmetricKeyField(max_length=200, blank=False, null=False, default='') rol = fields.CharPGPSymmetricKeyField(max_length=255, blank=True, null=True, default='') avatar = fields.TextPGPSymmetricKeyField(blank=True, null=True, default='') banner = fields.TextPGPSymmetricKeyField(blank=True, null=True, default='') plan = models.ForeignKey(Plan, related_name='user_plan', null=True, blank=True, on_delete=models.SET_NULL) plan_payment = fields.DateTimePGPSymmetricKeyField(default=now, blank=True, null=True, editable=True) plan_paid_lenght = fields.IntegerPGPSymmetricKeyField(blank=True, null=True, default=0) plan_expiration = fields.DatePGPSymmetricKeyField(blank=True, null=True) invitation_code = fields.CharPGPSymmetricKeyField(max_length=255, blank=True, null=True, default='') is_staff_varopago = fields.IntegerPGPSymmetricKeyField(blank=True, null=True, default=0) is_staff_dev = fields.IntegerPGPSymmetricKeyField(blank=True, null=True, default=0) is_active_user = fields.IntegerPGPSymmetricKeyField(blank=True, null=True, default=1) date_joined = fields.DateTimePGPSymmetricKeyField(default=now, blank=True, editable=False) is_active = models.BooleanField(default=True) is_staff = models.BooleanField(default=True) date_joined = models.DateTimeField(default=now, blank=False, editable=False) address = fields.TextPGPSymmetricKeyField(blank=False, default='') activation_code = fields.TextPGPSymmetricKeyField(blank=False, default='') kyc = JSONField(default=dict) previous_reference = fields.TextPGPSymmetricKeyField(blank=False, default='') reference = fields.TextPGPSymmetricKeyField(blank=False, default='') objects = UserManager() def __str__(self): return self.email def save(self, *args, **kwargs): super(User, self).save(*args, **kwargs) class Meta: app_label = 'accounts' USERNAME_FIELD = 'email'
class EncryptedDiff(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) CHOICES = ( ('a', 'a'), (1, '1'), ) sym_field = fields.CharPGPSymmetricKeyField(blank=True, null=True, choices=CHOICES, max_length=1) class Meta: """Sets up the meta for the test model.""" app_label = 'diff_keys'
class EncryptedDiff(models.Model): CHOICES = ( ('a', 'a'), (1, '1'), ) pub_field = fields.CharPGPPublicKeyField(blank=True, null=True, choices=CHOICES, max_length=1) sym_field = fields.CharPGPSymmetricKeyField(blank=True, null=True, choices=CHOICES, max_length=1) digest_field = fields.TextDigestField(blank=True, null=True) hmac_field = fields.TextHMACField(blank=True, null=True) class Meta: """Sets up the meta for the test model.""" app_label = 'diff_keys'
class ProducerSymmetric(models.Model): name = fields.CharPGPSymmetricKeyField(max_length=512) description = fields.CharPGPSymmetricKeyField(max_length=512) credentials = fields.CharPGPSymmetricKeyField(max_length=512)
class Designation(models.Model): designation = fields.CharPGPSymmetricKeyField(max_length=150) person = models.ManyToManyField(Person) def __str__(self): return self.designation