Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
5049 Vistas

I need to do some checking when submitting the form. (e.g. if the name of location is used or not)

where should I put the function and how do I get data from database to check the form?

Avatar
Descartar
Mejor respuesta

Different ways to go about this. Most checks can be done on the fields themselves, in the form of on_change functions. Look up examples in the code.

If something can only be checked at the end, you might want to override the "create" method in your (inherited) object. This is called when you press the "Save" button for a record that does not yet exist. 

For records that already exist in the database, you need to override the "write" method on your object. This handles the writing the differences on the record you are working on.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
sept 19
13194
2
feb 16
6218
2
ene 22
48319
0
jun 21
3068
0
jun 19
4324