'Is it possible to add more than one field to Meta in Model?
I´m trying to add a unique together to my model, in which I have assigned permissions for backend roles. My model is like this:
class Detail(models.Model):
order=models.ForeignKey('Order',related_name='orders',on_delete=models.CASCADE,verbose_name='Order')
component=models.ForeignKey('Component', related_name='order_component',on_delete=models.RESTRICT,verbose_name='Component')
class Meta:
unique_together = ('order', 'component')
permissions = (("detail_list", "detail_list"),)
When I try to save, it just keep me saying this:
IndentationError: unindent does not match any outer indentation level
I guess I could add permissions in a latter Model, but just for curiosity, anybody please could tell me if that´s the best approach, or if there is somethig I am missing? Cheers
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
