Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
fresh
Commits
eee88e429e72
Commit
527095a4
authored
Oct 17, 2019
by
Philippe Pepiot
Browse files
Migrate from JonController to AjaxController
parent
7c0156c190cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb_fresh/views/__init__.py
View file @
eee88e42
"""template-specific forms/views/actions/components"""
from
logilab.common.decorators
import
monkeypatch
from
cubicweb.web
import
formwidgets
as
fw
from
cubicweb.web.views
import
uicfg
,
basecontrollers
from
cubicweb.web.views
import
uicfg
from
cubicweb.web.views.ajaxcontroller
import
ajaxfunc
_afs
=
uicfg
.
autoform_section
_affk
=
uicfg
.
autoform_field_kwargs
...
...
@@ -14,8 +13,7 @@ _affk.tag_subject_of(('Expense', 'spent_for', '*'),
autocomplete_settings
=
{
'limit'
:
100
,
'delay'
:
300
})})
@
monkeypatch
(
basecontrollers
.
JSonController
)
@
basecontrollers
.
jsonize
@
ajaxfunc
(
output_type
=
'json'
)
def
js_get_concerned_by
(
self
):
term
=
self
.
_cw
.
form
[
'q'
]
limit
=
self
.
_cw
.
form
.
get
(
'limit'
,
50
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment