Re: calculate default values for fields based on the content of other fields

2012-04-06 Thread Python_Junkie
Capture the value from the form submitted into a variable. Use straight sql to query the table and the field that you are interested in and translate the field based on sql. It is not necessary to only use the ORM. This is an abstraction layer, and sometimes the restrictions based upon using

Re: calculate default values for fields based on the content of other fields

2012-04-06 Thread Ejah
I think there are two sensible approaches to this: 1. Write some customer javaScript and set the values of your form fields based on the first field 2. Use a form wizard, form 1 contains the base word, form 2 contains all the various variants. As you generate form 2 after 1, you are able to use

Re: calculate default values for fields based on the content of other fields

2012-04-05 Thread Jaroslav Dobrek
On 5 Apr., 10:40, Xavier Ordoquy wrote: > Hi, > > I'm not sure I clearly understood your issue. > Do you want some choice fields to limit their choices according to another > choice field value ? No. I want to use prepopulated editable char fields. The content of those fields should be calcula

Re: calculate default values for fields based on the content of other fields

2012-04-05 Thread Xavier Ordoquy
Hi, I'm not sure I clearly understood your issue. Do you want some choice fields to limit their choices according to another choice field value ? Regards, Xavier. Le 4 avr. 2012 à 15:09, Jaroslav Dobrek a écrit : > Hello, > > is there a way to calculate default values for certain fields based

Re: calculate default values for fields based on the content of other fields

2012-04-05 Thread Jaroslav Dobrek
> However, I don't think you need to do this at all. I would say you > would only populate the other fields if they are all empty, and the > base is not empty. If the other fields are not empty, either it has > already been pre-populated, or it has been filled in manually, and you > should not chan

Re: calculate default values for fields based on the content of other fields

2012-04-04 Thread Tom Evans
On Wed, Apr 4, 2012 at 4:51 PM, Jaroslav Dobrek wrote: >> You could override Model.save() on the model you wish to calculate >> fields for. This could populate the fields if they are not already >> populated and the instance has a base adjective. >> > > I had thought of this possibilty, too. I wou

Re: calculate default values for fields based on the content of other fields

2012-04-04 Thread Jaroslav Dobrek
> You could override Model.save() on the model you wish to calculate > fields for. This could populate the fields if they are not already > populated and the instance has a base adjective. > I had thought of this possibilty, too. I would prefer it, because it is the simplest one. But I don't under

Re: calculate default values for fields based on the content of other fields

2012-04-04 Thread Tom Evans
On Wed, Apr 4, 2012 at 2:09 PM, Jaroslav Dobrek wrote: > Hello, > > is there a way to calculate default values for certain fields based > on the content of other fields? > > […] > > Any ideas how to realize this? > > Jaroslav Three ways immediately spring to mind. You could override Model.save()

calculate default values for fields based on the content of other fields

2012-04-04 Thread Jaroslav Dobrek
Hello, is there a way to calculate default values for certain fields based on the content of other fields? I am implementing a dictionary. Admins are supposed to add words of certain languages and parts-of-speech. Some words of some part-of-speech and language are, on one hand, morphologically ve