AW: Re: "getObjProperty" in connection with Postgres
"Dr. Frank Hoffmann" <[email protected]> Wed, 3 Feb 2010 16:22:20 +0100
| Newsgroups | gmane.comp.cms.zms.devel |
|---|---|
| Message-ID | <B745C8FC9E384B13AB6DCBF222A63311@hal1> |
Hello, depending on your database connector you need a specific getEnties method presenting the real database model to the ER mapper. The ZMS programme folder \zms\conf\db\ provides examples for Oracle and Postgres. So add a new DTML method named "getEnties"+databaseconnectid with a customized DTML code; then the ER-mapper-GUI will work. Best Regards fh, moderator -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Im Auftrag von astrid.below Gesendet: Mittwoch, 3. Februar 2010 08:39 An: [email protected] Betreff: [zms-developers] Re: "getObjProperty" in connection with Postgres Hello, thanks for your hints: the displayCalender is under progress - step by step .. After install the latest patch from ZMS: ZMS2 2.11.41 to ZMS: ZMS2 2.12.1-12 (Build #132e) ZOPE: (Zope 2.10.9-final, python 2.4.3, linux2) PYTHON: 2.4.3 (#1, Jun 11 2009, 14:09:58) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] we have problems with the data-input in our calendar/: [1] Edit in ZMS a new data I got the following error: ... "/usr/lib/zope/lib/python/DocumentTemplate/DT_Util.py", line 196, in eval return eval(code, d) File "", line 0, in ? File "/usr/lib/zope/lib/python/Products/zms/zmssqldb.py", line 934, in recordSet_Insert sqlStatement.append( ' AND '.join(map( lambda x: x['id']+'='+x['value'], filter( lambda x: x['value'].upper()!='NULL', c)))) File "/usr/lib/zope/lib/python/Products/zms/zmssqldb.py", line 934, in sqlStatement.append( ' AND '.join(map( lambda x: x['id']+'='+x['value'], filter( lambda x: x['value'].upper()!='NULL', c)))) AttributeError: 'NoneType' object has no attribute 'upper' (02.02.10 20:39:17) Nevertheless the data is recorded in the DB and I can work with it. [2] The Configuration in the SQL-Database doesn't work: Parallel to the Folie 11 of the Charts_fh_ZMSSQLDB.pdf I have no opportunity to add anything [3] I guess therefore the construction doesn't work correct: The order of the records in the interface is not like this in the sqlmodel. Any hints for me? Best Regards Astrid --- In [email protected], "Dr. Frank Hoffmann" <fh@...> wrote: > > Hello, > 1. getObjProperty() gets language conformant an attribute value of a _ZMS_ > object > 2. usually you iterate through a database object an get a field name by > using it's name as a variable - without any function call. > > Hint-1: > If you have to rebuild a complex presentation layer like a calendar, it > might be efficient to recycle most of the existing code by adding a ZMSSQLDB > Object to the calender and modify the template vars/objects on which you are > iterating. These objects might a generated by a ZSQL method. > > Hint-2: > Here the ZMS concept of automatic GUI generation is explained > http://www.zms-publishing.com/news/06_09_sql_db/ > Here you will find all about Relational Database Connectivity > http://docs.zope.org/zope2/zope2book/RelationalDatabases.html > > Good luck > fh, moderator > ------------------------------------ Yahoo! Groups Links