[kforge-dev] Fwd: Re: domainmodel-test errors

John Bywater john.bywater at appropriatesoftwarefoundation.org
Thu Apr 12 19:05:19 UTC 2007


Hi Dave,

So, the domainmodel code has been fixed so that:

1. Its domainmodel-admin program actually works. So you can do 
.../domainmodel-admin db rebuild
2. Its domainmodel-test program actually works. So you can do 
.../domainmodel-test

In other words, domainmodel doesn't need to run against the kforge 
database anymore!


To install and test domainmodel (to be made into a doc):

1. get the source (recommend latest trunk, at the moment)
2. set environment variable 'PYTHONPATH' to .../svn/trunk/src
3. copy .../svn/trunk/etc/domainmodel.conf.new config file to somewhere new
4. set environment variable 'DOMAINMODEL_SETTING' to your new config file
5. establish database user account
6. establish database access grants for user with database (choose 
database name, password, etc)
7. edit your new config file for your context (at least set database 
name, password, etc.)
8. edit your new config file so that system_mode = development
8. run .../domainmodel-admin db create (enter database password, returns 
silently on success)
9. run .../domainmodel-admin db init (takes a little while, returns 
silently on success)
10. run .../domainmodel-test (prints OK message on success)
11. edit your new config file so that system_mode = production
12. run .../domainmodel-admin db rebuild (returns silently on success)
13. use the installation: can't cos it doesn't do anything

To develop domainmodel, write a test, get it to pass, check all tests 
pass, email an svn diff, or commit if has project developer role.

There isn't so much, but we could reduce the amount of required 
configuration in the config file. For example, plugin_data_dir isn't 
actaully needed, and we can't expect new people not to be troubled by 
it. So it we need to make the code not depend on having it (which it does).

To way to apply domainmodel would be roughly (also to be made into a doc):

1. in general, extend domainmodel classes. Applications of domainmodel 
should support being applied in the same way as domainmodel, so it makes 
sense to follow the module structure of domainmodel in applications of 
domainmodel.
2. prepare by creating your application's project directory, with etc/, 
src/, and bin/ dirs.
3. copy domainmodel.conf.new into your etc/.
4. copy domainmodel-admin and -test to your bin; rename files after your 
application; edit files for your application.
5. create your own application test suite package, so -test has 
something to use
6. create your own Application test class, then create your own 
Application class
6. create your own ApplicationBuilder test class, then create your own 
ApplicationBuilder class
7. set your ApplicationBuilder on your Application
8. create your own ModelBuilder test class, then create your own 
ModelBuilder class
9. set your ModelBuilder on your ApplicationBuilder
10. create your own domain model classes
11. create your own command/initialise.py (initial domain objects)
12. create the database using your -admin: "-admin db create" and 
"-admin db init"
13. test the application using your -test
14. change the application tests, change the application
15. rebuild the database using ...-admin db rebuild
16. retest the application using your -test

Then, it's a matter of building up the application's domain model, and 
creating some UI to support interactions. But writing a developer guide 
would be good.

Domainmodel has an "admin" Web interface, which provides fully automatic 
list/create/read/update/delete of all domain model objects by reflection 
of the model, and a "registry" Web interface toolkit which allows Web 
interfaces to be built over the domain model by reflection of the model 
and selective overriding and extending of default "admin" behaviour.

So, should really bash a raw, or default Web interface into shape. 
Something that allows the skeleton model to be manipulated. We just need 
a bit of Apache config to setup the Python handlers, a 
scanbooker.django.settings.urls.dui module with url patterns mapped to 
Python methods for the admin views (just like normal). Should be quite 
simple, but I'm not sure what the value is. Demonstration, test, 
example, or indication of included capabilities?

Best wishes,

John.




> David Heath wrote:
>
> > Hi John,
> >
> > I've installed domainmodel and I'm trying to run domainmodel-test 
> (seemed like a reasonable first thing to do). I'm getting lots of 
> errors, and I don't really understand why. I've installed Django 
> 0.95.1 and all other dependencies as far as I can tell. I've set up a 
> mysql database.





More information about the kforge-dev mailing list