20120915

  • Fixed an unreleased bug: Traceback when trying to select a contact of a lino.modlib.contacts.models.CompanyContact.

Rotating logfiles

Noticed that the testlino logger does not as expected rotate at midnight. Main reason was a bug in lino.utils.log.

But I also discovered this post: Why doesn’t my TimedRotatingFileHandler rotate at midnight? which makes me think that TimedRotatingFileHandler is not a candidate for a Django site, because:

  • Several processes share the same logfile
  • Some processes are long-running (mod_wsgi, watch_tim), some others not (most other management commands)

Next attempt is to use WatchedFileHandler, which (after today) happens if there’s neither a when nor a rotate keyword:

LOGGING = dict(filename='/var/log/lino/testlino.log',level='INFO')

This supposes of course that you also configure logrotate by creating a file /etc/logrotate.d/lino with e.g. the following content:

/var/log/lino/testlino.log {
        weekly
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        endscript
}

Specifying param_values to a request

Fixed an internal Bug (since yesterday): lino.core.actions.ActionRequest.__init__() didn’t obey when caller explicitly specified param_values.

beid_jslib_root

New Lino site setting lino.Lino.beid_jslib_root.

lino_welfare

  • ClientContactTypes, HealthInsurances, Pharmacies …

    In der Tabelle Klientenkontakte (Kontakte pro Klient) hängt die Auswahlliste der Firmen jetzt von der Kontaktart ab. Also bei Kontaktart “Krankenkasse” kann man nur noch Krankenkassen auswählen etc.

  • tim2lino, migrate: Personen, die keine NISS aber wohl eine Gesdos-Nr haben, bleiben jetzt ebenfalls Klienten, und kriegen die Partner-Nr als NISS.

  • Removed obsolete field Company.hourly_rate

  • Removed the tables MyClients, MyClientsByGroup, MyActiveClients and MyPrimaryClients because these cases are now handled via Clients.parameters.

Uff! die Tabelle lino_welfare.modlib.pcsw.models.UsersWithClients in der Demo-Datenbank hat jetzt einen einigermaßen realistischen Inhalt:

Begleiter 1 Bilan Formation Recherche Travail Standby Komplette Akten Aktive Klienten Total
Alicia Allmanns 3 3 5 2 2 7 13 15
Hubert Huppertz 4 5 5 5 5 9 19 24
Mélanie Mélard 6 5 7 4 6 17 22 28
Total (3 rows) 13 13 17 11 13 33 54 67

Hier übrigens das Skript, das ich zum Generieren obiger Tabelle benutzt habe:

from lino_welfare.modlib.pcsw import models as pcsw
from lino.api import dd, rt
pcsw = dd.resolve_app('pcsw')
users = dd.resolve_app('users')
root = users.User.objects.get(username='root')
print pcsw.UsersWithClients.request(user=root).to_rst()