20130930 (Monday, 30 September 2013)

Multiple sites in one database

Cool! I had for the first time a need for what normal Django prople do with their “sites” framework.

I just needed to change the getter of the site_config property so that it uses a configurable value config_id instead of the hard-coded 1.

config_id is the Lino equivalent of Django’s SITE_ID setting. Lino applications don’t need django.contrib.sites because this functionality is integral part of lino.modlib.system. Lino implements it a bit differently: main difference is that the model instance is cached in memory instead of working with a middleware.

TODO: SiteConfig.next_partner_id doesn’t work as it should with multiple config_id. Possible solutions:

  • convert it (back) to a class attribute

  • make it’s usage optional