Was a "look all the fields type before asking problem" ...
I've solved with HiddenField and disabled option ...

class RuoteForm(forms.Form):
    line_name = forms.ChoiceField(choices=get_lines(), 
widget=forms.HiddenInput)
    prefix = forms.ChoiceField(choices=get_prefixes(), 
widget=forms.HiddenInput)
    shown_pre = forms.ChoiceField(choices=get_prefixes(), 
widget=forms.TextInput(attrs={'disabled': 'disabled'}))
    termination_name = forms.ChoiceField(choices=get_terminations())

This way the international prefix is shown but uneditable and the 
subsequent POST data let me choose the correct Route object to update.
(One page shows more than one RouteForm for a given line_name)

I need both prefix and shown_pre because when adding the 'disabled' attr 
POST doesn't have data for that field, I suppose that's the way html 
works ...



>> I have some models like :
>>
>> class UserOfSomeStuff(models.Model):
>>     [...]
>>
>> class AvailableStuffToUse(models.Model):
>>     [...]
>>
>> class CurrentlyUsedStuff(models.Model):
>>     user = models.ForeignKey(UserOfSomeStuff)
>>     used_stuff = models.ForeignKey(AvailableStuffToUse)
>>
>>
>> In my application I don't need to add new Users or new Stuff, I only
>> need to change what Stuff is currently Used [1]
>> So I want to create a form which when bounded to an instance of
>> CurrentlyUsedStuff renders the "user" in plain text, and when saved  
>> just
>> updates the data, without creating a new object.
>>
>> Is there a clean way to do this ?
>>
>>
>>
>> [1] : it's a GUI for routing calls with asterisk/python/mysql if  
>> you mind
>>
>>
>>
>>     
>
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to