[wxPython-users] Grid Cell Renderer

Mark Erbaugh mark at microenh.com
Wed Jan 2 14:49:29 PST 2008


On Wed, 2008-01-02 at 12:07 -0800, Rich Shepard wrote:
>    Just out of curiosity, what is the context for this need? I'm
> trying without success to picture the situation. Is there a reason why
> the string cannot be displayed in the grid cell, or used in your code?
> You write that you have a dictionary of enumerates, but don't explain
> why that's not sufficient.

Here's the situation.  There is a database table (CATEGORY) with a list
of categories. Each row in this table has a unique (SERIAL /
AUTO-INCREMENT) integer column a name column.

There is a second table (MATERIAL). Each row has an integer column (RSN)
that references a row in the first table. For each row in this table,
there needs to select a category from the CATEGORY table.

I want to display and edit the rows from the MATERIAL table in the grid.
I'd like to have a ComboBox from which the user can select the category
for the row.  The integer RSN value doesn't mean anything to the user,
just the category name.

Are you suggesting that I put the code to translate from the integer to
the string in the GridTable? That should work, but wouldn't that be
putting some view logic in the model (assuming MVC)?

Mark




More information about the wxpython-users mailing list