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 this abstraction can block what you want to accomplish. On Wednesday, April 4, 2012 9:09:40 AM UTC-4, Jaroslav Dobrek wrote: > > 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 very > regular, but, one the other hand, come with a huge number of > morphological > forms. This is true for German adjectives: They usually have 183 > morphological forms (if form-meaning pairs are counted). On the other > hand, there are very few irregular adjectives. The most user-friendly > way for admins to code German adjectives would be this: The admin adds > a new adjective and types in the adjective's base form: > > base form: |gut| > > Then he clicks some button or saves the adjective or, ideally, does > nothing, and the program fills in the 183 fields below, using the base > form and > assuming that the adjective is regular: > > attributive positive strong masculine nominative singular: |guter| > attributive positive strong masculine genitive singular: |guten| > attributive positive strong masculine dative singular: |gutem| > attributive positive strong masculine accusative singular: |guten| > ... > attributive comparative strong masculine nominative singular: | > guterer| > ... > > The admin now has the possibility to correct the wrong forms before > saving the adjective. This way, in the vast majority of cases all the > coding is done completely > automatically. And for the very few irregular adjectives, the admin > only has to modify those > forms that have been guessed wrongly. > > Any ideas how to realize this? > > Jaroslav > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/CeiB24voGMsJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.