Guest User

Untitled

a guest
Dec 15th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. Error: One or more models did not validate:
  2. invweb.connection: Accessor for field 's_port' clashes with related field 'Port.connection_set'. Add a related_name argument to the definition for 's_port'.
  3. invweb.connection: Accessor for field 'd_port' clashes with related field 'Port.connection_set'. Add a related_name argument to the definition for 'd_port'.
  4.  
  5. class Port(models.Model):
  6. p_type = (
  7. ('RJ45', 'RJ45'),
  8. )
  9. device_id = models.ForeignKey(Device)
  10. port_type = models.CharField(max_length=5, choices=p_type, default='RJ45')
  11.  
  12. class Connection(models.Model):
  13. c_type = (
  14. ('Grey', 'Grey'),
  15. ('Orange', 'Orange')
  16. )
  17. s_port = models.ForeignKey(Port)
  18. d_port = models.ForeignKey(Port)
  19. color = models.CharField(max_length=10, choices=c_type, default='Grey')
Add Comment
Please, Sign In to add comment