On 5/8/11 1:55 PM, Stef Kariotidis wrote: > Greetings to the list from a newbie and thanks for the creation of Dabo, > > This is my first time posting to the list so please bare with me > considering the following questions...
Welcome to Dabo, and to the dabo-users list. > I would like to ask two things: > > 1) I develop an application who monitors networked machines and i use > SQLite to save the state of the networked machines over time and some > statistics. I also have some modules > to handle the monitoring process and the logic of the app. My question > is, where is the right place to put the logic of the application in > respect to the Dabo application? I know that the database information > (***. cnxml) goes to db directory and that the modules that handle the > queries (bizobjs go to their directory (biz)). > Where is the right place to put the database file (***.sqlite) and the > rest of the python modules which are the logic of the application? It is only by convention that dabo applications have db/, biz/, and ui/ directories. You are not required to follow this convention to use dabo. For existing non-dabo business logic code, biz/ would be a fine place, or as Nate suggested, lib/. For the actual database file, you should keep that out of your application source tree. The database isn't source code, but data that the application needs at runtime. Where you put it depends on your needs, but here's what I do for my single-user applications: + On Linux and Mac, ~/.<app_name> (the user's home directory, in a hidden folder with the lower-case name of the application. + On Windows, %appdata%/App Name (usually, %appdata% is something like c:\Documents and Settings\<user name>\Application Data). Luckily, there's a function in Dabo to handle getting this location for you at runtime: import dabo appDataDir = dabo.lib.utils.getUserAppDataDirectory("My Application") On my Mac and Linux, appDataDir is '/Users/pmcnett/.my_application'. On my Windows Vista, u'C:\\Users\\Administrator\\AppData\\Roaming\\My Application'. > 2) I want to create a drop down box (combo box?) with intelligence > enabled; more specifically as the user types in, the control searches > data from a database table suggesting entries, > after finding the correct entry the user presses<enter> or<tab> to > accept the value and goes on with the rest of data entry. I've made my own putting a dTextBox and a dButton together in a panel. The textbox has a LookupBizobj property which takes the bizobj to use to lookup values. Every time the user presses a key, I do a lookupbiz.seek() and display the DisplayFormat (another property of the textbox). The button is there so the user can pull up a browse grid of the LookupBizobj and change the sort, pick using dGrid's incremental search, and modify the selection criteria of the lookup. So there are multiple ways for the user to use the control. Paul _______________________________________________ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/4dc81e65.1060...@ulmcnett.com