<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dabo.leafe.com/index.php?action=history&amp;feed=atom&amp;title=DataTypes</id>
	<title>DataTypes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dabo.leafe.com/index.php?action=history&amp;feed=atom&amp;title=DataTypes"/>
	<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=DataTypes&amp;action=history"/>
	<updated>2026-11-21T10:51:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://wiki.dabo.leafe.com/index.php?title=DataTypes&amp;diff=4033&amp;oldid=prev</id>
		<title>Ed: Created page with &quot;To check the data types available start a Python terminal, &lt;code&gt;import dabo&lt;/code&gt; and then &lt;code&gt;type&lt;/code&gt; either of the following type commands to see the options. These...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=DataTypes&amp;diff=4033&amp;oldid=prev"/>
		<updated>2020-05-11T15:13:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;To check the data types available start a Python terminal, &amp;lt;code&amp;gt;import dabo&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; either of the following type commands to see the options. These...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;To check the data types available start a Python terminal, &amp;lt;code&amp;gt;import dabo&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; either of the following type commands to see the options. These are used in the bizobj code when defining the DataStructure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight  lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import dabo&lt;br /&gt;
&amp;#039;/usr/lib/python2.4/site-packages/dabo&amp;#039; not versioned, and not exported&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; print dabo.db.daboTypes&lt;br /&gt;
{&amp;#039;C&amp;#039;: &amp;lt;type &amp;#039;unicode&amp;#039;&amp;gt;, &amp;#039;B&amp;#039;: &amp;lt;type &amp;#039;bool&amp;#039;&amp;gt;, &amp;#039;D&amp;#039;: &amp;lt;type &amp;#039;datetime.date&amp;#039;&amp;gt;, &lt;br /&gt;
   &amp;#039;G&amp;#039;: &amp;lt;type &amp;#039;long&amp;#039;&amp;gt;, &amp;#039;F&amp;#039;: &amp;lt;type &amp;#039;float&amp;#039;&amp;gt;, &amp;#039;I&amp;#039;: &amp;lt;type &amp;#039;int&amp;#039;&amp;gt;, &amp;#039;M&amp;#039;: &amp;lt;type &amp;#039;unicode&amp;#039;&amp;gt;, &lt;br /&gt;
   &amp;#039;L&amp;#039;: &amp;lt;type &amp;#039;str&amp;#039;&amp;gt;, &amp;#039;N&amp;#039;: &amp;lt;class &amp;#039;decimal.Decimal&amp;#039;&amp;gt;, &amp;#039;T&amp;#039;: &amp;lt;type &amp;#039;datetime.datetime&amp;#039;&amp;gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; print dabo.db.pythonTypes&lt;br /&gt;
{&amp;lt;type &amp;#039;unicode&amp;#039;&amp;gt;: &amp;#039;C&amp;#039;, &amp;lt;type &amp;#039;bool&amp;#039;&amp;gt;: &amp;#039;B&amp;#039;, &amp;lt;type &amp;#039;str&amp;#039;&amp;gt;: &amp;#039;C&amp;#039;, &amp;lt;class &amp;#039;decimal.Decimal&amp;#039;&amp;gt;: &amp;#039;N&amp;#039;, &lt;br /&gt;
   &amp;lt;type &amp;#039;float&amp;#039;&amp;gt;: &amp;#039;F&amp;#039;, &amp;lt;type &amp;#039;int&amp;#039;&amp;gt;: &amp;#039;I&amp;#039;, &amp;lt;type &amp;#039;datetime.date&amp;#039;&amp;gt;: &amp;#039;D&amp;#039;, &amp;lt;type &amp;#039;long&amp;#039;&amp;gt;: &amp;#039;G&amp;#039;, &lt;br /&gt;
   &amp;lt;type &amp;#039;datetime.datetime&amp;#039;&amp;gt;: &amp;#039;T&amp;#039;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dabo is using &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; for long.&lt;br /&gt;
&lt;br /&gt;
there is no &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt; in either of the lists&lt;br /&gt;
&lt;br /&gt;
Turns out some of the db modules use &amp;lt;code&amp;gt;buffer&amp;lt;/code&amp;gt;, some use &amp;lt;code&amp;gt;array.array&amp;lt;/code&amp;gt;, some use &amp;lt;code&amp;gt;str&amp;lt;/code&amp;gt; to represent blobs. I just made &amp;quot;L&amp;quot; map to str, as Python&amp;#039;s str object can handle any-length binary data just fine.&lt;br /&gt;
&lt;br /&gt;
Here is an example (excerpt) of where the dabo data type has been used in bizobj code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight  lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Setting the DataStructure explicitly here is optional, but recommended as&lt;br /&gt;
# it will keep Dabo from interpreting field types from the backend every&lt;br /&gt;
# time. It lets you specify what types you expect which fields to be. Also,&lt;br /&gt;
# this information is used in self.setSQL() to add the fields to the query.&lt;br /&gt;
# (field_alias, field_type, pk, table_name, field_name, field_scale)&lt;br /&gt;
self.DataStructure = (&lt;br /&gt;
    (&amp;quot;id&amp;quot;, &amp;quot;I&amp;quot;, True, &amp;quot;reccats&amp;quot;, &amp;quot;id&amp;quot;),&lt;br /&gt;
    (&amp;quot;descrp&amp;quot;, &amp;quot;C&amp;quot;, False, &amp;quot;reccats&amp;quot;, &amp;quot;descrp&amp;quot;),&lt;br /&gt;
    (&amp;quot;html&amp;quot;, &amp;quot;M&amp;quot;, False, &amp;quot;reccats&amp;quot;, &amp;quot;html&amp;quot;),&lt;br /&gt;
    (&amp;quot;image&amp;quot;, &amp;quot;C&amp;quot;, False, &amp;quot;reccats&amp;quot;, &amp;quot;image&amp;quot;),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The first value in each tuple is the field name. The second value of each tuple is the dabo data type.&lt;/div&gt;</summary>
		<author><name>Ed</name></author>
	</entry>
</feed>