Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12757 > unrolled thread

Hello, and request for help with 'dynamic grids'

Started bySimon Cropper <simoncropper@fossworkflowguides.com>
First post2011-09-05 15:18 +1000
Last post2011-09-06 09:09 +1000
Articles 5 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Hello, and request for help with 'dynamic grids' Simon Cropper <simoncropper@fossworkflowguides.com> - 2011-09-05 15:18 +1000
    Re: Hello, and request for help with 'dynamic grids' Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-05 17:19 +1000
      Re: Hello, and request for help with 'dynamic grids' Simon Cropper <simoncropper@fossworkflowguides.com> - 2011-09-05 20:07 +1000
    Re: Hello, and request for help with 'dynamic grids' alex23 <wuwei23@gmail.com> - 2011-09-05 07:40 -0700
      Re: Hello, and request for help with 'dynamic grids' Simon Cropper <simoncropper@fossworkflowguides.com> - 2011-09-06 09:09 +1000

#12757 — Hello, and request for help with 'dynamic grids'

FromSimon Cropper <simoncropper@fossworkflowguides.com>
Date2011-09-05 15:18 +1000
SubjectHello, and request for help with 'dynamic grids'
Message-ID<mailman.765.1315202654.27778.python-list@python.org>
Hi,

I am a applications developer - originally from Windows using primarily 
Visual Foxpro, although I am familiar with a variety of other xbase 
derivatives. I now use Linux / Ubuntu, and have been actively teaching 
myself Python with the view to migrate most of my applications to 
sqlite-based database.

I am looking for the ability to create dynamic grids in a window but 
can't for the life of me find how to do this.

Here is the functionality that I desire...
1. Have a dialog appear that allows me to select a database, e.g. 
sqlite3 database.
2. Select table in the database and have all the records appear in a 
grid. Fields represented as column, width and order adjustable, rows 
representing records. Each cell can be edited directly.
3. I would like to create filters on this grid based on attributes in 
the table. So if the table is a list of names, filter and show only 
those people with a particular first name. For people familiar with 
xbase languages it equivalent to browsing a table and applying a filter.
4. Once the record is identified I would like to select the record or 
hit enter to have the data sent to the keyboard buffer or put into the 
clipboard.

I have found most of these elements available. I can create dialogs, I 
can connect to a database, I can extract data from the tables using SQL 
but I can't find how to easily get these lists into a grid -- it appears 
to me you need to allocate list record 1 to grid row 1, list record 2 to 
grid row 2, etc and manage how many rows are displayed and 'page' 
through the table.

Am I missing something? I presume that you could just supply a list or 
array selected using SQL from a table and just pass this data to a grid 
and have it manage all the basics like if the window is resized the 
number of rows and columns are adjusted accordingly, buffering records, etc.

My investigations have generally found that windows/forms/data entry 
screen can be created for a specific table or view, but these are 
hard-wired during development. Is there anyway of rapidly defining the 
grid during runtime so any table can be viewed?

-- 
Cheers Simon

    Simon Cropper - Open Content Creator / Website Administrator

    Free and Open Source Software Workflow Guides
    ------------------------------------------------------------
    Introduction               http://www.fossworkflowguides.com
    GIS Packages               http://gis.fossworkflowguides.com
    bash / Python        http://scripting.fossworkflowguides.com

[toc] | [next] | [standalone]


#12761

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2011-09-05 17:19 +1000
Message-ID<4e6477f0$0$29981$c3e8da3$5496439d@news.astraweb.com>
In reply to#12757
On Mon, 5 Sep 2011 03:18 pm Simon Cropper wrote:

> I am looking for the ability to create dynamic grids in a window but
> can't for the life of me find how to do this.

What GUI toolkit are you using?


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#12764

FromSimon Cropper <simoncropper@fossworkflowguides.com>
Date2011-09-05 20:07 +1000
Message-ID<mailman.769.1315217234.27778.python-list@python.org>
In reply to#12761
On 05/09/11 17:19, Steven D'Aprano wrote:
> On Mon, 5 Sep 2011 03:18 pm Simon Cropper wrote:
>
>> I am looking for the ability to create dynamic grids in a window but
>> can't for the life of me find how to do this.
>
> What GUI toolkit are you using?
>
>

