On Mon, 2009-01-05 at 10:29 -0500, Michael DeHaan wrote:
> Casey Dahlin posted an idea on my blog that I thought was a good one...
> 
> What if we had an ORM for systems?    When he first posted it, my 
> initial thought was "Func already does this", though there are some 
> subtle changes:
> 
> His example was more complicated, but what if we could do something like:
> 
> Client("*.example.org").filter_by(arch==i386).services.start("httpd") ?
> 
> (I'll admit the critera syntax could be much better)

I suspect you'd need the:
  filter_by(arch==i386)
to read
  filter_by(arch='i386')
to be valid Python (so that it uses kwargs).

Alternatively, something like:

Client.hostname.matches('*.example.org') \
  and Client.arch=='i386' \
  .services.start('httpd')

is probably doable as well (Client.hostname and Client.arch would be
attribute objects with overloaded __eq__, __and__, __or__ methods,
etc).  

Not that I'm volunteering to implement :-)

[snip]

_______________________________________________
Func-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/func-list

Reply via email to