1
0

models.py 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. from django.db import models
  2. # Create your models here.
  3. class ChannelSettings(models.Model):
  4. id = models.AutoField(
  5. primary_key = True,
  6. )
  7. channel = models.ForeignKey(
  8. "stats.Channel",
  9. on_delete = models.CASCADE,
  10. to_field = "channel_id",
  11. db_column = "channel",
  12. )
  13. interact = models.BooleanField(
  14. default = False,
  15. help_text = "Allow the robot to speak and interact with users."
  16. )
  17. class Meta:
  18. managed = False
  19. db_table = "channel_settings"
  20. #verbose_name_plural = "accounts"
  21. class GuildAccessToken(models.Model):
  22. id = models.AutoField(
  23. primary_key = True,
  24. )
  25. guild = models.ForeignKey(
  26. "stats.Guild",
  27. on_delete = models.CASCADE,
  28. to_field = "guild_id",
  29. db_column = "guild",
  30. )
  31. user = models.ForeignKey(
  32. "stats.User",
  33. on_delete = models.CASCADE,
  34. to_field = "user_id",
  35. db_column = "user",
  36. )
  37. token = models.CharField(
  38. max_length = 40,
  39. unique = True,
  40. )
  41. created = models.DateTimeField(
  42. auto_now_add = True,
  43. )