Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2413 (closed defect: fixed)

Opened 10 years ago

Last modified 9 years ago

Installing tw.dojo breaks CrudRestController from tgext.crud

Reported by: boulon Owned by: percious
Priority: normal Milestone: 2.1b2
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:

    import tw.dojo
except ImportError:
    use_paginate = True
    from tg.decorators import paginate
    # 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:

        if use_paginate:
            values = self.table_filler.get_value(**kw)
            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.

Change History

comment:1 Changed 10 years ago by percious

  • Status changed from new to assigned
  • Owner set to percious

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.

comment:2 Changed 9 years ago by percious

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.