modeling-cvs Mailing List for Object-Relational Bridge for python (Page 12)
Status: Abandoned
Brought to you by:
sbigaret
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(54) |
Apr
(29) |
May
(94) |
Jun
(47) |
Jul
(156) |
Aug
(132) |
Sep
(40) |
Oct
(6) |
Nov
(18) |
Dec
(24) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(18) |
Feb
(59) |
Mar
(7) |
Apr
|
May
(8) |
Jun
(2) |
Jul
(12) |
Aug
(15) |
Sep
(12) |
Oct
(6) |
Nov
(25) |
Dec
(1) |
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
(27) |
Mar
|
Apr
(16) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <sbi...@us...> - 2003-09-13 14:54:05
|
Update of /cvsroot/modeling/ProjectModeling
In directory sc8-pr-cvs1:/tmp/cvs-serv11661
Modified Files:
CHANGES setup.py
Log Message:
Release 0.9pre15
Index: CHANGES
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** CHANGES 13 Sep 2003 13:01:02 -0000 1.16
--- CHANGES 13 Sep 2003 14:54:02 -0000 1.17
***************
*** 3,10 ****
Module Modeling
---------------
! Current release is: 0.9-pre-14 / See also: TODO, INSTALL and doc/
* ** Distributed under the GNU General Public License **
--------------------------------------------------------
* Fixed bug #804756: EditingContext.insertObject() appeared to be really
--- 3,13 ----
Module Modeling
---------------
! Current release is: 0.9-pre-15 / See also: TODO, INSTALL and doc/
* ** Distributed under the GNU General Public License **
--------------------------------------------------------
+
+ 0.9-pre-15 (2003/09/13)
+ -----------------------
* Fixed bug #804756: EditingContext.insertObject() appeared to be really
Index: setup.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/setup.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** setup.py 31 Aug 2003 15:29:12 -0000 1.33
--- setup.py 13 Sep 2003 14:54:02 -0000 1.34
***************
*** 46,50 ****
setup(name="ModelingCore",
! version="0.9-pre-14",
licence ="GNU General Public License",
description=short_description,
--- 46,50 ----
setup(name="ModelingCore",
! version="0.9-pre-15",
licence ="GNU General Public License",
description=short_description,
|
|
From: <sbi...@us...> - 2003-09-13 14:39:35
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide
In directory sc8-pr-cvs1:/tmp/cvs-serv8762/Modeling/doc/UserGuide
Modified Files:
FrameworkTypicalUsage.tex
Added Files:
ZECS.png ZECS.eps
Log Message:
Added doc. for the new property bind_saveChanges_to_zope_transactions of the ZEditingContextSessioning product
--- NEW FILE: ZECS.png ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: ZECS.eps ---
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 68 102
%.....................................
%%Creator: GNU Ghostscript 510 (epswrite)
%%CreationDate: 2003/09/13 15:44:01
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%EndComments
%%BeginProlog
% This copyright applies to everything between here and the %%EndProlog:
% Copyright (C) 1997 Aladdin Enterprises, Menlo Park, CA. All rights reserved.
%%BeginResource: procset GS_pswrite_ProcSet
/GS_pswrite_ProcSet 40 dict dup begin
/!{bind def}bind def/X{load def}!
/rg/setrgbcolor X/g/setgray X/w/setlinewidth X/J/setlinecap X
/j/setlinejoin X/M/setmiterlimit X/d/setdash X/i/setflat X
/m/moveto X/l/lineto X/c/curveto X/h/closepath X
/lx{0 rlineto}!/ly{0 exch rlineto}!/v{currentpoint 6 2 roll c}!/y{2 copy c}!
/re{4 -2 roll m exch dup lx exch ly neg lx h}!
[...1686 lines suppressed...]
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!rr~>
Q
end showpage restore
%%PageTrailer
%%Trailer
%%Pages: 1
Index: FrameworkTypicalUsage.tex
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide/FrameworkTypicalUsage.tex,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** FrameworkTypicalUsage.tex 19 May 2003 16:05:16 -0000 1.6
--- FrameworkTypicalUsage.tex 13 Sep 2003 14:39:31 -0000 1.7
***************
*** 216,221 ****
--- 216,258 ----
\end{notice}
+ \subsection{Binding the default EC transactions to Zope transactions}
+
+ A special property has been added to the \class{ZEditingContextSessioning}
+ product which allows the transactions of a session's default
+ \class{EditingContext} to be bound to Zope's transactions. This means that
+ each time a Zope's transaction/request ends, \method{saveChanges()} is
+ automatically called on the session's \method{defaultEditingContext()}.
+ To enable this feature, go to \code{Control_Panel} \code{>Products}
+ \code{>ZEditingContextSessioning} \code{>Properties} and check the
+ \code{bind_saveChanges_to_zope_transactions} box --see fig.\ref{fig:enable-bind-ec-txn-to-zope-txn}.
+
+ %% Requires that graphicx.perl is changed so that we have:
+ %% $COPY_GRAPHICS = 1 unless defined($COPY_GRAPHICS);
+ \begin{figure}
+ \ifpdf \includegraphics[width=\textwidth]{./UserGuide/ZECS}
+ \else \htmladdimg{ZECS} %\includegraphics[width=10cm]{./UserGuide/ZECS}
+ \fi
+ \caption{Binding Zope txn to SESSION's defaultEC() txn}
+ \label{fig:enable-bind-ec-txn-to-zope-txn}
+ \end{figure}
+
+ %% \begin{figure}
+ %% \ifpdf
+ %% \includegraphics[width=\textwidth]{./UserGuide/ZECS}
+ %% \else
+ %% \begin{htmlonly} % HTML
+ %% \htmladdimg{ZECS}
+ %% \end{htmlonly}
+ %% \fi
+ %% %begin{latexonly}
+ %% \ifpdf% PDF
+ %% \else%LATEX/dvi
+ %% \fi
+ %% %end{latexonly}
+ %% \caption{Binding Zope txn to SESSION's defaultEC() txn}
+ %% \label{fig:enable-bind-ec-txn-to-zope-txn}
+ %% \end{figure}
%%
|
|
From: <sbi...@us...> - 2003-09-13 14:39:35
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc In directory sc8-pr-cvs1:/tmp/cvs-serv8762/Modeling/doc Modified Files: UserGuide.tex Log Message: Added doc. for the new property bind_saveChanges_to_zope_transactions of the ZEditingContextSessioning product Index: UserGuide.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide.tex,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** UserGuide.tex 31 Aug 2003 15:29:13 -0000 1.29 --- UserGuide.tex 13 Sep 2003 14:39:31 -0000 1.30 *************** *** 6,9 **** --- 6,19 ---- % by commenting out sections that you're not interested in. + % cf. http://cwrulug.cwru.edu/archive/cwrulug/200102/0155.html + \newif\ifpdf \ifx\pdfoutput\undefined \pdffalse \else \pdftrue \fi + \ifpdf \usepackage[pdftex]{graphicx} \else \usepackage{graphicx} \fi + \ifpdf {}\else\usepackage{html}\fi + + \ifpdf + \else + \usepackage{html} + \fi + \title{Modeling: User's Guide} %\subtitle{Object-relational bridge for python} |
|
From: <sbi...@us...> - 2003-09-13 13:05:24
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv23773 Modified Files: Oracle.cfg Log Message: misc / removed default password Index: Oracle.cfg =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/Oracle.cfg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Oracle.cfg 20 Aug 2003 20:45:16 -0000 1.1 --- Oracle.cfg 13 Sep 2003 13:05:05 -0000 1.2 *************** *** 8,12 **** database: oracle user: system ! password: manager host: ignored --- 8,12 ---- database: oracle user: system ! password: host: ignored |
|
From: <sbi...@us...> - 2003-09-13 13:01:05
|
Update of /cvsroot/modeling/ProjectModeling/Modeling
In directory sc8-pr-cvs1:/tmp/cvs-serv23010/Modeling
Modified Files:
GlobalID.py
Log Message:
Fixed bug #804756: EditingContext.insertObject() appeared to be really slow
when resolving dns entries is slow. Hence TemporaryGlobalID is now caching the
FQDN on a per-session basis.
Index: GlobalID.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/GlobalID.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** GlobalID.py 14 Mar 2003 11:40:08 -0000 1.7
--- GlobalID.py 13 Sep 2003 13:01:02 -0000 1.8
***************
*** 205,209 ****
lock=TemporaryGlobalIDIndex_lock.acquire
unlock=TemporaryGlobalIDIndex_lock.release
! def __nextTemporaryIndex__():
"This is part of the initialization process of TemporaryGlobalID"
lock()
--- 205,209 ----
lock=TemporaryGlobalIDIndex_lock.acquire
unlock=TemporaryGlobalIDIndex_lock.release
! def nextTemporaryIndex():
"This is part of the initialization process of TemporaryGlobalID"
lock()
***************
*** 230,240 ****
__implements__=(ITemporaryGlobalID,)
__is_temporary__=1
def __init__(self, *args, **kw):
"Initializes a new TemporaryGlobalID. Arguments are currently ignored."
! self.__dict__['_host']=socket.getfqdn()
! self.__dict__['_index']=__nextTemporaryIndex__()
! hostname, aliaslist, ipaddrlist=socket.gethostbyname_ex(self._host)
! self.__dict__['_ip']=self.nonLocalIPIfAvailable(ipaddrlist)
self.__dict__['_time']=time.strftime("%Y%m%d%H%M%S")
self.__dict__['_TemporaryGlobalID__hash']=hash("%s/%s/%s/%s"%(self._index,self._time, self._host,self._ip))
--- 230,244 ----
__implements__=(ITemporaryGlobalID,)
__is_temporary__=1
+
+ # We now cache the fqdn (_host) and ipaddrlist: when an host has problems
+ # resolving dns entries this can hang a few seconds, and
+ # EditingContext.insert() then appears to be really slow (bug #804756)
+ _host=socket.getfqdn()
+ _ipaddrlist=socket.gethostbyname_ex(_host)[2]
def __init__(self, *args, **kw):
"Initializes a new TemporaryGlobalID. Arguments are currently ignored."
! self.__dict__['_index']=nextTemporaryIndex()
! self.__dict__['_ip']=self.nonLocalIPIfAvailable(self._ipaddrlist)
self.__dict__['_time']=time.strftime("%Y%m%d%H%M%S")
self.__dict__['_TemporaryGlobalID__hash']=hash("%s/%s/%s/%s"%(self._index,self._time, self._host,self._ip))
|
|
From: <sbi...@us...> - 2003-09-13 13:01:05
|
Update of /cvsroot/modeling/ProjectModeling
In directory sc8-pr-cvs1:/tmp/cvs-serv23010
Modified Files:
CHANGES
Log Message:
Fixed bug #804756: EditingContext.insertObject() appeared to be really slow
when resolving dns entries is slow. Hence TemporaryGlobalID is now caching the
FQDN on a per-session basis.
Index: CHANGES
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** CHANGES 6 Sep 2003 11:48:05 -0000 1.15
--- CHANGES 13 Sep 2003 13:01:02 -0000 1.16
***************
*** 8,11 ****
--- 8,15 ----
--------------------------------------------------------
+ * Fixed bug #804756: EditingContext.insertObject() appeared to be really
+ slow when resolving dns entries is slow. Hence TemporaryGlobalID is now
+ caching the FQDN on a per-session basis.
+
* Generated python code: __init__() now takes a keyword argument **kw,
allowing new objects to be initialized with values. Ex: b=Book(title='t')
|
|
From: <sbi...@us...> - 2003-09-13 12:47:18
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage
In directory sc8-pr-cvs1:/tmp/cvs-serv19439/Modeling/doc/HomePage
Modified Files:
contributors.tex
Log Message:
Updated credits
Index: contributors.tex
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/contributors.tex,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** contributors.tex 18 Jul 2003 14:56:25 -0000 1.4
--- contributors.tex 13 Sep 2003 12:47:12 -0000 1.5
***************
*** 15,19 ****
\item Yannick Gingras from \begin{rawhtml}<a href="http://www.savoirfairelinux.com/">Savoir-faire Linux</A>\end{rawhtml}
\item Ernesto Revilla from \begin{rawhtml}<a href="http://www.sicem.biz/">SICEm</A>\end{rawhtml}
! \item Mario Ruggier
\end{itemize}
--- 15,20 ----
\item Yannick Gingras from \begin{rawhtml}<a href="http://www.savoirfairelinux.com/">Savoir-faire Linux</A>\end{rawhtml}
\item Ernesto Revilla from \begin{rawhtml}<a href="http://www.sicem.biz/">SICEm</A>\end{rawhtml}
! \item Mario Ruggier, who proposed and prototyped the PyModels, and never gave
! up insisting on their usefulness until they were added to the core!
\end{itemize}
|
|
From: <sbi...@us...> - 2003-09-13 12:41:22
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage
In directory sc8-pr-cvs1:/tmp/cvs-serv18097/doc/HomePage
Modified Files:
documentation.tex
Log Message:
misc. update
Index: documentation.tex
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/documentation.tex,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** documentation.tex 6 May 2003 13:52:01 -0000 1.4
--- documentation.tex 13 Sep 2003 12:41:19 -0000 1.5
***************
*** 32,36 ****
\item[Last changes]
! \begin{rawhtml}<a href="CHANGES">CHANGELOG</a>\end{rawhtml}
\item[\bf Developer's Guide] (forthcoming) , describing the core's internals
--- 32,36 ----
\item[Last changes]
! \begin{rawhtml}<a href="CHANGES">CHANGES</a>\end{rawhtml}
\item[\bf Developer's Guide] (forthcoming) , describing the core's internals
|
|
From: <sbi...@us...> - 2003-09-13 12:40:37
|
Update of /cvsroot/modeling/ZModeling
In directory sc8-pr-cvs1:/tmp/cvs-serv18002
Modified Files:
CHANGES
Log Message:
Updated
Index: CHANGES
===================================================================
RCS file: /cvsroot/modeling/ZModeling/CHANGES,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** CHANGES 7 Sep 2003 13:51:42 -0000 1.23
--- CHANGES 13 Sep 2003 12:40:32 -0000 1.24
***************
*** 17,21 ****
* ZEditingContextSessioning: SESSION's defaultEditingContext() can now
automatically saveChanges() when a zope request/transaction ends: see
! README.
0.9-pre-10 (2003/07/18)
--- 17,21 ----
* ZEditingContextSessioning: SESSION's defaultEditingContext() can now
automatically saveChanges() when a zope request/transaction ends: see
! ZEditingContextSessioning/README.
0.9-pre-10 (2003/07/18)
|
|
From: <sbi...@us...> - 2003-09-07 14:04:56
|
Update of /cvsroot/modeling/ZModeling/ZModelizationTool
In directory sc8-pr-cvs1:/tmp/cvs-serv8712/ZModelizationTool
Modified Files:
README __init__.py
Log Message:
Updated security warning message
Index: README
===================================================================
RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/README,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** README 7 Sep 2003 13:51:43 -0000 1.2
--- README 7 Sep 2003 14:04:52 -0000 1.3
***************
*** 26,30 ****
environment may be a security hole.
! Moreover, you probably do not want to leave a product in a production
! environment which may have the ability to drop and recreate a database, for
! example.
--- 26,30 ----
environment may be a security hole.
! Moreover, you probably do not want to leave in a production
! environment a product whose instances may have the ability to drop and
! recreate a database, for example.
Index: __init__.py
===================================================================
RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/__init__.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** __init__.py 7 Sep 2003 13:51:43 -0000 1.3
--- __init__.py 7 Sep 2003 14:04:53 -0000 1.4
***************
*** 30,34 ****
def initialize(context):
! warning="Please do not leave the ZModelizationTool product in a production environment, especially now that it can load PyModel: PyModels are evaluated through an exec statement, hence leaving this product in a production environment may be a security hole\n"
zLOG.LOG('ZModelizationTool', zLOG.WARNING, 'Reminder: Security Warning', warning)
context.registerClass(
--- 30,34 ----
def initialize(context):
! warning="Please do not leave the ZModelizationTool product in a production environment, especially now that it can load PyModel: PyModels are evaluated through an exec statement, hence leaving this product in a production environment may be a security hole. Another reason is that you probably do not want to leave in a production environment a product whose instances may have the ability to drop and recreate a database, for example.\n"
zLOG.LOG('ZModelizationTool', zLOG.WARNING, 'Reminder: Security Warning', warning)
context.registerClass(
|
|
From: <sbi...@us...> - 2003-09-07 14:04:56
|
Update of /cvsroot/modeling/ZModeling/ZModelizationTool/dtml
In directory sc8-pr-cvs1:/tmp/cvs-serv8712/ZModelizationTool/dtml
Modified Files:
ZModelizationTool_addForm.dtml explainModelizationTool.dtml
Log Message:
Updated security warning message
Index: ZModelizationTool_addForm.dtml
===================================================================
RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/dtml/ZModelizationTool_addForm.dtml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ZModelizationTool_addForm.dtml 7 Sep 2003 13:51:43 -0000 1.2
--- ZModelizationTool_addForm.dtml 7 Sep 2003 14:04:53 -0000 1.3
***************
*** 12,15 ****
--- 12,19 ----
this can be correctly handled, please
<a href="mailto:sbi...@us...">contact the maintainer</a>).
+
+ Another reason is that you probably do not want to leave in a
+ production environment a product whose instances may have the ability to
+ drop and recreate a database, for example.
</td></tr></table>
Index: explainModelizationTool.dtml
===================================================================
RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/dtml/explainModelizationTool.dtml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** explainModelizationTool.dtml 7 Sep 2003 13:51:43 -0000 1.2
--- explainModelizationTool.dtml 7 Sep 2003 14:04:53 -0000 1.3
***************
*** 16,19 ****
--- 16,23 ----
this can be correctly handled, please
<a href="mailto:sbi...@us...">contact the maintainer</a>).
+
+ Another reason is that you probably do not want to leave in a
+ production environment a product whose instances may have the ability to
+ drop and recreate a database, for example.
</td></tr></table>
|
|
From: <sbi...@us...> - 2003-09-07 13:51:47
|
Update of /cvsroot/modeling/ZModeling/ZModelizationTool/dtml
In directory sc8-pr-cvs1:/tmp/cvs-serv2635/ZModelizationTool/dtml
Modified Files:
ZModelizationTool_addForm.dtml explainModelizationTool.dtml
model_properties.dtml
Log Message:
ZModelizationTool:
- model's props page update: Oracle supported in core.
- Added the ability to load PyModels
- Removed the useless contraints on the 'id' which formerly should be
equal to 'modelization_tool'
- Added a security warning: the ZModelizationTool product may be
dangerous in a production environment.
Index: ZModelizationTool_addForm.dtml
===================================================================
RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/dtml/ZModelizationTool_addForm.dtml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** ZModelizationTool_addForm.dtml 30 Jul 2002 15:35:02 -0000 1.1.1.1
--- ZModelizationTool_addForm.dtml 7 Sep 2003 13:51:43 -0000 1.2
***************
*** 3,10 ****
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<H2>Add Modeling Tool</H2>
<form action="manage_addZModelizationTool"><table>
<tr><th>Id</th>
! <td><input type=hidden name=id value="modelization_tool">
! <code>modelization_tool</code>
</td>
</tr>
--- 3,20 ----
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<H2>Add Modeling Tool</H2>
+ <p><table><tr>
+ <td><font color="FF0000">Security Warning!</font></td>
+ <td>
+ Please do not leave the <tt>ZModelizationTool</tt> product in a
+ production environment, especially now that it can load PyModel: PyModels
+ are evaluated through an <tt>exec</tt> statement, hence leaving the product
+ in a production environment may be a security hole (if you have ideas on how
+ this can be correctly handled, please
+ <a href="mailto:sbi...@us...">contact the maintainer</a>).
+ </td></tr></table>
+
<form action="manage_addZModelizationTool"><table>
<tr><th>Id</th>
! <td><input type=text name=id value="modelization_tool">
</td>
</tr>
Index: explainModelizationTool.dtml
===================================================================
RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/dtml/explainModelizationTool.dtml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** explainModelizationTool.dtml 30 Jul 2002 15:35:02 -0000 1.1.1.1
--- explainModelizationTool.dtml 7 Sep 2003 13:51:43 -0000 1.2
***************
*** 7,10 ****
--- 7,21 ----
</p>
+ <p><table><tr>
+ <td><font color="FF0000">Security Warning!</font></td>
+ <td>
+ Please do not leave the <tt>ZModelizationTool</tt> product in a
+ production environment, especially now that it can load PyModel: PyModels
+ are evaluated through an <tt>exec</tt> statement, hence leaving the product
+ in a production environment may be a security hole (if you have ideas on how
+ this can be correctly handled, please
+ <a href="mailto:sbi...@us...">contact the maintainer</a>).
+ </td></tr></table>
+
<hr>
<h3>Managed Models</h3>
***************
*** 41,49 ****
<td align=center valign=top>
! <h3>Import a model from XML</h3>
<form action="manage_importModel" method="post" enctype="multipart/form-data">
<input type="file" name="file" size="25" value="" /><br>
<input type="submit" value="Import">
</form>
</td>
</tr>
--- 52,62 ----
<td align=center valign=top>
! <h3>Import a xml-model or a PyModel</h3>
<form action="manage_importModel" method="post" enctype="multipart/form-data">
<input type="file" name="file" size="25" value="" /><br>
<input type="submit" value="Import">
</form>
+ <b>Note:</b> to be successfully imported a pymodel should define a global
+ variable <tt>model</tt> containing the PyModel.
</td>
</tr>
Index: model_properties.dtml
===================================================================
RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/dtml/model_properties.dtml,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** model_properties.dtml 12 Jun 2003 00:28:25 -0000 1.10
--- model_properties.dtml 7 Sep 2003 13:51:43 -0000 1.11
***************
*** 22,26 ****
<th align="left">adaptorName</th>
<td><input type="text" name="adaptorName" value="&dtml-adaptorName;"/></td>
! <td align="left"><font size="-1">Currently supported: Postgresql, MySQL, SQLite (exact typo!!)</font></td>
</tr>
<tr>
--- 22,26 ----
<th align="left">adaptorName</th>
<td><input type="text" name="adaptorName" value="&dtml-adaptorName;"/></td>
! <td align="left"><font size="-1">Currently supported: MySQL, Oracle, Postgresql, SQLite (exact typo!!)</font></td>
</tr>
<tr>
|
|
From: <sbi...@us...> - 2003-09-07 13:51:47
|
Update of /cvsroot/modeling/ZModeling/ZModelizationTool
In directory sc8-pr-cvs1:/tmp/cvs-serv2635/ZModelizationTool
Modified Files:
ZModelizationTool.py __init__.py README
Log Message:
ZModelizationTool:
- model's props page update: Oracle supported in core.
- Added the ability to load PyModels
- Removed the useless contraints on the 'id' which formerly should be
equal to 'modelization_tool'
- Added a security warning: the ZModelizationTool product may be
dangerous in a production environment.
Index: ZModelizationTool.py
===================================================================
RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/ZModelizationTool.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ZModelizationTool.py 27 May 2003 19:49:17 -0000 1.13
--- ZModelizationTool.py 7 Sep 2003 13:51:42 -0000 1.14
***************
*** 111,116 ****
# Initialization
def __init__(self, id):
- if id!='modelization_tool':
- raise ValueError, 'id must be equal to modelization_tool'
self.id = id
ModelSet.__init__.im_func(self)
--- 111,114 ----
***************
*** 180,185 ****
def manage_importModel(self, file, REQUEST=None):
! "..."
! model=self.addModelFromXML({'string':file.read()})
model._p_changed=1
self._p_changed=1
--- 178,195 ----
def manage_importModel(self, file, REQUEST=None):
! "Imports a xml-model or a pymodel"
! if file.filename[-4:]=='.xml':
! model=self.addModelFromXML({'string':file.read()})
! else:
! # PyModel
! _code=file.read()
! local={'zmt_model':None}
! exec(_code+'''
! try: model.build()
! except RuntimeError: pass
! except NameError: raise NameError, "Import failed: the pymodel.py should store the PyModel in the variable \'model\'"
! zmt_model=model.component''') in {},local
! model=local['zmt_model']
! self.addModel(model)
model._p_changed=1
self._p_changed=1
Index: __init__.py
===================================================================
RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/__init__.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** __init__.py 10 Jan 2003 10:45:45 -0000 1.2
--- __init__.py 7 Sep 2003 13:51:43 -0000 1.3
***************
*** 27,33 ****
import ZModelizationTool
def initialize(context):
!
context.registerClass(
ZModelizationTool.ZModelizationTool,
--- 27,35 ----
import ZModelizationTool
+ import zLOG
def initialize(context):
! warning="Please do not leave the ZModelizationTool product in a production environment, especially now that it can load PyModel: PyModels are evaluated through an exec statement, hence leaving this product in a production environment may be a security hole\n"
! zLOG.LOG('ZModelizationTool', zLOG.WARNING, 'Reminder: Security Warning', warning)
context.registerClass(
ZModelizationTool.ZModelizationTool,
Index: README
===================================================================
RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/README,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** README 6 May 2003 16:29:48 -0000 1.1
--- README 7 Sep 2003 13:51:43 -0000 1.2
***************
*** 16,17 ****
--- 16,30 ----
The current documentation can be found in the User's Guide:
http://modeling.sourceforge.net/UserGuide/define-model.html
+
+
+ Security Warning
+ ----------------
+
+ Please do not leave the ZModelizationTool product in a production
+ environment, especially now that it can load PyModel: PyModels are evaluated
+ through an exec statement, hence leaving this product in a production
+ environment may be a security hole.
+
+ Moreover, you probably do not want to leave a product in a production
+ environment which may have the ability to drop and recreate a database, for
+ example.
|
|
From: <sbi...@us...> - 2003-09-07 13:51:45
|
Update of /cvsroot/modeling/ZModeling
In directory sc8-pr-cvs1:/tmp/cvs-serv2635
Modified Files:
CHANGES
Log Message:
ZModelizationTool:
- model's props page update: Oracle supported in core.
- Added the ability to load PyModels
- Removed the useless contraints on the 'id' which formerly should be
equal to 'modelization_tool'
- Added a security warning: the ZModelizationTool product may be
dangerous in a production environment.
Index: CHANGES
===================================================================
RCS file: /cvsroot/modeling/ZModeling/CHANGES,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** CHANGES 7 Sep 2003 11:03:51 -0000 1.22
--- CHANGES 7 Sep 2003 13:51:42 -0000 1.23
***************
*** 3,6 ****
--- 3,18 ----
Current release is: 0.9-pre-10
+ * ZModelizationTool:
+
+ - model's props page update: Oracle supported in core.
+
+ - Added the ability to load PyModels
+
+ - Removed the useless contraints on the 'id' which formerly should be
+ equal to 'modelization_tool'
+
+ - Added a security warning: the ZModelizationTool product may be
+ dangerous in a production environment.
+
* ZEditingContextSessioning: SESSION's defaultEditingContext() can now
automatically saveChanges() when a zope request/transaction ends: see
|
|
From: <sbi...@us...> - 2003-09-07 11:03:55
|
Update of /cvsroot/modeling/ZModeling In directory sc8-pr-cvs1:/tmp/cvs-serv8321 Modified Files: CHANGES Log Message: SESSION's defaultEditingContext() can now automatically saveChanges() when a zope request/transaction ends: see README Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ZModeling/CHANGES,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** CHANGES 18 Jul 2003 15:13:54 -0000 1.21 --- CHANGES 7 Sep 2003 11:03:51 -0000 1.22 *************** *** 3,6 **** --- 3,10 ---- Current release is: 0.9-pre-10 + * ZEditingContextSessioning: SESSION's defaultEditingContext() can now + automatically saveChanges() when a zope request/transaction ends: see + README. + 0.9-pre-10 (2003/07/18) ----------------------- |
|
From: <sbi...@us...> - 2003-09-07 11:03:34
|
Update of /cvsroot/modeling/ZModeling/ZEditingContextSessioning In directory sc8-pr-cvs1:/tmp/cvs-serv8276 Modified Files: README.txt __init__.py Log Message: SESSION's defaultEditingContext() can now automatically saveChanges() when a zope request/transaction ends: see README Index: README.txt =================================================================== RCS file: /cvsroot/modeling/ZModeling/ZEditingContextSessioning/README.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README.txt 6 May 2003 16:29:48 -0000 1.2 --- README.txt 7 Sep 2003 11:03:30 -0000 1.3 *************** *** 1,21 **** ! The ZEditingContextSessioning product adds a new method to Zope session ! objects: defaultEditingContext(), which delivers a specific EditingContext in ! each session. ! Creation, registration and deletion of a session's EC are managed ! Modeling.utilities.EditingContextSessioning. The unregistration and ! destruction of a session's EC is triggered by the session destruction --hence, ! there can be some time between the moment where the session expires and the ! actual unregistration/destruction of its EC. Installation - ------------ ! Simply drop ZEditingContextSessioning/ into a Zope's Products/ directory and ! restart zope. Documentation - ------------- ! The current documentation can be found in the User's Guide at: ! http://modeling.sourceforge.net/UserGuide/framework-integration-hints.html --- 1,32 ---- ! Overview ! The 'ZEditingContextSessioning' product adds a new method to Zope session ! objects: 'defaultEditingContext()', which delivers a specific ! 'EditingContext' in each session. ! ! 'EditingContext' 's and Zope's transactions ! ! By default, the delivered 'EditingContext' does not commit its transaction ! when Zope does. If you want that the session's 'EditingContext' ! 'saveChanges()' each time a zope request ends, click on the "Properties ! tab":manage_propertiesForm and check the box for property ! 'bind_saveChanges_to_zope_transactions' (then click on "Save Changes") ! ! Internals ! ! Creation, registration and deletion of a session's EC are managed ! 'Modeling.utilities.EditingContextSessioning'. The unregistration and ! destruction of a session's EC is triggered by the session destruction ! --hence, there can be some time between the moment where the session ! expires and the actual unregistration/destruction of its EC. Installation ! Simply drop 'ZEditingContextSessioning/' into a Zope's Products/ directory ! and restart zope. Documentation ! The current documentation can be found in the "User's ! Guide":http://modeling.sourceforge.net/UserGuide/framework-integration-hints.html. ! Index: __init__.py =================================================================== RCS file: /cvsroot/modeling/ZModeling/ZEditingContextSessioning/__init__.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** __init__.py 22 Apr 2003 09:36:50 -0000 1.3 --- __init__.py 7 Sep 2003 11:03:30 -0000 1.4 *************** *** 37,40 **** --- 37,62 ---- import zLOG + from Shared.DC.ZRDB.TM import TM + class ECProxy(TM): + def __init__(self, ec): + self.ec=ec + self._register() + + def _abort(self): + pass + + def _finish(self): + self.ec.lock() + self.ec.saveChanges() + self.ec.unlock() + + def _begin(self): + pass + + def __getattr__(self, n): + if hasattr(self.ec, n): + return getattr(self.ec, n) + raise ValueError + ## Implementation note: ## session.token was formerly used instead of session.id *************** *** 65,71 **** Returns the EditingContext bound to 'session' """ ! return EditingContextSessioning.getEditingContext(session.id) ! ! def initialize(context): """ --- 87,96 ---- Returns the EditingContext bound to 'session' """ ! product=session.Control_Panel.Products.ZEditingContextSessioning ! if product.bind_saveChanges_to_zope_transactions: ! return ECProxy(EditingContextSessioning.getEditingContext(session.id)) ! else: ! return EditingContextSessioning.getEditingContext(session.id) ! def initialize(context): """ *************** *** 94,97 **** --- 119,129 ---- sessionDataContainer.setDelNotificationTarget('/Control_Panel/Products/ZEditingContextSessioning/sessionDeletion_hook') + product=app.Control_Panel.Products.ZEditingContextSessioning + + bind_to_zope_txn='bind_saveChanges_to_zope_transactions' + if bind_to_zope_txn not in [p['id'] for p in product._properties]: + product.manage_addProperty(id=bind_to_zope_txn, + type='boolean', value=0) + # ?? Why did I need this? #context._ProductContext__prod.sessionDeletion_hook=sessionDeletion_hook |
|
From: <sbi...@us...> - 2003-09-06 11:56:12
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage
In directory sc8-pr-cvs1:/tmp/cvs-serv31240/Modeling/doc/HomePage
Modified Files:
quick_overview.tex
Log Message:
Updated: generated __init__ handles kw args
Index: quick_overview.tex
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/quick_overview.tex,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** quick_overview.tex 1 Sep 2003 21:15:51 -0000 1.1
--- quick_overview.tex 6 Sep 2003 11:56:08 -0000 1.2
***************
*** 87,90 ****
--- 87,93 ----
\item[Generate the corresponding database schema]
Either get the coresponding sql statements:
+ \begin{verbatim}
+ shell> mdl_generate_DB_schema.py -c -A sample_pymodel.py
+ \end{verbatim}
%\begin{verbatim}
%shell> mdl_generate_DB_schema.py -c -A sample_pymodel.py
***************
*** 153,169 ****
%
%>>> # create objects
! %... john=Person()
! %>>> john.setLastName('Cleese'); john.setFirstName('John')
%>>> ec.insert(john)
! %>>> jeanne=Person()
! %>>> jeanne.setLastName('Cleese'); jeanne.setFirstName('Jeanne')
%>>> ec.insert(jeanne)
%
%>>> # create relationships
! %... a_john=Address(); a_john.setTown('London')
%>>> ec.insert(a_john)
%>>> john.addToAddresses(a_john); a_john.setPerson(john)
%>>>
! %>>> a_jeanne=Address(); a_jeanne.setTown('Paris'); ec.insert(a_jeanne)
%>>> jeanne.addToAddresses(a_jeanne); a_jeanne.setPerson(jeanne)
%
--- 156,171 ----
%
%>>> # create objects
! %... john=Person(firstName='John', lastName='Cleese')
%>>> ec.insert(john)
! %>>> jeanne=Person(firstName='Jeanne', lastName='Cleese')
%>>> ec.insert(jeanne)
%
%>>> # create relationships
! %... a_john=Address(town='London')
%>>> ec.insert(a_john)
%>>> john.addToAddresses(a_john); a_john.setPerson(john)
%>>>
! %>>> a_jeanne=Address(town='Paris')
! %>>> ec.insert(a_jeanne)
%>>> jeanne.addToAddresses(a_jeanne); a_jeanne.setPerson(jeanne)
%
***************
*** 184,200 ****
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#444444"># create objects</font>
! ... <font color="#2040a0">john</font><font color="4444FF">=</font><font color="#2040a0">Person</font><font color="4444FF">(</font><font color="4444FF">)</font>
! <font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">john</font>.<font color="#2040a0">setLastName</font><font color="4444FF">(</font><font color="#008000">'Cleese'</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">john</font>.<font color="#2040a0">setFirstName</font><font color="4444FF">(</font><font color="#008000">'John'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">john</font><font color="4444FF">)</font>
! <font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">jeanne</font><font color="4444FF">=</font><font color="#2040a0">Person</font><font color="4444FF">(</font><font color="4444FF">)</font>
! <font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">jeanne</font>.<font color="#2040a0">setLastName</font><font color="4444FF">(</font><font color="#008000">'Cleese'</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">jeanne</font>.<font color="#2040a0">setFirstName</font><font color="4444FF">(</font><font color="#008000">'Jeanne'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">jeanne</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#444444"># create relationships</font>
! ... <font color="#2040a0">a_john</font><font color="4444FF">=</font><font color="#2040a0">Address</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">a_john</font>.<font color="#2040a0">setTown</font><font color="4444FF">(</font><font color="#008000">'London'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">a_john</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">john</font>.<font color="#2040a0">addToAddresses</font><font color="4444FF">(</font><font color="#2040a0">a_john</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">a_john</font>.<font color="#2040a0">setPerson</font><font color="4444FF">(</font><font color="#2040a0">john</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font>
! <font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">a_jeanne</font><font color="4444FF">=</font><font color="#2040a0">Address</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">a_jeanne</font>.<font color="#2040a0">setTown</font><font color="4444FF">(</font><font color="#008000">'Paris'</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">a_jeanne</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">jeanne</font>.<font color="#2040a0">addToAddresses</font><font color="4444FF">(</font><font color="#2040a0">a_jeanne</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">a_jeanne</font>.<font color="#2040a0">setPerson</font><font color="4444FF">(</font><font color="#2040a0">jeanne</font><font color="4444FF">)</font>
--- 186,201 ----
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#444444"># create objects</font>
! ... <font color="#2040a0">john</font><font color="4444FF">=</font><font color="#2040a0">Person</font><font color="4444FF">(</font><font color="#2040a0">firstName</font><font color="4444FF">=</font><font color="#008000">'John'</font>, <font color="#2040a0">lastName</font><font color="4444FF">=</font><font color="#008000">'Cleese'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">john</font><font color="4444FF">)</font>
! <font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">jeanne</font><font color="4444FF">=</font><font color="#2040a0">Person</font><font color="4444FF">(</font><font color="#2040a0">firstName</font><font color="4444FF">=</font><font color="#008000">'Jeanne'</font>, <font color="#2040a0">lastName</font><font color="4444FF">=</font><font color="#008000">'Cleese'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">jeanne</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#444444"># create relationships</font>
! ... <font color="#2040a0">a_john</font><font color="4444FF">=</font><font color="#2040a0">Address</font><font color="4444FF">(</font><font color="#2040a0">town</font><font color="4444FF">=</font><font color="#008000">'London'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">a_john</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">john</font>.<font color="#2040a0">addToAddresses</font><font color="4444FF">(</font><font color="#2040a0">a_john</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">a_john</font>.<font color="#2040a0">setPerson</font><font color="4444FF">(</font><font color="#2040a0">john</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font>
! <font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">a_jeanne</font><font color="4444FF">=</font><font color="#2040a0">Address</font><font color="4444FF">(</font><font color="#2040a0">town</font><font color="4444FF">=</font><font color="#008000">'Paris'</font><font color="4444FF">)</font>
! <font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">a_jeanne</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">jeanne</font>.<font color="#2040a0">addToAddresses</font><font color="4444FF">(</font><font color="#2040a0">a_jeanne</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">a_jeanne</font>.<font color="#2040a0">setPerson</font><font color="4444FF">(</font><font color="#2040a0">jeanne</font><font color="4444FF">)</font>
***************
*** 205,209 ****
... <font color="#2040a0">in_london</font><font color="4444FF">=</font><font color="#2040a0">ec</font>.<font color="#2040a0">fetch</font><font color="4444FF">(</font><font color="#008000">'Person'</font>, <font color="#008000">'addresses.town ilike "*london*"'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="4444FF">[</font><font color="4444FF">(</font><font color="#2040a0">p</font>.<font color="#2040a0">getLastName</font><font color="4444FF">(</font><font color="4444FF">)</font>, <font color="#2040a0">p</font>.<font color="#2040a0">getFirstName</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">)</font> <strong>for</strong> <font color="#2040a0">p</font> <strong>in</strong> <font color="#2040a0">in_london</font><font color="4444FF">]</font>
- <font color="4444FF">[</font><font color="4444FF">(</font><font color="#008000">'Cleese'</font>, <font color="#008000">'John'</font><font color="4444FF">)</font><font color="4444FF">]</font>
</pre>
--- 206,209 ----
|
|
From: <sbi...@us...> - 2003-09-06 11:48:09
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/ModelMasons/Python_bricks
In directory sc8-pr-cvs1:/tmp/cvs-serv30067/Modeling/ModelMasons/Python_bricks
Modified Files:
module_base.tmpl module_compact.tmpl
Log Message:
Generated python code: __init__() now takes a keyword argument **kw,
allowing new objects to be initialized with values. Ex: b=Book(title='t')
Index: module_base.tmpl
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelMasons/Python_bricks/module_base.tmpl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** module_base.tmpl 3 Aug 2003 13:58:55 -0000 1.4
--- module_base.tmpl 6 Sep 2003 11:48:05 -0000 1.5
***************
*** 21,25 ****
"""
! def __init__(self):
"Initializer"
# Note: if you modify this method, it is a strong requirement that
--- 21,25 ----
"""
! def __init__(self, **kw):
"Initializer"
# Note: if you modify this method, it is a strong requirement that
***************
*** 27,30 ****
--- 27,32 ----
# able to instanciate an object with no parameter at all.
$(base_dir).$(module_name).$(class_name).__init__(self)
+ for k,v in kw.items():
+ self.takeValueForKey(v, k)
#for attr in $entity_props:
Index: module_compact.tmpl
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelMasons/Python_bricks/module_compact.tmpl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** module_compact.tmpl 3 Aug 2003 13:58:10 -0000 1.2
--- module_compact.tmpl 6 Sep 2003 11:48:05 -0000 1.3
***************
*** 35,39 ****
#end unless
! def __init__(self):
"Initializer"
# Note: if you modify this method, it is a strong requirement that
--- 35,39 ----
#end unless
! def __init__(self, **kw):
"Initializer"
# Note: if you modify this method, it is a strong requirement that
***************
*** 61,65 ****
#end if
#end for
!
def entityName(self):
"Used by the framework to link this object to its entity"
--- 61,67 ----
#end if
#end for
! for k,v in kw.items():
! self.takeValueForKey(v, k)
!
def entityName(self):
"Used by the framework to link this object to its entity"
|
|
From: <sbi...@us...> - 2003-09-06 11:48:08
|
Update of /cvsroot/modeling/ProjectModeling
In directory sc8-pr-cvs1:/tmp/cvs-serv30067
Modified Files:
CHANGES
Log Message:
Generated python code: __init__() now takes a keyword argument **kw,
allowing new objects to be initialized with values. Ex: b=Book(title='t')
Index: CHANGES
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** CHANGES 31 Aug 2003 17:32:25 -0000 1.14
--- CHANGES 6 Sep 2003 11:48:05 -0000 1.15
***************
*** 8,11 ****
--- 8,14 ----
--------------------------------------------------------
+ * Generated python code: __init__() now takes a keyword argument **kw,
+ allowing new objects to be initialized with values. Ex: b=Book(title='t')
+
0.9-pre-14 (2003/08/31)
-----------------------
|
|
From: <sbi...@us...> - 2003-09-01 21:16:48
|
Update of /cvsroot/modeling/ProjectModeling
In directory sc8-pr-cvs1:/tmp/cvs-serv3190
Modified Files:
vertoo.config
Log Message:
new format for vertoo.config, continued: now uses addAnchors()
Index: vertoo.config
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/vertoo.config,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** vertoo.config 31 Aug 2003 15:26:56 -0000 1.4
--- vertoo.config 1 Sep 2003 21:16:34 -0000 1.5
***************
*** 16,21 ****
mdl_code=addModule('mdl-code')
#mdl_code.setVersionFormat('@public', 'major.minor')
! mdl_code.addAnchor("setup.py",
! arguments(pattern="version=%Q", format='@full'))
mdl_doc=addModule('mdl_doc')
--- 16,21 ----
mdl_code=addModule('mdl-code')
#mdl_code.setVersionFormat('@public', 'major.minor')
! mdl_code.addAnchors("setup.py",
! arguments(pattern="version=%Q", format='@full'))
mdl_doc=addModule('mdl_doc')
***************
*** 24,50 ****
arguments(pattern="is: %v", format='@full'))
## UserGuide
! mdl_doc.addAnchor("Modeling/doc/UserGuide.tex",
! arguments(pattern=r"\release{%v}", format='@full'))
! mdl_doc.addAnchor("Modeling/doc/UserGuide.tex",
! arguments(pattern=r"\setshortversion{%v}",
! format='@short_pre'))
! mdl_doc.addAnchor("Modeling/doc/UserGuide.tex",
! arguments(pattern=r"\date{%v}", format='@date'))
## main.tex
! mdl_doc.addAnchor("Modeling/doc/HomePage/main.tex",
! arguments(pattern=r"\release{%v}", format='@full'))
! mdl_doc.addAnchor("Modeling/doc/HomePage/main.tex",
! arguments(pattern=r"\setshortversion{%v}",
! format='@short_pre'))
! mdl_doc.addAnchor("Modeling/doc/HomePage/main.tex",
! arguments(pattern=r"\date{%v}", format='@date'))
## Tutorial.tex
! mdl_doc.addAnchor("Modeling/doc/Tutorial.tex",
! arguments(pattern=r"\release{%v}", format='@full'))
! mdl_doc.addAnchor("Modeling/doc/Tutorial.tex",
! arguments(pattern=r"\setshortversion{%v}",
! format='@short_pre'))
! mdl_doc.addAnchor("Modeling/doc/Tutorial.tex",
! arguments(pattern=r"\date{%v}", format='@date'))
## downloads.tex
--- 24,44 ----
arguments(pattern="is: %v", format='@full'))
## UserGuide
! mdl_doc.addAnchors("Modeling/doc/UserGuide.tex",
! arguments(pattern=r"\release{%v}", format='@full'),
! arguments(pattern=r"\setshortversion{%v}",
! format='@short_pre'),
! arguments(pattern=r"\date{%v}", format='@date'))
## main.tex
! mdl_doc.addAnchors("Modeling/doc/HomePage/main.tex",
! arguments(pattern=r"\release{%v}", format='@full'),
! arguments(pattern=r"\setshortversion{%v}",
! format='@short_pre'),
! arguments(pattern=r"\date{%v}", format='@date'))
## Tutorial.tex
! mdl_doc.addAnchors("Modeling/doc/Tutorial.tex",
! arguments(pattern=r"\release{%v}", format='@full'),
! arguments(pattern=r"\setshortversion{%v}",
! format='@short_pre'),
! arguments(pattern=r"\date{%v}", format='@date'))
## downloads.tex
***************
*** 52,57 ****
arguments(pattern="Current version: %v", format='@full'))
-
- #modules = [MDL_code, MDL_doc]
# vim:set ft=python fdm=manual:
--- 46,49 ----
|
|
From: <sbi...@us...> - 2003-09-01 21:15:55
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage
In directory sc8-pr-cvs1:/tmp/cvs-serv3083/Modeling/doc/HomePage
Added Files:
quick_overview.tex
Log Message:
Added page quick overview
--- NEW FILE: quick_overview.tex ---
\documentclass{article}
\title{A very quick overview}
%\author{S\'ebastien Bigaret}
%\authoraddress{Email: \email{sbi...@us...}}
%\date{\today}
\begin{document}
\input{www/menu-inline-begin}
\maketitle
\begin{description}
\item[Design your model]
Write {\tt sample_pymodel.py}:
%\begin{verbatim}
%#! /usr/bin/env python
%from Modeling.PyModel import *
%
%# Defaults
%AString.defaults['width'] = 40
%
%Entity.defaults['properties'] = [
% APrimaryKey('id', isClassProperty=0, isRequired=1, doc='PK')
%]
%##
%_connDict = {'database': 'SampleDB', 'host': 'localhost',
% 'user': 'postgres', 'password': ''}
%model = Model('Sample',adaptorName='Postgresql', connDict=_connDict)
%model.version='0.1'
%model.entities = [
% Entity('Person',
% properties=[ AString('firstName'),
% AString('lastName',isRequired=1)] ),
% Entity('Address',
% properties=[ AString('street'),
% AString('zipCode', width=10),
% AString('town', isRequired=1) ], ),
% ]
%#---
%model.associations=[
% Association('Address','Person',
% relations=['person','addresses'],
% delete=['nullify','deny'] ),
% ]
%\end{verbatim}
\begin{rawhtml}
<pre>
<font color="#444444">#! /usr/bin/env python</font>
<strong>from</strong> <font color="#2040a0">Modeling</font>.<font color="#2040a0">PyModel</font> <strong>import</strong> <font color="4444FF">*</font>
<font color="#444444"># Defaults</font>
<font color="#2040a0">AString</font>.<font color="#2040a0">defaults</font><font color="4444FF">[</font><font color="#008000">'width'</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">40</font>
<font color="#2040a0">Entity</font>.<font color="#2040a0">defaults</font><font color="4444FF">[</font><font color="#008000">'properties'</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">[</font>
<font color="#2040a0">APrimaryKey</font><font color="4444FF">(</font><font color="#008000">'id'</font>, <font color="#2040a0">isClassProperty</font><font color="4444FF">=</font><font color="#FF0000">0</font>, <font color="#2040a0">isRequired</font><font color="4444FF">=</font><font color="#FF0000">1</font>, <font color="#2040a0">doc</font><font color="4444FF">=</font><font color="#008000">'PK'</font><font color="4444FF">)</font>
<font color="4444FF">]</font>
<font color="#444444">##</font>
<font color="#2040a0">_connDict</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#008000">'database'</font><font color="4444FF">:</font> <font color="#008000">'SampleDB'</font>, <font color="#008000">'host'</font><font color="4444FF">:</font> <font color="#008000">'localhost'</font>,
<font color="#008000">'user'</font><font color="4444FF">:</font> <font color="#008000">'postgres'</font>, <font color="#008000">'password'</font><font color="4444FF">:</font> <font color="#008000">''</font><font color="4444FF"><strong>}</strong></font>
<font color="#2040a0">model</font> <font color="4444FF">=</font> <font color="#2040a0">Model</font><font color="4444FF">(</font><font color="#008000">'Sample'</font>,<font color="#2040a0">adaptorName</font><font color="4444FF">=</font><font color="#008000">'Postgresql'</font>, <font color="#2040a0">connDict</font><font color="4444FF">=</font><font color="#2040a0">_connDict</font><font color="4444FF">)</font>
<font color="#2040a0">model</font>.<font color="#2040a0">version</font><font color="4444FF">=</font><font color="#008000">'0.1'</font>
<font color="#2040a0">model</font>.<font color="#2040a0">entities</font> <font color="4444FF">=</font> <font color="4444FF">[</font>
<font color="#2040a0">Entity</font><font color="4444FF">(</font><font color="#008000">'Person'</font>,
<font color="#2040a0">properties</font><font color="4444FF">=</font><font color="4444FF">[</font> <font color="#2040a0">AString</font><font color="4444FF">(</font><font color="#008000">'firstName'</font><font color="4444FF">)</font>,
<font color="#2040a0">AString</font><font color="4444FF">(</font><font color="#008000">'lastName'</font>,<font color="#2040a0">isRequired</font><font color="4444FF">=</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">]</font> <font color="4444FF">)</font>,
<font color="#2040a0">Entity</font><font color="4444FF">(</font><font color="#008000">'Address'</font>,
<font color="#2040a0">properties</font><font color="4444FF">=</font><font color="4444FF">[</font> <font color="#2040a0">AString</font><font color="4444FF">(</font><font color="#008000">'street'</font><font color="4444FF">)</font>,
<font color="#2040a0">AString</font><font color="4444FF">(</font><font color="#008000">'zipCode'</font>, <font color="#2040a0">width</font><font color="4444FF">=</font><font color="#FF0000">10</font><font color="4444FF">)</font>,
<font color="#2040a0">AString</font><font color="4444FF">(</font><font color="#008000">'town'</font>, <font color="#2040a0">isRequired</font><font color="4444FF">=</font><font color="#FF0000">1</font><font color="4444FF">)</font> <font color="4444FF">]</font>, <font color="4444FF">)</font>,
<font color="4444FF">]</font>
<font color="#444444">#---</font>
<font color="#2040a0">model</font>.<font color="#2040a0">associations</font><font color="4444FF">=</font><font color="4444FF">[</font>
<font color="#2040a0">Association</font><font color="4444FF">(</font><font color="#008000">'Address'</font>,<font color="#008000">'Person'</font>,
<font color="#2040a0">relations</font><font color="4444FF">=</font><font color="4444FF">[</font><font color="#008000">'person'</font>,<font color="#008000">'addresses'</font><font color="4444FF">]</font>,
<font color="#2040a0">delete</font><font color="4444FF">=</font><font color="4444FF">[</font><font color="#008000">'nullify'</font>,<font color="#008000">'deny'</font><font color="4444FF">]</font> <font color="4444FF">)</font>,
<font color="4444FF">]</font>
</pre>
\end{rawhtml}
\item[Verify the correctness of your model]
{\tt shell> mdl_validate_model.py sample_pymodel.py}
(note: use option {\tt -h} on python scripts for details)
\item[Generate the python code]
{\tt shell> mdl_generate_python_code.py sample_pymodel.py}
\item[Generate the corresponding database schema]
Either get the coresponding sql statements:
%\begin{verbatim}
%shell> mdl_generate_DB_schema.py -c -A sample_pymodel.py
%DROP SEQUENCE PK_SEQ_PERSON;
%DROP SEQUENCE PK_SEQ_ADDRESS;
%ALTER TABLE ADDRESS DROP CONSTRAINT person;
%ALTER TABLE PERSON DROP CONSTRAINT PERSON_pkey;
%ALTER TABLE ADDRESS DROP CONSTRAINT ADDRESS_pkey;
%DROP TABLE PERSON;
%DROP TABLE ADDRESS;
%CREATE TABLE PERSON (
% FIRST_NAME VARCHAR(40) ,
% LAST_NAME VARCHAR(40) NOT NULL,
% ID INTEGER NOT NULL);
%CREATE TABLE ADDRESS (
% TOWN VARCHAR(40) NOT NULL,
% FK_PERSON INTEGER ,
% STREET VARCHAR(40) ,
% ID INTEGER NOT NULL,
% ZIP_CODE VARCHAR(10) );
%ALTER TABLE PERSON ADD PRIMARY KEY (ID);
%ALTER TABLE ADDRESS ADD PRIMARY KEY (ID);
%ALTER TABLE ADDRESS ADD CONSTRAINT person FOREIGN KEY (FK_PERSON) REFERENCES PERSON(ID) INITIALLY DEFERRED;
%CREATE SEQUENCE PK_SEQ_PERSON START 1;
%CREATE SEQUENCE PK_SEQ_ADDRESS START 1;
%\end{verbatim}
\begin{rawhtml}
<pre>
DROP SEQUENCE PK_SEQ_PERSON;
DROP SEQUENCE PK_SEQ_ADDRESS;
<strong>ALTER</strong> <strong>TABLE</strong> ADDRESS DROP <strong>CONSTRAINT</strong> person;
<strong>ALTER</strong> <strong>TABLE</strong> PERSON DROP <strong>CONSTRAINT</strong> PERSON_pkey;
<strong>ALTER</strong> <strong>TABLE</strong> ADDRESS DROP <strong>CONSTRAINT</strong> ADDRESS_pkey;
DROP <strong>TABLE</strong> PERSON;
DROP <strong>TABLE</strong> ADDRESS;
<strong>CREATE</strong> <strong>TABLE</strong> PERSON (
FIRST_NAME <font color="#2040a0"><strong>VARCHAR</strong></font><strong>(</strong>40) ,
LAST_NAME <font color="#2040a0"><strong>VARCHAR</strong></font><strong>(</strong>40) <strong>NOT</strong> <strong>NULL</strong>,
ID <font color="#2040a0"><strong>INTEGER</strong></font> <strong>NOT</strong> <strong>NULL</strong>);
<strong>CREATE</strong> <strong>TABLE</strong> ADDRESS (
TOWN <font color="#2040a0"><strong>VARCHAR</strong></font><strong>(</strong>40) <strong>NOT</strong> <strong>NULL</strong>,
FK_PERSON <font color="#2040a0"><strong>INTEGER</strong></font> ,
STREET <font color="#2040a0"><strong>VARCHAR</strong></font><strong>(</strong>40) ,
ID <font color="#2040a0"><strong>INTEGER</strong></font> <strong>NOT</strong> <strong>NULL</strong>,
ZIP_CODE <font color="#2040a0"><strong>VARCHAR</strong></font><strong>(</strong>10) );
<strong>ALTER</strong> <strong>TABLE</strong> PERSON <strong>ADD</strong> <strong>PRIMARY</strong> <strong>KEY</strong> <strong>(</strong>ID);
<strong>ALTER</strong> <strong>TABLE</strong> ADDRESS <strong>ADD</strong> <strong>PRIMARY</strong> <strong>KEY</strong> <strong>(</strong>ID);
<strong>ALTER</strong> <strong>TABLE</strong> ADDRESS <strong>ADD</strong> <strong>CONSTRAINT</strong> person <strong>FOREIGN</strong> <strong>KEY</strong> <strong>(</strong>FK_PERSON) <strong>REFERENCES</strong> PERSON<strong>(</strong>ID) INITIALLY DEFERRED;
<strong>CREATE</strong> SEQUENCE PK_SEQ_PERSON START 1;
<strong>CREATE</strong> SEQUENCE PK_SEQ_ADDRESS START 1;
</pre>
\end{rawhtml}
Or create the database directly:
\begin{verbatim}
shell> mdl_generate_DB_schema.py -c -C --admin-dsn="localhost:template1:postgres:" sample_pymodel.py
\end{verbatim}
\item[Use it!]
%\begin{verbatim}
%>>> from Sample.Person import Person
%>>> from Sample.Address import Address
%>>> from Modeling.EditingContext import EditingContext
%>>> ec=EditingContext()
%
%>>> # create objects
%... john=Person()
%>>> john.setLastName('Cleese'); john.setFirstName('John')
%>>> ec.insert(john)
%>>> jeanne=Person()
%>>> jeanne.setLastName('Cleese'); jeanne.setFirstName('Jeanne')
%>>> ec.insert(jeanne)
%
%>>> # create relationships
%... a_john=Address(); a_john.setTown('London')
%>>> ec.insert(a_john)
%>>> john.addToAddresses(a_john); a_john.setPerson(john)
%>>>
%>>> a_jeanne=Address(); a_jeanne.setTown('Paris'); ec.insert(a_jeanne)
%>>> jeanne.addToAddresses(a_jeanne); a_jeanne.setPerson(jeanne)
%
%>>> # save changes
%>>> ec.saveChanges()
%
%>>> # fetch objects
%... in_london=ec.fetch('Person', 'addresses.town ilike "*london*"')
%>>> [(p.getLastName(), p.getFirstName()) for p in in_london]
%[('Cleese', 'John')]
%\end{verbatim}
\begin{rawhtml}
<pre>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <strong>from</strong> <font color="#2040a0">Sample</font>.<font color="#2040a0">Person</font> <strong>import</strong> <font color="#2040a0">Person</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <strong>from</strong> <font color="#2040a0">Sample</font>.<font color="#2040a0">Address</font> <strong>import</strong> <font color="#2040a0">Address</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <strong>from</strong> <font color="#2040a0">Modeling</font>.<font color="#2040a0">EditingContext</font> <strong>import</strong> <font color="#2040a0">EditingContext</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font><font color="4444FF">=</font><font color="#2040a0">EditingContext</font><font color="4444FF">(</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#444444"># create objects</font>
... <font color="#2040a0">john</font><font color="4444FF">=</font><font color="#2040a0">Person</font><font color="4444FF">(</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">john</font>.<font color="#2040a0">setLastName</font><font color="4444FF">(</font><font color="#008000">'Cleese'</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">john</font>.<font color="#2040a0">setFirstName</font><font color="4444FF">(</font><font color="#008000">'John'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">john</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">jeanne</font><font color="4444FF">=</font><font color="#2040a0">Person</font><font color="4444FF">(</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">jeanne</font>.<font color="#2040a0">setLastName</font><font color="4444FF">(</font><font color="#008000">'Cleese'</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">jeanne</font>.<font color="#2040a0">setFirstName</font><font color="4444FF">(</font><font color="#008000">'Jeanne'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">jeanne</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#444444"># create relationships</font>
... <font color="#2040a0">a_john</font><font color="4444FF">=</font><font color="#2040a0">Address</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">a_john</font>.<font color="#2040a0">setTown</font><font color="4444FF">(</font><font color="#008000">'London'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">a_john</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">john</font>.<font color="#2040a0">addToAddresses</font><font color="4444FF">(</font><font color="#2040a0">a_john</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">a_john</font>.<font color="#2040a0">setPerson</font><font color="4444FF">(</font><font color="#2040a0">john</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">a_jeanne</font><font color="4444FF">=</font><font color="#2040a0">Address</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">a_jeanne</font>.<font color="#2040a0">setTown</font><font color="4444FF">(</font><font color="#008000">'Paris'</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">ec</font>.<font color="#2040a0">insert</font><font color="4444FF">(</font><font color="#2040a0">a_jeanne</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">jeanne</font>.<font color="#2040a0">addToAddresses</font><font color="4444FF">(</font><font color="#2040a0">a_jeanne</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#2040a0">a_jeanne</font>.<font color="#2040a0">setPerson</font><font color="4444FF">(</font><font color="#2040a0">jeanne</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#444444"># save changes</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#2040a0">ec</font>.<font color="#2040a0">saveChanges</font><font color="4444FF">(</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="#444444"># fetch objects</font>
... <font color="#2040a0">in_london</font><font color="4444FF">=</font><font color="#2040a0">ec</font>.<font color="#2040a0">fetch</font><font color="4444FF">(</font><font color="#008000">'Person'</font>, <font color="#008000">'addresses.town ilike "*london*"'</font><font color="4444FF">)</font>
<font color="4444FF">></font><font color="4444FF">></font><font color="4444FF">></font> <font color="4444FF">[</font><font color="4444FF">(</font><font color="#2040a0">p</font>.<font color="#2040a0">getLastName</font><font color="4444FF">(</font><font color="4444FF">)</font>, <font color="#2040a0">p</font>.<font color="#2040a0">getFirstName</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">)</font> <strong>for</strong> <font color="#2040a0">p</font> <strong>in</strong> <font color="#2040a0">in_london</font><font color="4444FF">]</font>
<font color="4444FF">[</font><font color="4444FF">(</font><font color="#008000">'Cleese'</font>, <font color="#008000">'John'</font><font color="4444FF">)</font><font color="4444FF">]</font>
</pre>
\end{rawhtml}
\end{description}
%% end
\input{www/menu-inline-end}
\end{document}
|
|
From: <sbi...@us...> - 2003-09-01 21:15:55
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/www In directory sc8-pr-cvs1:/tmp/cvs-serv3083/Modeling/doc/www Modified Files: menu-inline-begin.tex Log Message: Added page quick overview Index: menu-inline-begin.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/www/menu-inline-begin.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** menu-inline-begin.tex 10 Aug 2003 21:12:12 -0000 1.7 --- menu-inline-begin.tex 1 Sep 2003 21:15:51 -0000 1.8 *************** *** 3,7 **** <tr><td width="20%" valign="top"><br><br><br> ! <a href="index.html">Home</a><br><br> <a href="status.html">Project's status</a><br> <a href="contributors.html">Contributors</a><br> --- 3,8 ---- <tr><td width="20%" valign="top"><br><br><br> ! <a href="quick_overview.html">Quick example</a><br><br> ! <a href="main.html">Features</a><br><br> <a href="status.html">Project's status</a><br> <a href="contributors.html">Contributors</a><br> |
|
From: <sbi...@us...> - 2003-09-01 21:13:46
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv2611 Modified Files: INSTALL Log Message: Fixed: forgot cheetah Index: INSTALL =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/INSTALL,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** INSTALL 31 Aug 2003 15:44:06 -0000 1.9 --- INSTALL 1 Sep 2003 21:13:42 -0000 1.10 *************** *** 47,52 **** The framework can be downloaded from http://modeling.sourceforge.net ! Unless you already have Cheetah installed (this is not a required part), ! you'll get the following message:: sh: cheetah-compile: command not found --- 47,52 ---- The framework can be downloaded from http://modeling.sourceforge.net ! Unless you already have Cheetah installed (it does not need to be installed ! before), you'll get the following message:: sh: cheetah-compile: command not found *************** *** 63,66 **** --- 63,74 ---- Installation: standard distutils. + + Cheetah Templates + ----------------- + + Get it here: http://www.cheetahtemplate.org/ + + Installation: standard distutils. + eGenix.com mx Extensions for Python v2.0.5 |
|
From: <sbi...@us...> - 2003-08-31 17:47:31
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide
In directory sc8-pr-cvs1:/tmp/cvs-serv20879/Modeling/doc/UserGuide
Modified Files:
DefiningaModel.tex
Log Message:
Added doc. for many-to-many
Index: DefiningaModel.tex
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide/DefiningaModel.tex,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** DefiningaModel.tex 31 Aug 2003 17:38:07 -0000 1.38
--- DefiningaModel.tex 31 Aug 2003 17:47:28 -0000 1.39
***************
*** 539,544 ****
\item[\code{isClassProperty}:] tells whether the Relationship's key (i.e. its
name, for example: \var{toBooks}) is part of the class' API. It should
! be set in most cases (the only case where this should not be checked
! is for many-to-many relationships which are not supported yet).
\item[\code{multiplicityLowerBound}, \code{multiplicityUpperBound}:]
--- 539,544 ----
\item[\code{isClassProperty}:] tells whether the Relationship's key (i.e. its
name, for example: \var{toBooks}) is part of the class' API. It should
! be set in most cases.% (the only case where this should not be checked
! %is for many-to-many relationships which are not supported yet).
\item[\code{multiplicityLowerBound}, \code{multiplicityUpperBound}:]
***************
*** 1818,1822 ****
\end{enumerate}
! \item[One-to-one] one-to-one relationships should be modeled as
one-to-many relationships, to which you add custom validation logic
to enforce that the toMany relationship does not have more than one
--- 1818,1822 ----
\end{enumerate}
! \item[One-to-one] One-to-one relationships should be modeled as
one-to-many relationships, to which you add custom validation logic
to enforce that the toMany relationship does not have more than one
***************
*** 1825,1831 ****
! \item[Many-to-many] many-to-many relationships are not supported yet (to
! do this the support for flattened relationships and abstract
! entities needs to be added to the core).
\end{description}
--- 1825,1832 ----
! \item[Many-to-many] While automatic handling of many-to-many relationships is
! not supported yet, many-to-many relationships can be modeled and used
! with minimal efforts. Please refer to the dedicated
! section~\ref{design-rels-many-to-many}, below.
\end{description}
***************
*** 1943,1947 ****
\end{verbatim}
! \subsubsection{A short example\label{design-rels-many-to-many-principles}}
Now that we now how many-to-many relationships are handled, we know what we
--- 1944,1948 ----
\end{verbatim}
! \subsubsection{A short example\label{design-rels-many-to-many-example}}
Now that we now how many-to-many relationships are handled, we know what we
|
|
From: <sbi...@us...> - 2003-08-31 17:47:31
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage
In directory sc8-pr-cvs1:/tmp/cvs-serv20879/Modeling/doc/HomePage
Modified Files:
status.tex
Log Message:
Added doc. for many-to-many
Index: status.tex
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/status.tex,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** status.tex 4 Jul 2003 18:22:57 -0000 1.4
--- status.tex 31 Aug 2003 17:47:28 -0000 1.5
***************
*** 70,74 ****
the database.
! \item Automatic many-to-many relationship is not supported yet
\item It is not possible yet to specify that the framework should hold no
--- 70,78 ----
the database.
! \item Automatic many-to-many relationship is not supported yet. {\bf
! Important:} It does not mean that they cannot be modeled: see the
! dedicated section in the User's Guide: \begin{rawhtml}<a
! href="UserGuide/design-rels-many-to-many.html">Modeling many-to-many
! relationships</a>\end{rawhtml}
\item It is not possible yet to specify that the framework should hold no
|