I may have to radically rethink this from model up but there may be a 
solution?

I have a model called ZoneCost which contains the data
A : 0.8
B: 0.9
C: 1.0
D: 1.2
E: 1.4 

and another model Card that among other things contains a zone identifier

What I want to do is in a view 
1. Get the zone applicable 
        serial = form.cleaned_data[card_serial]
        this = Card.objects.get(card_serial=serial)
        zone = this.zone
2. Modify the choices 
    trips = forms.ChoiceField(choices=trip_choices)
    trip_choices = ( ("10", "10), etc

    so instead of outputting as 10, 20 etc in a dropdown it outputs as
    10 - value
    20 - value

    where value is choice option * the multiplier defined by the zone
    ie for Zone D
    10 - 12
    20 - 24

and pass it to the form

any ideas please?
    

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ea4d7861-4473-4183-8d15-70f8786c559e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to