lino_react.react.views

Views for lino_react.react.

(This module’s source code is available here.)

Functions

XML_response(ar, tplname, context)

Respone used for rendering XML views in react.

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

param actor

requesting Actor

elem2rec_empty(ar, ah, elem, **rec)

Returns a dict of this record, designed for usage by an EmptyTable.

find(itter, target[, key])

Returns the index of an element in a callable which can be use a key function

http_response(ar, tplname, context)

Deserves a docstring

layout2html(ar, elem)

Classes

ActionParamChoices(**kwargs)

ApiElement(**kwargs)

ApiList(**kwargs)

App(**kwargs)

Main app entry point, Also builds linoweb file for current user type.

Authenticate(**kwargs)

ChoiceListModel(**kwargs)

Creates a large JSON model that contains all the choicelists + choices

Choices(**kwargs)

DashboardItem(**kwargs)

MainHtml(**kwargs)

Null(**kwargs)

Just returns 200, used in an iframe to cause the browser to trigger “Do you want to remember this pw” dialog

Restful(**kwargs)

Used to collaborate with a restful Ext.data.Store.

Suggestions(**kwargs)

UserSettings(**kwargs)

Ajax interface for getting the current session/user settings.

lino_react.react.views.find(itter, target, key=None)

Returns the index of an element in a callable which can be use a key function

lino_react.react.views.elem2rec_empty(ar, ah, elem, **rec)

Returns a dict of this record, designed for usage by an EmptyTable.

lino_react.react.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

class lino_react.react.views.ChoiceListModel(**kwargs)

Bases: django.views.generic.base.View

Creates a large JSON model that contains all the choicelists + choices

Note: This could be improved, or might cause issues due to changing language

class lino_react.react.views.Restful(**kwargs)

Bases: django.views.generic.base.View

Used to collaborate with a restful Ext.data.Store.

get(request, app_label=None, actor=None, pk=None)

Works, but is ugly to get list and detail

lino_react.react.views.http_response(ar, tplname, context)

Deserves a docstring

lino_react.react.views.XML_response(ar, tplname, context)

Respone used for rendering XML views in react. Includes some helper functions for rendering.

class lino_react.react.views.Null(**kwargs)

Bases: django.views.generic.base.View

Just returns 200, used in an iframe to cause the browser to trigger “Do you want to remember this pw” dialog

class lino_react.react.views.App(**kwargs)

Bases: django.views.generic.base.View

Main app entry point, Also builds linoweb file for current user type. Content is mostly in the react/main.html template.

class lino_react.react.views.UserSettings(**kwargs)

Bases: django.views.generic.base.View

Ajax interface for getting the current session/user settings.