Changes between Initial Version and Version 6 of Ticket #34311
- Timestamp:
- Feb 5, 2023, 1:28:23 PM (22 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #34311
- Property Triage Stage Unreviewed → Accepted
- Property Summary The documentation on serialization uses unique_together → Update serialization examples from unique_together to UniqueConstraint
- Property Owner changed from to
- Property Status new → assigned
- Property Has patch set
-
Ticket #34311 – Description
initial v6 1 Documentation on serialization uses `unique_together`, whereas it seems to be advised to use Django's constraint framework. Therefore this might introduce confusion. Perhaps we should "update" the documentation. 1 The idea is thus to transform code on the page like: 2 2 3 https://docs.djangoproject.com/en/dev/topics/serialization/ 3 {{{ 4 class Mymodel(model): 5 class Meta: 6 unique_together = [[ 'field1', 'field2' ]] 7 }}} 8 9 to: 10 11 {{{ 12 class Mymodel(model): 13 class Meta: 14 constraints = [models.UniqueConstraint(fields=('field1', 'field2'), name='field1_2_unique')] 15 }}}