Re: Is there an obvious way to do this in python?



H J van Rooyen a écrit :
Hi,

I want to write a small system that is transaction based.

I want to split the GUI front end data entry away from the file handling and
record keeping.

Now it seems almost trivially easy using the sockets module to communicate
between machines on the same LAN, so that I want to do the record keeping on one
machine.

I want to keep the "server" machine as simple as possible - just doing record
keeping on a stimulus response basis - I would prefer it to do one thing at a
time to completion because this style of operation, though limited in
performance, keeps a lot of hassles out of life - a transaction has either
completed, or it has not - recovery scenarios are relatively easy...

IOW, you want a SQL DBMS. May I recommand PostgreSQL ?

Up to this point, I don't have a problem - my toy system can create a dummy
transaction, and I can echo it from the "server" machine, with more than one
"user" machine running - so I think it is feasible to have several tens of "data
entry terminal" systems running, served by one not very strong machine.

Now what I would really like to do is to differentiate between the 'User"
machines, so that some can do a full range of transactions, and others a limited
range.

Any decent SQL DBMS is able to handle this. It's kind of builtin...

And I would like to make this flexible, so that it becomes easy to introduce new
transactions, without having to run around updating the code in all the user
machines, with the concomitant version number hassles.

Then you want a web front end.

And I would like to do the whole thing in python

You'll at least need bits of SQL (but SQLAlchemy may hide away most of it) and HTML (but there are some python packages that knows how to build HTML from declarative Python code).

- so my question is this - is
it possible to do the equivalent of dynamic linking? - i.e. if I keep a list of
what a user is allowed to do

In SQL : GRANT/REVOKE

- can I somehow send him just the bits he needs to
do the job, without having to change the static code on his machine?

HTTP/HTML.

- it seems
to me that the eval() thingy could possibly do this for me,

Err... I thought you wanted a reasonnably secure system, but I may have misunderstood.

by sending it data
that makes it do import statements followed by calls to whatever... - will this
work, or is there a better way?

Or has all this been done already?

Yes, it's called a web frontend for a SQL DBMS. There's no shortage of Python frameworks to do this kind of things.

- and no I don't want a web server

If you don't want Apache, there are Python-based application servers. CherryPy comes to mind.

and php

Why PHP ?

and browsers and Java

Why Java ?

and html or xml... - I want to write something that works
simply and reliably

We do write SQL-based web apps all day long, and I can tell you they are certainly more simple and reliable than whatever eval()-based home-made solution we could imagine !-)
.



Relevant Pages

  • Re: Is there an obvious way to do this in python?
    ... |> I want to write a small system that is transaction based. ... Yes - if you do the whole job on the server - ... |it) and HTML (but there are some python packages that knows how to build ... again - centric thinking - I really would like to change the bits on the client, ...
    (comp.lang.python)
  • Re: Is there an obvious way to do this in python?
    ... |> I want to write a small system that is transaction based. ... |Any decent SQL DBMS is able to handle this. ... Yes - if you do the whole job on the server - the architecture I have mind is ... |it) and HTML (but there are some python packages that knows how to build ...
    (comp.lang.python)
  • Re: How to start a transaction?
    ... I know the basics of interacting with databases in Python. ... How to start a transaction in case I want to group a couple of insert ... If you use a Python DB-API compatible database module, ... Professional Python Services directly from the Source ...
    (comp.lang.python)
  • Re: Python for large projects
    ... If you're talking desktop line-of-business software ... of heavy math. ... If you're talking some sort of automatic transaction processing ... storing your results are going to be over head so I would really discount Python ...
    (comp.lang.python)
  • Re: Newbie - Help please with printing $_POST array
    ... Nothing personal but he does mention that in html 4.01 that numbers should not ... Kind Regards ... Since I essentially unroll the transaction in the foreach loop, *any* ids are deleted if they exist. ... Which works for you will depend on the data access characteristics to your database ...
    (comp.lang.php)