Changes between Initial Version and Version 34 of Ticket #5929


Ignore:
Timestamp:
Dec 8, 2024, 4:15:06 AM (2 weeks ago)
Author:
Csirmaz Bendegúz
Comment:

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 CompositeFields, that's a very specific use case and we already have GenericIPAddressField.

The following could be easily achieved with minimal refactoring:

class Subscription(Model):
    fee = CompositeField("amount", "currency")
    amount = IntegerField()
    currency = CharField(max_length=3)

I don't know if this would be enough to solve the problem this ticket describes though or if you had something else in mind.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5929

    • Property Triage Stage UnreviewedAccepted
    • Property Keywords qs-rf removed
    • Property Version other branchSVN
    • Property Cc Pavel Anossov artagnon Daniel Barreto James Turk glassreistor ben.coughlan@… ognajd@… j.arnds@… carlos.palol@… cmawebsite@… Frank Sachsenheim added
    • Property Owner changed from nobody to HAMA Barhamou
    • Property Status newclosed
    • Property SeverityNormal
    • Property TypeNew feature
    • Property Easy pickings unset
    • Property UI/UX unset
    • Property Resolutionduplicate
  • Ticket #5929 – Description

    initial v34  
    1 
    21Currently it seems that it is not possible to have complex db filds. For example:
    32[https://dev.leipzig.freifunk.net/trac/browser/ffsomething/branches/generic/apps/management/models.py Implementation of a IP model] which actually should be a field type not a model. The implementation is not clean, because foreign key lookups for example do not work. The model maps for example:
Back to Top