Piotras' blog: Archive
2007-12-01 - 2007-12-31
Beauty and the Beast
Posted on 2007-12-04 21:55:59 UTC.
I am not sure which one is the beast and which one the beauty. But I think both midgard-python and midgard-core may be both :)
Python seems to be the second Midgard's scripting language now. Two weeks ago I wrote about initial usable bindings work, and today there's much more:
- Midgard Query Builder
- Midgard Collector
- Midgard Object Class ( pseudo class for MgdSchema classes introspection and reflection )
- Midgard Reflection Property
- MgdSchema objects' parameters
Midgard Replicator is not yet fully implemented for midgard-python because it simply doesn't exist in Midgard2 ( aka trunk ). Reason why it hasn't been moved there is fact that replicator uses language specific SQL queries while Midgard2 itself uses something which you could name "built in" languages support. Whichis nothing more like languages persistant cache in details.
You can take a look at midgard-python test examples and compile module if needed. And I think I should start count days to first Midgard2 alpha release, and first python applications for gnome or maemo :)
midgard_user_auth
Posted on 2007-12-17 12:11:41 UTC.
I started to make new Midgard2 auth features backward compatible. So, to make things smooth and transparent I added new internal function which makes legacy authorization and it's triggered by simple check, check if new midgard_user table exists in database.
The good start:
- database is created with midgard branch-1-9
- python is used as scripting language
- midgard2 library is used with test
And simple example code:
user = midgard.user.auth("admin", "password", "python-sg", False);
if(midgard.user.is_admin(user)):
print ("User is an admin")
Output with method names info:
** INFO: user.is_admin(...)
User is an admin
I didn't make any database changes, so let's hope both midgard versions could be used together soon.