Recommendations on DB, structure, etc.

Hello, wxPythoners!

I've been 'toying' with wxPython (including PythonCard, wxGlade, XRCed, etc.) for several months, and now I'd like to develop the application that sparked my interest in all this. But first I thought I'd ask for recommendations from this group.

The application I have in mind will involve a database of business records. Each record has six fields. The first five fields are single line text (user entered), single line text (select from list) or boolen. The sixth field is a multiline text description (can be several paragraphs). My goal is to display the first five fields for all the records in a grid on the left side of the window (there will be no more than 300 records). I'd like the sixth field for the selected record to be displayed in a multiline textEdit box on the right side of the window.

I'm looking for recommendations on the following:

- backend database - do I need something complicated like MySQL, or can I get away with a text file? Do I need to save my data using Python's 'pickle' function, or can I just save the data to a text file (and perhaps some configuration information to a separate text file)?

- I'd like to have a splitter so I can change the ratio of grid to textEdit areas. Of the five 'grid' fields, three are relatively fixed width, while the other two should take up any remaining space. How can I tell those two columns to expand to fill available space?

- I want to be able to sort and (eventually) filter the grid columns. I know sorting is supported by wxGrid. What about filtering? Are there any good examples of this?

- And finally, (a sacrilegious question), is the wxGrid function mature enough to deal with my needs, or should I be looking at another toolkit such as GTK, etc.?

If you're interested, the way I deal with this database right now is as follows: I have an Excel spreadsheet with the first five fields in columns. I use Excel's autofilter function to provide for sorting and filtering. The sixth column of the sheet contains a URL to a local text file (one for each record). When I click on that link, it opens the text file, where I can type description notes. It's kludgey, but it works. I dream of the day when I can have this functionality in one wxPython application!

Any help will be sincerely appreciated and I'll keep the list up-to-date on my progress!

-- Clint
-- clint@robotic.com

By the way, if it helps, a crude mock-up of the idea is attached as a JPEG screenshot.

-- Clint

Clint Laskowski wrote:

···

Hello, wxPythoners!

I've been 'toying' with wxPython (including PythonCard, wxGlade, XRCed, etc.) for several months, and now I'd like to develop the application that sparked my interest in all this. But first I thought I'd ask for recommendations from this group.

The application I have in mind will involve a database of business records. Each record has six fields. The first five fields are single line text (user entered), single line text (select from list) or boolen. The sixth field is a multiline text description (can be several paragraphs). My goal is to display the first five fields for all the records in a grid on the left side of the window (there will be no more than 300 records). I'd like the sixth field for the selected record to be displayed in a multiline textEdit box on the right side of the window.

I'm looking for recommendations on the following:

- backend database - do I need something complicated like MySQL, or can I get away with a text file? Do I need to save my data using Python's 'pickle' function, or can I just save the data to a text file (and perhaps some configuration information to a separate text file)?

- I'd like to have a splitter so I can change the ratio of grid to textEdit areas. Of the five 'grid' fields, three are relatively fixed width, while the other two should take up any remaining space. How can I tell those two columns to expand to fill available space?

- I want to be able to sort and (eventually) filter the grid columns. I know sorting is supported by wxGrid. What about filtering? Are there any good examples of this?

- And finally, (a sacrilegious question), is the wxGrid function mature enough to deal with my needs, or should I be looking at another toolkit such as GTK, etc.?

If you're interested, the way I deal with this database right now is as follows: I have an Excel spreadsheet with the first five fields in columns. I use Excel's autofilter function to provide for sorting and filtering. The sixth column of the sheet contains a URL to a local text file (one for each record). When I click on that link, it opens the text file, where I can type description notes. It's kludgey, but it works. I dream of the day when I can have this functionality in one wxPython application!

Any help will be sincerely appreciated and I'll keep the list up-to-date on my progress!

-- Clint
-- clint@robotic.com

> I'm looking for recommendations on the following:
>
> - backend database - do I need something complicated like MySQL, or
> can
> I get away with a text file? Do I need to save my data
using Python's
> 'pickle' function, or can I just save the data to a text file (and
> perhaps some configuration information to a separate text file)?
>

I personally would use MySQL, but then, I don't find it complicated. Not as
complicated as one text file record record, anyway. I use "MySQL for
Python" for database connectivity.

David

Thanks, David. When I said 'complicated', I guess I was referring more to the interfacing to MySQL, but maybe that isn't that hard. I'll look into it. Any help on the other issues is obviously still appreciated.

