Thread view

This is my first week and I love Webware so far. (and
it is only Tuesday ;)
I really like what has been done with MiddleKit and it
is exactly what I was looking for in an obj-rel
mapping. I am so into it, that I am diving into it
first before FULLY exploring the WebKit.
I know that MK is in ALPHA (as I have already hit some
snags), I was just wondering what the status is of
this project and where it is going next. I am very
interested in helping out but I want to know where we
are and who else is actually USING this library.
Below are my particular problems if anyone is
interested.
Regards,
Ian Maurer
Python (and soon-to-be Webware) Geek
ian_maurer@...
MY PLATFORM:
Windows 2000
Python 2.1
MySQL 3.23.33
MY PROBLEMS:
1. The TEST case (test.py) did not work very well at
all. Tons of windows unhandled exception message boxes
and a python failure as well. Not sure if this was an
appropriate test but it looked right.
2. I created the Videos python file and ran the
generated SQL to create the DB. I then tried to run
the main.py and it crapped out.
3. I tried my own hand at it and it seemed to work
fine first run thru but whenever a .pyc file exists
then is seems to have problems finding the generated
attributes (not running init?):
python main.py
SQL 001. 2001-08-21 16:55:39 use Objects;
SQL 002. 2001-08-21 16:55:39 select id, name from
_MKClassIds;
Traceback (most recent call last):
File "main.py", line 25, in ?
main()
File "main.py", line 20, in main
store.saveChanges()
File "d:\webware\MiddleKit\Run\ObjectStore.py", line
84, in saveChanges
self.commitInserts()
File "d:\webware\MiddleKit\Run\SQLObjectStore.py",
line 93, in commitInserts
sql = object.sqlInsertStmt()
File "d:\webware\MiddleKit\Run\SQLObjectStore.py",
line 302, in sqlInsertStmt
values = [self.sqlValueForName(attr.name()) for
attr in attrs]
File "d:\webware\MiddleKit\Run\SQLObjectStore.py",
line 332, in sqlValueForName
value = self.valueForKey(name)
File "MiscUtils\NamedValueAccess.py", line 101, in
valueForKey
File "GeneratedPy\GenAddress.py", line 28, in
address1
return self._address1
AttributeError: Address instance has no attribute
'_address1'
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Ian Maurer <ian_maurer@...> wrote:
>
>I really like what has been done with MiddleKit and it
>is exactly what I was looking for in an obj-rel
>mapping. I am so into it, that I am diving into it
>first before FULLY exploring the WebKit.
Has anyone looked closely at PyDO? It's another object-relational mapping
package which seems to be fairly actively maintained:
http://skunkweb.sourceforge.net/pydo.html
I added SkunkWeb to my Web Modules Overview page, but I'm still convinced that
Webware has to be the best documented Web framework for Python yet.
Paul
--
Get your firstname@... email for FREE at http://Nameplanet.com/?su

Hi, does someone know the way of doing that "MiddleKit" works with a
remote (existing) database, using MSSQL?
The database already exists and the idea is to realize an application
in Webware in another PC that accedes to the above mentioned database
using MiddleKit.
Regards.

On 3/14/06, marcelo schiavone <marcelo.schiavone@...> wrote:
> Hi, does someone know the way of doing that "MiddleKit" works with a
> remote (existing) database, using MSSQL?
>
> The database already exists and the idea is to realize an application
> in Webware in another PC that accedes to the above mentioned database
> using MiddleKit.
Hi Marcelo,
I'm the main author of MiddleKit. When I wrote it, I did not need to
deal with existing databases so I designed it from the perspective of
working on new projects and having MiddleKit generate the tables in
the fashion that suited it. Later on I did need to deal with existing
tables and consequently I can share the following tips:
- You can dictate the SQL type of an attribute by setting it's SQLType
in the model. You would only need this if no MK type matched the MS
SQL types. For example, I have an MS SQL Server project where there
are a few SQLType=3D'image' in the MK model. You can put that in the
Extras column, or have a column called SQLType.
- If you don't want MK to generate SQL for a particular table, you can
mark it as isAbstract (usually in the Extras column).
But since MK isn't often used for existing databases, I don't know how
easy or hard it will be for you. I haven't thought much about obj refs
and lists for existing databases. At the very least, you'd have to
override those properties/methods in your class.
I think SQLObject may be more suited to existing dbs, so if MK doesn't
work for you, that's another option to consider.
-Chuck

marcelo schiavone wrote:
>Hi, does someone know the way of doing that "MiddleKit" works with a
>remote (existing) database, using MSSQL?
>
>The database already exists and the idea is to realize an application
>in Webware in another PC that accedes to the above mentioned database
>using MiddleKit.
>
>Regards.
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by xPML, a groundbreaking scripting language
>that extends applications into web and mobile media. Attend the live webcast
>and join the prime developer group breaking into this new coding territory!
>http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
>_______________________________________________
>Webware-discuss mailing list
>Webware-discuss@...
>https://lists.sourceforge.net/lists/listinfo/webware-discuss
>
>
>
SqlObject can auto create an SqlObject from an existing table. Never
tested it.
class MyTable(SQLObject):
class sqlmeta:
table='your_existing_table'
fromDatabase=True
then you simply play with your SQLObject...
It works just fine with webware.