Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
basket
Commits
1419932239fa
Commit
56770725
authored
Jan 05, 2011
by
Sylvain Thénault
Browse files
don't inherit from RQLCtxComponent since everything is redefined here
parent
b193b6a4c596
Changes
1
Hide whitespace changes
Inline
Side-by-side
views.py
View file @
14199322
...
...
@@ -66,10 +66,10 @@ def insert_eids(actions, eids):
class
BasketBox
(
component
.
RQL
CtxComponent
):
class
BasketBox
(
component
.
CtxComponent
):
"""display a box containing all user's basketitems"""
__regid__
=
'basket_box'
__select__
=
component
.
RQL
CtxComponent
.
__select__
&
(
__select__
=
component
.
CtxComponent
.
__select__
&
(
none_rset
()
|
non_final_entity
())
# XXX disabled by default. One should remove the basket cube if he doesn't
# want the basket box, or deactivate it explicitly
...
...
@@ -80,14 +80,11 @@ class BasketBox(component.RQLCtxComponent):
etype
=
'Basket'
rtype
=
'in_basket'
def
to_display_rql
(
self
):
return
(
self
.
rql
,
{
'x'
:
self
.
_cw
.
user
.
eid
})
def
init_rendering
(
self
):
super
(
BasketBox
,
self
).
init_rendering
()
req
=
self
.
_cw
try
:
baskets
=
req
.
execute
(
*
self
.
to_display_rql
()
)
baskets
=
req
.
execute
(
self
.
rql
,
{
'x'
:
self
.
_cw
.
user
.
eid
}
)
except
Unauthorized
:
# can't access to something in the query, forget this box
raise
component
.
EmptyComponent
()
...
...
Write
Preview
Markdown
is supported
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