6
0

event.py 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. from django.db import models
  2. from webservice_running.models import GENDERS
  3. from metaservicesynced.models import Orders, Resource
  4. class Event(models.Model):
  5. '''
  6. Дополнительные данные для сервиса.
  7. '''
  8. ### Standart fields
  9. order_synced = models.ForeignKey(Orders, on_delete=models.DO_NOTHING)
  10. resource_id = models.ForeignKey(Resource, null=True, on_delete=models.DO_NOTHING)
  11. rating_id = models.IntegerField(null=True)#Need create table with rating
  12. attempts = models.IntegerField(null=True, help_text="Попытки")
  13. order_place_type = models.CharField(null=True, max_length=150)
  14. order_place_start = models.CharField(null=True, max_length=150)
  15. order_place_start_gps = models.CharField(null=True, max_length=150)
  16. order_place_start_sector = models.IntegerField(null=True)
  17. order_place_start_real = models.CharField(null=True, max_length=150)
  18. order_place_start_real_gps = models.CharField(null=True, max_length=150)
  19. order_place_finish_predicted = models.CharField(null=True, max_length=150)
  20. order_place_finish_predicted_gps = models.CharField(null=True, max_length=150)
  21. order_place_finish_sector = models.IntegerField(null=True)
  22. order_place_finish_real = models.CharField(null=True, max_length=150)
  23. order_place_finish_real_gps = models.CharField(null=True, max_length=150)
  24. ### Application fields
  25. sport = models.ForeignKey("Sport", on_delete=models.DO_NOTHING)
  26. host = models.ForeignKey("Sportsman", on_delete=models.DO_NOTHING)
  27. required_gender = models.CharField(max_length=1, choices=GENDERS, default=None, null=True, blank=True)
  28. description = models.CharField(max_length=512, blank=True)
  29. # Event updated time
  30. time_updated = models.DateTimeField(auto_now=True, null=True, blank=True)
  31. # Time until which signing up is available
  32. time_close = models.DateTimeField(null=True, blank=True)
  33. max_participants = models.IntegerField(help_text="максимальное количесво участников")
  34. min_participants = models.IntegerField(help_text="минимальное количесво участников")
  35. max_age = models.IntegerField(help_text="максимальный возраст для участия")
  36. min_age = models.IntegerField(help_text="минимальный возраст для участия")
  37. min_level = models.IntegerField(null=True, blank=True, help_text="необходимое минимальное значение в поле level у пользователя для участия")
  38. max_level = models.IntegerField(null=True, blank=True, help_text="необходимое минимальное значение в поле level у пользователя для участия")
  39. is_public = models.BooleanField(default=True)
  40. class Meta:
  41. db_table = "event"
  42. verbose_name = "мероприятие"
  43. verbose_name_plural = "мероприятия"