models.py 662 B

12345678910111213141516171819202122232425262728293031323334353637
  1. from django.db import models
  2. # Create your models here.
  3. class Guild(models.Model):
  4. id = models.AutoField(
  5. primary_key = True,
  6. )
  7. guild_id = models.BigIntegerField(
  8. #not_null = True,
  9. unique = True,
  10. )
  11. class Meta:
  12. managed = False
  13. db_table = "guild"
  14. verbose_name_plural = "guilds"
  15. class Channel(models.Model):
  16. id = models.AutoField(
  17. primary_key = True,
  18. )
  19. channel_id = models.BigIntegerField(
  20. #not_null = True,
  21. unique = True,
  22. )
  23. guild = models.ForeignKey(
  24. 'Guild',
  25. on_delete = models.CASCADE,
  26. to_field = "guild_id",
  27. db_column = "guild",
  28. )
  29. class Meta:
  30. managed = False
  31. db_table = "channel"
  32. verbose_name_plural = "channels"