|
[Webware-checkins] CVS: Webware/MiddleKit/Docs UsersGuide.html,1.19,1.20
From: Chuck Esterbrook <echuck@us...> - 2002-10-26 07:22
|
Update of /cvsroot/webware/Webware/MiddleKit/Docs
In directory usw-pr-cvs1:/tmp/cvs-serv30305/Docs
Modified Files:
UsersGuide.html
Log Message:
- document new 'Database' setting
- add new section on database name, including note about passing via
constructor
Index: UsersGuide.html
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Docs/UsersGuide.html,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** UsersGuide.html 31 Mar 2002 04:32:40 -0000 1.19
--- UsersGuide.html 26 Oct 2002 07:22:19 -0000 1.20
***************
*** 34,37 ****
--- 34,38 ----
<br> <a href="#GP_addToBars">Lists: addToBars()</a>
<br> <a href="#MiscTopics"><font size=+1>Miscellaneous Topics</font></a>
+ <br> <a href="#MT_DatabaseName">Database Name</a>
<br> <a href="#MT_IteratingAttrs">Iterating over attributes</a>
<br> <a href="#MT_DeletingObjects">Deleting objects</a>
***************
*** 287,290 ****
--- 288,299 ----
}</pre>
+
+ <p> The <span class=name>Database</span> setting overrides the database name, which is otherwise assumed to be same name as the model. This is particularly useful if you are running two instances of the same application on one host.
+
+ <pre>{
+ 'Database': 'foobar',
+ }</pre>
+
+
<p> The <span class=name>DeleteBehavior</span> setting can be used to change what MiddleKit does when you delete objects.
The default behavior is "delete" which means that objects are deleted from the SQL database when they are deleted from the MiddleKit object store.
***************
*** 349,352 ****
--- 358,372 ----
<a name=MiscTopics><h2>Miscellaneous Topics</h2></a>
+
+ <a name=MT_DatabaseName><h3>Database Name</h3></a>
+
+ <p> MiddleKit uses the name of the store as the name of the database. This works well most of the time. However, if you need to use a different database name, there are two techniques available:
+
+ <p> 1. You can specify the 'Database' setting in <span class=filename>Settings.config</span>. See <a href=#Configuration>Configuration</a> for an example.
+
+ <p> 2. You can pass the database name via the object store's constructor arguments, which are then passed on to the DB API module. This technique overrides both the default model name and the model settings. For example:
+
+ <pre class=py>store = MySQLObjectStore(db='foobar', user='prog', passwd='asdklfj')
+ </pre>
<a name=MT_IteratingAttrs><h3>Iterating over attributes</h3></a>
|
| Thread | Author | Date |
|---|---|---|
| [Webware-checkins] CVS: Webware/MiddleKit/Docs UsersGuide.html,1.19,1.20 | Chuck Esterbrook <echuck@us...> |