models.py 527 B

123456789101112131415161718192021222324
  1. from django.db import models
  2. class MovedId(models.Model):
  3. model = models.CharField(max_length=255)
  4. old_id = models.CharField(max_length=255)
  5. new_id = models.CharField(max_length=255)
  6. class OldIdRedirect(models.Model):
  7. ATTACHMENT = 0
  8. CATEGORY = 1
  9. POST = 2
  10. THREAD = 3
  11. USER = 4
  12. model = models.PositiveIntegerField()
  13. old_id = models.PositiveIntegerField()
  14. new_id = models.PositiveIntegerField()
  15. class Meta:
  16. index_together = [
  17. ['model', 'old_id'],
  18. ]