Edit history

Edit: -1 of 1
Time: 2007-01-20 22:02:34
Note: /dabosite/wiki/Pycode/reparent

changed:
-
This is a Dabo Wiki-specific tag used to format and colorize your Python code. Here's a sample, using code from the SimpleFormWithBizobj.py demo code. This is what it looks like in the wiki editor:

----

<pre>&lt;pycode&gt;
class MyBizobj(dBizobj):
	# This is a subclass of dabo's dBizobj base class. Look how simple it
	# is to set up the required parameters.

	def beforeInit(self):
		self.DataSource = "zipcodes"     # the alias for the bizobj/cursor
		self.KeyField = "iid"            # the primary key
		self.RequeryOnLoad = False       # don't do an implicit requery on init

		# Set the default values for new records added
		defaultValues = {"ccity":"Penfield", "cstateprov":"NY", "czip":"14526"}
&lt;/pycode&gt;</pre>

----

And this is how it is rendered:

----

<pycode>
class MyBizobj(dBizobj):
	# This is a subclass of dabo's dBizobj base class. Look how simple it
	# is to set up the required parameters.

	def beforeInit(self):
		self.DataSource = "zipcodes"     # the alias for the bizobj/cursor
		self.KeyField = "iid"            # the primary key
		self.RequeryOnLoad = False       # don't do an implicit requery on init

		# Set the default values for new records added
		defaultValues = {"ccity":"Penfield", "cstateprov":"NY", "czip":"14526"}
</pycode>

#red#**NOTE**##: this only works on pages set to use the **Structured Text** markup type. It doesn't work at all with any other markup type.