-- Clint

David Woods wrote:

···

I'm looking for recommendations on the following:

- backend database - do I need something complicated like MySQL, or can
I get away with a text file? Do I need to save my data

using Python's

'pickle' function, or can I just save the data to a text file (and perhaps some configuration information to a separate text file)?

I personally would use MySQL, but then, I don't find it complicated. Not as
complicated as one text file record record, anyway. I use "MySQL for
Python" for database connectivity.

David

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

That kind of application is no big deal. The grid has a speed issue with a
large number of records, but for only 300 it should perform just fine.
I'd always use a backend that controls the data - i.e. a SQL database (well, I
would use PostgreSQL). Since you probably don't have a SQL engine installed
and quite frankly it would be overkill to require a full blown SQL server,
maybe you look into SQLite or gadfly. (SQLite is @ www.sqlite.org - you can
find python bindings at pysqlite.org). Neither of those 2 db's will need a
"server", both are embeddable and used just like any other python module.
They will store the data in flat files without a server process.

UC

···

On Wednesday 23 March 2005 08:22, Clint Laskowski wrote:

By the way, if it helps, a crude mock-up of the idea is attached as a
JPEG screenshot.

-- Clint

Clint Laskowski wrote:
> Hello, wxPythoners!
>
> I've been 'toying' with wxPython (including PythonCard, wxGlade, XRCed,
> etc.) for several months, and now I'd like to develop the application
> that sparked my interest in all this. But first I thought I'd ask for
> recommendations from this group.
>
> The application I have in mind will involve a database of business
> records. Each record has six fields. The first five fields are single
> line text (user entered), single line text (select from list) or boolen.
> The sixth field is a multiline text description (can be several
> paragraphs). My goal is to display the first five fields for all the
> records in a grid on the left side of the window (there will be no more
> than 300 records). I'd like the sixth field for the selected record to
> be displayed in a multiline textEdit box on the right side of the window.
>
> I'm looking for recommendations on the following:
>
> - backend database - do I need something complicated like MySQL, or can
> I get away with a text file? Do I need to save my data using Python's
> 'pickle' function, or can I just save the data to a text file (and
> perhaps some configuration information to a separate text file)?
>
> - I'd like to have a splitter so I can change the ratio of grid to
> textEdit areas. Of the five 'grid' fields, three are relatively fixed
> width, while the other two should take up any remaining space. How can I
> tell those two columns to expand to fill available space?
>
> - I want to be able to sort and (eventually) filter the grid columns. I
> know sorting is supported by wxGrid. What about filtering? Are there any
> good examples of this?
>
> - And finally, (a sacrilegious question), is the wxGrid function mature
> enough to deal with my needs, or should I be looking at another toolkit
> such as GTK, etc.?
>
> If you're interested, the way I deal with this database right now is as
> follows: I have an Excel spreadsheet with the first five fields in
> columns. I use Excel's autofilter function to provide for sorting and
> filtering. The sixth column of the sheet contains a URL to a local text
> file (one for each record). When I click on that link, it opens the text
> file, where I can type description notes. It's kludgey, but it works. I
> dream of the day when I can have this functionality in one wxPython
> application!
>
> Any help will be sincerely appreciated and I'll keep the list up-to-date
> on my progress!
>
> -- Clint
> -- clint@robotic.com

Clint,

Like you, I too am new to python. A few months ago I built a very primitive DB app using SQLite (an embedded DB <sqlite.org>) and PythonCard for the GUI (I plan to re-write in wxPython very soon). It was design for a very specific kind of Database management system (it 'eats' formatted emails) for my company. And it does some of the things you require, you may find it useful.

It was my first attempt at Python, so there are some mistakes but It works as I excepted to.

I was going to make a full tutorial out of it, but I shifted over to wxPython and SPE (for my IDE).

Feel free to use it any way you want. :slight_smile:

<http://www.ebbyfish.com/py/python.php&gt;

Scott

Clint Laskowski wrote:

···

By the way, if it helps, a crude mock-up of the idea is attached as a JPEG screenshot.

-- Clint

Clint Laskowski wrote:

Hello, wxPythoners!

I've been 'toying' with wxPython (including PythonCard, wxGlade, XRCed, etc.) for several months, and now I'd like to develop the application that sparked my interest in all this. But first I thought I'd ask for recommendations from this group.