I have looked at wxGlade, Boa Constructor, wxFormBuilder, tkinder, I 
have also looked through the Python website many times looking for 
commands that would allow me to create a GUI from scratch.

-- 
Cheers Simon

    Simon Cropper - Open Content Creator / Website Administrator

    Free and Open Source Software Workflow Guides
    ------------------------------------------------------------
    Introduction               http://www.fossworkflowguides.com
    GIS Packages               http://gis.fossworkflowguides.com
    bash / Python        http://scripting.fossworkflowguides.com

[toc] | [prev] | [next] | [standalone]


#12774

Fromalex23 <wuwei23@gmail.com>
Date2011-09-05 07:40 -0700
Message-ID<624f5caf-e3c1-4a88-9861-606f7e2705e8@x14g2000prn.googlegroups.com>
In reply to#12757
On Sep 5, 3:18 pm, Simon Cropper <simoncrop...@fossworkflowguides.com>
wrote:
> My investigations have generally found that windows/forms/data entry
> screen can be created for a specific table or view, but these are
> hard-wired during development. Is there anyway of rapidly defining the
> grid during runtime so any table can be viewed?

The commercial product Resolver One provides a grid/spreadsheet style
interface with Python scripting capabilities. I'm not sure of its
current licensing status but I believe it used to be free if used on
open source projects.

http://www.resolversystems.com/products/resolver-one/

Each spreadsheet itself is Python code; I think it should be quite do-
able to take something with introspective SQL capabilities like
SQLAlchemy and have it title columns and fill them with the correct
fields accordingly.

Hope this helps.

[toc] | [prev] | [next] | [standalone]


#12798

FromSimon Cropper <simoncropper@fossworkflowguides.com>
Date2011-09-06 09:09 +1000
Message-ID<mailman.785.1315264164.27778.python-list@python.org>
In reply to#12774
On 06/09/11 00:40, alex23 wrote:
> On Sep 5, 3:18 pm, Simon Cropper<simoncrop...@fossworkflowguides.com>
> wrote:
>> My investigations have generally found that windows/forms/data entry
>> screen can be created for a specific table or view, but these are
>> hard-wired during development. Is there anyway of rapidly defining the
>> grid during runtime so any table can be viewed?
>
> The commercial product Resolver One provides a grid/spreadsheet style
> interface with Python scripting capabilities. I'm not sure of its
> current licensing status but I believe it used to be free if used on
> open source projects.
>
> http://www.resolversystems.com/products/resolver-one/
>
> Each spreadsheet itself is Python code; I think it should be quite do-
> able to take something with introspective SQL capabilities like
> SQLAlchemy and have it title columns and fill them with the correct
> fields accordingly.
>
> Hope this helps.
>
>

Alex,

The Resolver Package looks good. Not exactly open source though. I 
equate it to a proprietary package that can at times be used for free by 
select groups.

The product creates spreadsheets with python code in the background 
(instead of say VBA in Excel or Basic in Calc).

Access to a database still needs to be hard-wired, so it does not act as 
a 'dynamic' viewer. The product works pretty much like Excel and Calc in 
this manner.

Sheets can be shared, although the Resolver Exchange website does not 
clarify the licence under which samples are released (GPL, CC, etc), so 
it is debatable how any of this could reliably be used in creation of 
derivatives.

 From what I can glean from this page...

      http://www.resolversystems.com/opensource/

      ... Resolver will allow you to use the package if you are an open 
source project to create spreadsheets that can be redistributed. For 
people to use these sheets they need to download the viewer or purchase 
the package.

-- 
Cheers Simon

    Simon Cropper - Open Content Creator / Website Administrator

    Free and Open Source Software Workflow Guides
    ------------------------------------------------------------
    Introduction               http://www.fossworkflowguides.com
    GIS Packages               http://gis.fossworkflowguides.com
    bash / Python        http://scripting.fossworkflowguides.com

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web