s3mgr.model vs. s3db

14 views
Skip to first unread message

Dominic König

unread,
Jul 5, 2012, 1:12:28 PM7/5/12
to sahan...@googlegroups.com
Hi all--

8 months after introducing the new dynamic model loader, I've now ultimately
removed the old one. That means, the old S3ModelExtensions class has gone as
has s3mgr.model.

The model methods (like add_component, super_link, configure) are now all
genuine methods of the S3Model class. That means, they can and have to be
accessed from (current.)s3db - the so-called "model loader", which is nothing
else than just a global empty instance of S3Model.

Inside S3Model subclasses, s3db.* and self.* would have the same meaning, of
course - and all of our model classes in modules/eden are S3Model subclasses.
Additionally, since all the model methods are static or class methods of
S3Model, they can be accessed even without having an instance available, i.e.
directly as S3Model.*

However, in most places it should be possible to access current.s3db, which is
therefore the recommended method.

Old vs. new, at a glance:

s3mgr.configure => s3db.configure
s3mgr.model.get_config => s3db.get_config
s3mgr.model.add_component => s3db.add_component
s3mgr.model.super_link => s3db.super_link

Also note that neither s3mgr.load() nor s3mgr.loader() will work anymore. I
think I've cleaned up all the occurences in trunk, though.

An update of the S3 API epydocs will go out tonight, so you can check there.

Regards,
Dominic
signature.asc
Reply all
Reply to author
Forward
0 new messages