Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

45 lignes
1.5 KiB

  1. Accessing Local Data
  2. ====================
  3. Local records are maintained in the :term:`locals` dictionary. Some useful functions to access local data:
  4. .. function:: LocalDB.add(dt, dn)
  5. Add a new record to `locals`
  6. .. function:: LocalDB.delete_doc(dt, dn)
  7. Delete a record and all child records from `locals`
  8. .. function:: LocalDB.set_default_values(doc)
  9. Set default values for the given `doc`. Will only work if the metadata (`DocType`) is also loaded
  10. .. function:: LocalDB.create(dt, n)
  11. Create a new record and set default values. If n is null, n is set as "Unsaved .."
  12. .. function:: LocalDB.delete_record(dt, dn)
  13. Mark for deletion (called when a row is deleted from the table)
  14. .. function:: LocalDB.get_default_value(fieldname, fieldtype, default)
  15. Get default value for the given field details for `default` keyword
  16. * If `default` is '__user' or '_Login' - return username
  17. * If `default` is 'Today' or '__today' - return today's date
  18. * Return `default` if `default` is not null.
  19. * If field name matches user or system default, then return the default
  20. .. function:: LocalDB.add_child(doc, childtype, parentfield)
  21. Return a child record, with parentfield set (optionally). Called when a row is added to the table
  22. .. function:: LocalDB.copy(dt, dn, from_amend)
  23. Create and return a copy of record specified by `dt` and `dn`. Called by `Copy` and `Amend`
  24. .. function:: make_doclist(dt, dn)
  25. Return the required record and all child records from `locals`.