[TurboGears] #2413: Installing tw.dojo breaks CrudRestController from tgext.crud

3 views
Skip to first unread message

TurboGears

unread,
Nov 23, 2009, 4:19:22 PM11/23/09
to turbogear...@googlegroups.com
#2413: Installing tw.dojo breaks CrudRestController from tgext.crud
------------------------+---------------------------------------------------
Reporter: boulon | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 2.1a3
Component: TurboGears | Version: 2.1a1
Severity: normal | Keywords:
------------------------+---------------------------------------------------
This bug actually have been seen on tgext.crud
(tgext.crud-0.3.3-py2.5.egg) using TurboGears 2.1a2, not 2.1a1 (but the
later isn't in the Version list):

At the top of tgext.crud.controller you can find these lines:
{{{
#!python
try:
import tw.dojo
except ImportError:
use_paginate = True
from tg.decorators import paginate
else:
# if dojo ist installed, we don't need pagination
use_paginate = False
}}}

However later in the file, in the get_all method of CrudRestController you
can find the following lines:

{{{
#!python
if use_paginate:
values = self.table_filler.get_value(**kw)
else:
values = []
tmpl_context.paginators = None
tmpl_context.widget = self.table
return dict(model=self.model.__name__, value_list=values)
}}}

Which means that if you install tw.dojo then the get_value method isn't
called anymore, leading to a 'No Records found' message.

One possible workaround may be to not only install tw.dojo, but use it
(with DojoTable and DojoTableFiller) :) However my attempt to do that
failed in another way that I will probably file here too after more
investigation.

--
Ticket URL: <http://trac.turbogears.org/ticket/2413>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

TurboGears

unread,
Nov 27, 2009, 10:44:39 PM11/27/09
to turbogear...@googlegroups.com
#2413: Installing tw.dojo breaks CrudRestController from tgext.crud
------------------------+---------------------------------------------------
Reporter: boulon | Owner: percious
Type: defect | Status: assigned
Priority: normal | Milestone: 2.1a3
Component: TurboGears | Version: 2.1a1
Severity: normal | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Changes (by percious):

* owner: => percious
* status: new => assigned

Comment:

I investigated this problem and found it to be user error, however, There
is a problem with having tw.dojo installed and getting pagination to work.
It is possible that we need to modify sprox to have something like a
"get's own data" flag or something so that the page controller knows
whether to populate the table with data. Therefore, this ticket is being
left open.

--
Ticket URL: <http://trac.turbogears.org/ticket/2413#comment:1>

TurboGears

unread,
Feb 24, 2010, 11:46:38 AM2/24/10
to turbogear...@googlegroups.com
#2413: Installing tw.dojo breaks CrudRestController from tgext.crud
------------------------+---------------------------------------------------
Reporter: boulon | Owner: percious
Type: defect | Status: closed
Priority: normal | Milestone: 2.1b2
Component: TurboGears | Version: 2.1a1
Severity: normal | Resolution: fixed
Keywords: |
------------------------+---------------------------------------------------
Changes (by percious):

* status: assigned => closed
* resolution: => fixed

--
Ticket URL: <http://trac.turbogears.org/ticket/2413#comment:2>

Reply all
Reply to author
Forward
0 new messages