The application I have in mind will involve a database of business records. Each record has six fields. The first five fields are single line text (user entered), single line text (select from list) or boolen. The sixth field is a multiline text description (can be several paragraphs). My goal is to display the first five fields for all the records in a grid on the left side of the window (there will be no more than 300 records). I'd like the sixth field for the selected record to be displayed in a multiline textEdit box on the right side of the window.

I'm looking for recommendations on the following:

- backend database - do I need something complicated like MySQL, or can I get away with a text file? Do I need to save my data using Python's 'pickle' function, or can I just save the data to a text file (and perhaps some configuration information to a separate text file)?

- I'd like to have a splitter so I can change the ratio of grid to textEdit areas. Of the five 'grid' fields, three are relatively fixed width, while the other two should take up any remaining space. How can I tell those two columns to expand to fill available space?

- I want to be able to sort and (eventually) filter the grid columns. I know sorting is supported by wxGrid. What about filtering? Are there any good examples of this?

- And finally, (a sacrilegious question), is the wxGrid function mature enough to deal with my needs, or should I be looking at another toolkit such as GTK, etc.?

If you're interested, the way I deal with this database right now is as follows: I have an Excel spreadsheet with the first five fields in columns. I use Excel's autofilter function to provide for sorting and filtering. The sixth column of the sheet contains a URL to a local text file (one for each record). When I click on that link, it opens the text file, where I can type description notes. It's kludgey, but it works. I dream of the day when I can have this functionality in one wxPython application!

Any help will be sincerely appreciated and I'll keep the list up-to-date on my progress!

-- Clint
-- clint@robotic.com

------------------------------------------------------------------------

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005

Thanks Scott, this looks like it will be extrememly helpful! Again, I'll update the list as I make progress. -- Clint

Scott Mallory wrote:

···

Clint,

Like you, I too am new to python. A few months ago I built a very primitive DB app using SQLite (an embedded DB <sqlite.org>) and PythonCard for the GUI (I plan to re-write in wxPython very soon). It was design for a very specific kind of Database management system (it 'eats' formatted emails) for my company. And it does some of the things you require, you may find it useful.

It was my first attempt at Python, so there are some mistakes but It works as I excepted to.

I was going to make a full tutorial out of it, but I shifted over to wxPython and SPE (for my IDE).

Feel free to use it any way you want. :slight_smile:

<http://www.ebbyfish.com/py/python.php&gt;

Scott

Clint Laskowski wrote:

By the way, if it helps, a crude mock-up of the idea is attached as a JPEG screenshot.

-- Clint

Clint Laskowski wrote:

Hello, wxPythoners!

I've been 'toying' with wxPython (including PythonCard, wxGlade, XRCed, etc.) for several months, and now I'd like to develop the application that sparked my interest in all this. But first I thought I'd ask for recommendations from this group.

The application I have in mind will involve a database of business records. Each record has six fields. The first five fields are single line text (user entered), single line text (select from list) or boolen. The sixth field is a multiline text description (can be several paragraphs). My goal is to display the first five fields for all the records in a grid on the left side of the window (there will be no more than 300 records). I'd like the sixth field for the selected record to be displayed in a multiline textEdit box on the right side of the window.

I'm looking for recommendations on the following:

- backend database - do I need something complicated like MySQL, or can I get away with a text file? Do I need to save my data using Python's 'pickle' function, or can I just save the data to a text file (and perhaps some configuration information to a separate text file)?

- I'd like to have a splitter so I can change the ratio of grid to textEdit areas. Of the five 'grid' fields, three are relatively fixed width, while the other two should take up any remaining space. How can I tell those two columns to expand to fill available space?

- I want to be able to sort and (eventually) filter the grid columns. I know sorting is supported by wxGrid. What about filtering? Are there any good examples of this?

- And finally, (a sacrilegious question), is the wxGrid function mature enough to deal with my needs, or should I be looking at another toolkit such as GTK, etc.?

If you're interested, the way I deal with this database right now is as follows: I have an Excel spreadsheet with the first five fields in columns. I use Excel's autofilter function to provide for sorting and filtering. The sixth column of the sheet contains a URL to a local text file (one for each record). When I click on that link, it opens the text file, where I can type description notes. It's kludgey, but it works. I dream of the day when I can have this functionality in one wxPython application!

Any help will be sincerely appreciated and I'll keep the list up-to-date on my progress!

-- Clint
-- clint@robotic.com

------------------------------------------------------------------------

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

I am glad to hear that. Just be kind when you discover my bad programming methods :slight_smile:

Scott Mallory

Clint Laskowski wrote:

···

