Changes between Version 2 and Version 3 of Ticket #5929, comment 34


Ignore:
Timestamp:
Dec 8, 2024, 4:50:20 AM (2 weeks ago)
Author:
Csirmaz Bendegúz

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5929, comment 34

    v2 v3  
    1 I believe this can be re-opened since #373 didn't address this problem. Perhaps a generic `CompositeField` field could replace the `CompositePrimaryKey` field one day. The code written for #373 could be refactored and re-used here. Or maybe not? My problem with this ticket is it doesn't really describe what it wants to achieve exactly. If this is re-opened I suggest we define a clear interface and set of behaviours that `CompositeField` needs to support first. If someone could provide a strong use case for this please? I don't understand how the IP address problem is related to generic `CompositeField`s, that's a very specific use case and we already have `GenericIPAddressField`.
     1I believe this can be re-opened since #373 didn't address this problem. Perhaps a generic `CompositeField` field could replace the `CompositePrimaryKey` field one day. The code written for #373 could be refactored and re-used here. Or maybe not? My problem with this ticket is it doesn't really describe what it wants to achieve exactly. If this is re-opened I suggest we define a clear interface and set of behaviours that `CompositeField` needs to support first.
     2
     3If someone could provide a strong use case for this please? I don't understand how the IP address problem is related to generic `CompositeField`s, that's a very specific use case and we already have `GenericIPAddressField`.
     4
     5The following could be easily achieved with minimal refactoring:
     6
     7{{{
     8class Subscription(Model):
     9    fee = CompositeField("amount", "currency")
     10    amount = IntegerField()
     11    currency = CharField(max_length=3)
     12}}}
     13
     14I don't know if this would be enough to solve the problem this ticket describes though.
Back to Top