durusmail: durus-users: How to start a Durus server
How to start a Durus server
2006-05-30
2006-05-30
How to start a Durus server
David Binger
2006-05-30
On May 30, 2006, at 7:01 AM, Damjan wrote:

> Now, first question: what's the best way to start the durus server,
> with the "durus -s"
> script or I should start it programatically?

I vote for "durus -s" or "run_durus.py", but I don't think
it matters how you start the server.

>
> And second can I store any object in Durus, or I have to make some
> special provisions.

Any object that can be pickled will work.

>
> The thing is I'd have something like this:
>
> sm = SM(init_params..)
> sm.mac = 'aa-bb-cc-dd-ee-ff'
> sm.ip = '....'
> .....etc...
> root['sm'] = PersistentDict()
> root['sm'][sm.ip] = sm
>
> Can I add random string and integer attributres to the sm instance and
> then just store it in the Durus DB? SM is the class that just inits
> some
> attributes out of snmp oids.

Yes.  That works.

If you intend to make changes to the attributes of these instances
after they have been saved, and if you want Durus to automatically
commit those changes with transactions, then you might want to use
a class that mixes SM and Persistent.  That does not appear to be
necessary for your application.

If you are updating the root['sm'] mapping frequently, you should
probably use a BTree() instead of a PersistentDict().

reply