Thanks Scott, this looks like it will be extrememly helpful! Again, I'll update the list as I make progress. -- Clint

Scott Mallory wrote:

Clint,

Like you, I too am new to python. A few months ago I built a very primitive DB app using SQLite (an embedded DB <sqlite.org>) and PythonCard for the GUI (I plan to re-write in wxPython very soon). It was design for a very specific kind of Database management system (it 'eats' formatted emails) for my company. And it does some of the things you require, you may find it useful.

It was my first attempt at Python, so there are some mistakes but It works as I excepted to.

I was going to make a full tutorial out of it, but I shifted over to wxPython and SPE (for my IDE).

Feel free to use it any way you want. :slight_smile:

<http://www.ebbyfish.com/py/python.php&gt;

Scott

Clint Laskowski wrote:

By the way, if it helps, a crude mock-up of the idea is attached as a JPEG screenshot.

-- Clint

Clint Laskowski wrote:

Hello, wxPythoners!

I've been 'toying' with wxPython (including PythonCard, wxGlade, XRCed, etc.) for several months, and now I'd like to develop the application that sparked my interest in all this. But first I thought I'd ask for recommendations from this group.

The application I have in mind will involve a database of business records. Each record has six fields. The first five fields are single line text (user entered), single line text (select from list) or boolen. The sixth field is a multiline text description (can be several paragraphs). My goal is to display the first five fields for all the records in a grid on the left side of the window (there will be no more than 300 records). I'd like the sixth field for the selected record to be displayed in a multiline textEdit box on the right side of the window.

I'm looking for recommendations on the following:

- backend database - do I need something complicated like MySQL, or can I get away with a text file? Do I need to save my data using Python's 'pickle' function, or can I just save the data to a text file (and perhaps some configuration information to a separate text file)?

- I'd like to have a splitter so I can change the ratio of grid to textEdit areas. Of the five 'grid' fields, three are relatively fixed width, while the other two should take up any remaining space. How can I tell those two columns to expand to fill available space?

- I want to be able to sort and (eventually) filter the grid columns. I know sorting is supported by wxGrid. What about filtering? Are there any good examples of this?

- And finally, (a sacrilegious question), is the wxGrid function mature enough to deal with my needs, or should I be looking at another toolkit such as GTK, etc.?

If you're interested, the way I deal with this database right now is as follows: I have an Excel spreadsheet with the first five fields in columns. I use Excel's autofilter function to provide for sorting and filtering. The sixth column of the sheet contains a URL to a local text file (one for each record). When I click on that link, it opens the text file, where I can type description notes. It's kludgey, but it works. I dream of the day when I can have this functionality in one wxPython application!

Any help will be sincerely appreciated and I'll keep the list up-to-date on my progress!

-- Clint
-- clint@robotic.com

------------------------------------------------------------------------

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005

Clint Laskowski wrote:

Hello, wxPythoners!

I've been 'toying' with wxPython (including PythonCard, wxGlade, XRCed, etc.) for several months, and now I'd like to develop the application that sparked my interest in all this. But first I thought I'd ask for recommendations from this group.

The application I have in mind will involve a database of business records. Each record has six fields. The first five fields are single line text (user entered), single line text (select from list) or boolen. The sixth field is a multiline text description (can be several paragraphs). My goal is to display the first five fields for all the records in a grid on the left side of the window (there will be no more than 300 records). I'd like the sixth field for the selected record to be displayed in a multiline textEdit box on the right side of the window.

I'm looking for recommendations on the following:

- backend database - do I need something complicated like MySQL, or can I get away with a text file? Do I need to save my data using Python's 'pickle' function, or can I just save the data to a text file (and perhaps some configuration information to a separate text file)?

You can use MySQL but you can also easily do with pickle/text files/csv files.

Perhaps have a look at quoteviewer
http://quotesviewer.sourceforge.net/
I is a similar application (?), except maybe for the text field which shouldn't be too difficult to add. I use both csv file (1200 records, 8 fields) and lately some pickle for small config data (watchlist).

- I'd like to have a splitter so I can change the ratio of grid to textEdit areas. Of the five 'grid' fields, three are relatively fixed width, while the other two should take up any remaining space. How can I tell those two columns to expand to fill available space?

Don't know how to do that, any ideas somebody ?

- I want to be able to sort and (eventually) filter the grid columns. I know sorting is supported by wxGrid. What about filtering? Are there any good examples of this?

