PLANTA customizer APIs Current: ppms.sql ppms.sql Die nachfolgenden Inhalte sind nur in englischer Sprache verfügbar. The sql module provides helper functions for working with the database directly.FunctionsFunctionParametersReturn ValueDescriptionconvert_date_to_planta_time(date, date_format=%d.%m.%Y)date: String containing a datedate_format: A valid date format stringThe date converted to amount of days since 01.01.1970Converts a readable date into the format used by PLANTA date fieldsconvert_planta_time_to_date(planta_time, date_format=%d.%m.%Y)planta_time: Days since 01.01.1970date_format: A valid date format stringA readable date as defined by the formatConverts the PLANTA internal date format to a readable stringget_sql_date_format(planta_time)planta_time: Days since 01.01.1970Returns a string to be used in an sql statementConverts the days since 01.01.1970 to a proper date string and then adds the dbms related code to make it valid sqlsanitize_value(value)value: A value you want to insert into a SQL statementA sanitized version of the valueSanitizes a string that will later be formatted into an sql statement. Useful for preventing SQL injections or putting UUID objects into a statementExamplesConverting a planta time to a date string from ppms.sql import convert_planta_time_to_date from ppms.constants import SYS_VAR_TODAY today = ppms.uvar_get(SYS_VAR_TODAY) today_as_date_string = convert_planta_time_to_date(planta_time=today) ppms.ui_message_box('Today is {}'.format(today_as_date_string)) PY ×