views:

298

answers:

4

I'm building a student rostering application for a friend and I'm just about done except for the GUI. I'm writing it in wxpython but I'm not sure how to proceed with the input fields because it is a relational database. Is there a simple way to do this?

A: 

This is business application programming. Here's the basic model: Create a bunch of inputs, probably text boxes, one for each field. Create a button labeled "Add record" or something. When it's clicked, issue an insert to the database, passing the column values from the form inputs.

recursive
I think you mean issue an insert to the database.
Eppz
A: 

To make your life easier, you could use introspection with something like SQLAlchemy to generate classes, and just CRUD it up from there. Given that you (presumably) already have the backend done, though:

Offer dropdown boxes for the tables, then fill in the column names. When the values are plugged in, and "Submit" (or whatever you want to call it) is clicked, submit it to the database.

phresus
A: 

This can be easy, but tedious, because you have to validate, parse, convert, etc... Every input field. Anyway, you can create a DAO for every entity on your database with the proper SQL queries. Then use some model object that will interact with your GUI (validation, parsing, etc) and with the DAOs.

Ubersoldat
A: 

I'm a huge wxPython fan, and I would personally do it all in wxPython because it's such a nice toolkit. That said, there is a database-centric framework written on top of wxPython called Dabo. You should take a look at that.

DrBloodmoney