Jam.py

Latest version: v5.4.136

Safety actively analyzes 623775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

5.4.130

5.4.124

Privileges button added to reports

5.4.119

Range of records can be selected in the jam.py tables using ShiftKey

5.4.118

Changes in the release:

connection parameter adde to the open server method:

open(self, options=None, expanded=None, fields=None, where=None,
order_by=None, open_empty=False, params=None, offset=None, limit=None,
funcs=None, group_by=None, safe=False, connection=None)

If the connection is set to None, the application creates
a connection, executes an SQL SELECT query using it, and then closes it,
otherwise it uses the connection to execute the query.


The on_apply event changed

After the apply_delta method is executed, the delta is updated.
The primary key fields of the inserted records (for which rec_inserted returns True)
are assigned values that can be used for further data modifications.

if you are going to read or modify records of database tables during the execution
of the ``on_apply`` event handler, you must pass its connection parameter to the open
apply methods so that all operations take place in one transaction.


import datetime

def on_apply(item, delta, params, connection):
result = item.apply_delta(delta, params, connection)
for d in delta:

cust = item.task.customers.copy(handlers=False)
cust.set_where(id=d.customer.value)
cust.open(connection=connection)
cust.edit()
cust.last_modified.value = datetime.datetime.now()
cust.last_modified_record_id.value = d.id.value
[cust.post](http://cust.post/)()
cust.apply(connection)
return result

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.