Welcome | Get started | Dive into Lino | Contribute | Reference | More

lino.core.views

Utility functions used by lino.modlib.extjs.views.

Functions

action_request(app_label, actor, request, ...)

choices_response(actor, request, qs, ...[, ...])

param actor:

requesting Actor

json_response(x[, content_type, status])

json_response_kw(**kw)

requested_actor(app_label, actor)

Return the requested actor, either directly or (if specified name is a model) that model's default table.

lino.core.views.requested_actor(app_label, actor)

Return the requested actor, either directly or (if specified name is a model) that model's default table.

lino.core.views.choices_response(actor, request, qs, row2dict, emptyValue, field=None)
Parameters:
  • actor -- requesting Actor

  • request -- web request

  • qs -- list of django model QS,

  • row2dict -- function for converting data set into a dict for json

  • emptyValue -- The Text value to represent None in the choice-list

  • is_blank_value -- The Text value to represent filtering rows that are blank in PV the choice-list

  • is_not_blank_value -- The Text value to represent filtering rows that are not blank in PV the choice-list

Returns:

json web responce

Filters data-set acording to quickseach Counts total rows in the set, Calculates offset and limit Adds None value returns