This is definitely a bug in crud, which I have not had the opportunity
to fix yet.

In the dbmechanic controller, I scrape out the many-to-many columns
before I call the provider's select method (so you don't get this
error).

cheers.
-chris

On May 13, 12:44 am, dakila <[EMAIL PROTECTED]> wrote:
> Hello,
>
> in the create controller, I just changed the
> value = provider.select(tableName=self.tablename,values=kw)
> to
> value = getTableValue(model=User)
>
> It seems getTableValue will work for tables with many to many relation
> to other table (ie tg_group).
> makeTable returns a datagrid widget that also requires the other
> 'mapped' properties. However provider.select will only return rows
> containing only the columns in the table. Therefor calls by the
> datagrid to that column (in this case tg_groups) produces the
> NoSuchColumnError: "Could not locate column in row for column
> 'tg_groups'".
>
> I am not sure if this can be considered a crud bug, since the produced
> controller already contains the import statement for getTableValue. If
> it is a bug I can create a ticket in trac.
>
> Dax
>
> On May 12, 4:28 pm, dakila <[EMAIL PROTECTED]> wrote:
>
> > Hello list,
>
> > I am a long time fan of tgCRUD and have been using it in my tg 1.0.xx
> > projects. I have been trying out tg2 (checked out trunk)
> > Anyone have some pointers to get started for customizing the code
> > outputted by crud work for tables with 'many to many' relation (ie:
> > tg_user >- user_group -< tg_group)?
> > I have been looking at the dbsprockets and dbmechanic code to
> > understand it more.
> > Some parameters like limitFields parameters from makeTable,  dont get
> > passed to makeView?
> > I am not sure if it is a bug or something,
> > Although I am still not successful solving the error I mentioned
> > previously :)
>
> > TIA,
> > Dax
>
> > On May 12, 12:57 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > > Added info:
> > > > On display (/user/list), I am getting a NoSuchColumnError: "Could not
> > > > locate column in row for column 'tg_groups'"
>
> > > > dakila wrote:
> > > > > Hello,
>
> > > > > I quickstarted a project on tg2, setup the db and created a controller
> > > > > using crud for tg_user (paster crud -m User).
> > > > > However, I am getting a NoSuchColumnError: "Could not locate column in
> > > > > row for column 'tg_groups'".
>
> > > In this case you could comment out the #dbmachanic = xxx... column in
> > > root.py,
> > > and browsehttp://..../dbmachanictomanipulatetg_user.
>
> > > crud is fit for simpler schema usage, you need more skill to customize
> > > crud for relational column.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to