Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Line(PartBaseModel):
- line_id = models.IntegerField()
- radio_towers_number = models.IntegerField(blank=True)
- control_station_numbers = models.IntegerField(blank=True)
- railway_department = models.CharField(max_length=100)
- railway_carto_geo_center = models.CharField(max_length=100)
- status_type = models.SmallIntegerField(choices=[(i.value, i.name) for i in EngineerStatusChoice])
- radio_object_connection_length = models.FloatField()
- control_station_connection_length = models.FloatField()
- project = models.ForeignKey(Project, related_name='lines', on_delete=models.CASCADE)
- workers = models.ManyToManyField(User, through='Role')
- class Role(models.Model):
- line = models.ForeignKey(Line, on_delete=models.CASCADE)
- user = models.ForeignKey(User, on_delete=models.CASCADE)
- role = models.SmallIntegerField(choices=[(i.value, i.name) for i in UserRoleChoice])
- class Meta:
- unique_together = ('line', 'user', 'role')
Advertisement
Add Comment
Please, Sign In to add comment