In quotesviewer i use pythoncard with multicolumnlist iso wxGrid. Sorting works fine by clicking on the headers, i just had to write some
extra code to do the authosizing of the columns (something missing here in wxPython's wxListCtrl ?). I also added some filtering methods which
are straightforward oneliners in python.
You can download the application via sourceforge or just have a look
to the CVS repository on the sourceforge project page. The file euronextBrowser.py has the main code.

- And finally, (a sacrilegious question), is the wxGrid function mature enough to deal with my needs, or should I be looking at another toolkit such as GTK, etc.?

With my experience with PythonCard and multicomnList (based on wxPython wxListCtrl) i would say wxPython, PythonCard is mature enough for this kind of application, no need to switch GTK needed.

If you're interested, the way I deal with this database right now is as follows: I have an Excel spreadsheet with the first five fields in columns. I use Excel's autofilter function to provide for sorting and filtering. The sixth column of the sheet contains a URL to a local text file (one for each record). When I click on that link, it opens the text file, where I can type description notes. It's kludgey, but it works. I dream of the day when I can have this functionality in one wxPython application!

Any help will be sincerely appreciated and I'll keep the list up-to-date on my progress!

-- Clint
-- clint@robotic.com

Hopes this helps,
Enjoy,
Ronny De Winter
http://quotesviewer.sourceforge.net/
The Free Euronext Stock Browser

For small'ish sets of data, I've found that python dictionaries are ideal. I have several
sets of data that I manage using dicts, compiling them at access time. Works very well.

For a larger data set, I've been building a genuine database using postgres. (GUI in
progress, on a slow boat to the Far East.) All procedural access to my db is via python.
So far, so good!

Scott

···

Clint Laskowski wrote:

I'm looking for recommendations on the following:
- backend database - do I need something complicated like MySQL, or can I get away with a text file? Do I need to save my data using Python's 'pickle' function, or can I just save the data to a text file (and perhaps some configuration information to a separate text file)?

could you explain how you use python dictionaries for 'small'ish' sets of data, perhaps giving an example? thank you.

-- clint

Scott Frankel wrote:

···

For small'ish sets of data, I've found that python dictionaries are ideal. I have several
sets of data that I manage using dicts, compiling them at access time. Works very well.

For a larger data set, I've been building a genuine database using postgres. (GUI in
progress, on a slow boat to the Far East.) All procedural access to my db is via python.
So far, so good!

Scott

Clint Laskowski wrote:

I'm looking for recommendations on the following:
- backend database - do I need something complicated like MySQL, or can I get away with a text file? Do I need to save my data using Python's 'pickle' function, or can I just save the data to a text file (and perhaps some configuration information to a separate text file)?

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Clint Laskowski wrote:

could you explain how you use python dictionaries for 'small'ish' sets of data, perhaps giving an example? thank you.

Again i can refer to quotesviewer, the Quotes class inherits from dict,
read/write from/to csv files, read from url, has some accessor methods
for filling the wxListCtrl (multicolumnlist) data, and filtering.
The code:

-- clint

Enjoy,
Ronny De Winter
http://quotesviewer.sourceforge.net/
The Free Euronext Stock Browser

# Given a dictionary like this in foo.py:

'theDict = {
  'one' : 'this is one',
  'two' : 'this is two',
  'three' : 'this is three'
  }

#You access the data programmatically like this:

theDict = {}
try:
  import compiler
  fileh = open(foo.py, 'r')
  theContents = fileh.read()
  fileh.close()
  obj = compiler.compile(theContents, 'stderr', 'single')
  exec obj in theDict
except IOError:
  print "ERROR <%s>: \"%s\" not found" % (sys.argv[0], foo.py)

# Your script now has access to the dict, like this:

print theDict['one']

# which yields

'this is one'

Hope this helps -
Scott

···

On Mar 24, 2005, at 11:40 AM, Clint Laskowski wrote:

could you explain how you use python dictionaries for 'small'ish' sets of data, perhaps giving an example? thank you.

-- clint

Scott Frankel wrote:

For small'ish sets of data, I've found that python dictionaries are ideal. I have several
sets of data that I manage using dicts, compiling them at access time. Works very well.
For a larger data set, I've been building a genuine database using postgres. (GUI in
progress, on a slow boat to the Far East.) All procedural access to my db is via python.
So far, so good!
Scott

Clint Laskowski wrote:

I'm looking for recommendations on the following:
- backend database - do I need something complicated like MySQL, or can I get away with a text file? Do I need to save my data using Python's 'pickle' function, or can I just save the data to a text file (and perhaps some configuration information to a separate text file)?

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org