Tuesday, October 15, 2019¶
I fixed a little bug which caused the following traceback when trying to show the detail of an excerpt:
AjaxExceptionResponse TypeError: __str__ returned non-string (type __proxy__) in request GET /api/excerpts/MyExcerpts/6?_dc=1571102296305&lv=1571101922.83524&pv=&pv=&pv=&pv=1&pv=&an=detail&rp=ext-comp-2534&fmt=json TRACEBACK: File "/home/luc/virtualenvs/py3/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/luc/virtualenvs/py3/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view return self.dispatch(request, *args, **kwargs) File "/home/luc/virtualenvs/py3/lib/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch return handler(request, *args, **kwargs) File "/home/luc/virtualenvs/py3/lib/python3.6/site-packages/django/utils/decorators.py", line 45, in _wrapper return bound_method(*args, **kwargs) File "/home/luc/virtualenvs/py3/lib/python3.6/site-packages/django/utils/decorators.py", line 142, in _wrapped_view response = view_func(request, *args, **kwargs) File "/home/luc/work/lino/lino/modlib/extjs/views.py", line 548, in get datarec = ar.elem2rec_detailed(elem) File "/home/luc/work/lino/lino/core/requests.py", line 1036, in elem2rec_detailed rec.update(title=ar.get_breadcrumbs(elem)) File "/home/luc/work/lino/lino/core/requests.py", line 1060, in get_breadcrumbs return list_title + u" » " + self.get_detail_title(elem) File "/home/luc/work/lino/lino/core/requests.py", line 986, in get_detail_title return self.actor.get_detail_title(self, elem) File "/home/luc/work/lino/lino/core/actors.py", line 1186, in get_detail_title return str(obj) Bad Request: /api/excerpts/MyExcerpts/6
Changes in the final report for Lino Avanti¶
Here we go for #3266. This is basically a few more changes in the template for the final report. Also I switched build method from appypod to weasy2pdf. And some minor changes in Lino Extensions Library:
lino.core.requests.BaseRequest.get_printable_context() adds a new function
activate_language() to set the language for the remaining part of the
template. This is because they want final reports printed in German even if the
clients contact language is different.
Until now Lino Avanti defined two
These have been replaced by a single entry
“Social assistant” and “Integration agent” are now two functions (
added by the
std fixture of
lino_xl.lib.clients.KnownContactType.get_contacts (i.e. get
them all, not just one) is now used instead of
Summary layout of
lino_xl.lib.cv.HistoryByPerson was not very readable:
added a colon behind each field label, and the field value is now bold.
A bug in that same summary always inserted an empty bullet at the beginning of the list.
Who’s behind weasyprint?¶
Nice: The Kozea community (maintainers of weasyprint) describes itself with the following words:
We build open source software that you will love
After years and years of extremely intense research (and endless nights drinking in pubs with friends), we’ve found the three most important rules of free software development:
have good ideas
build step by step
Having good ideas is hard, that’s why we chose to rely on your ideas (they’re much better than ours, aren’t they?). Our job is to blindly follow the two other rules, and we think that we’re doing that quite well according to what we got so far:
Deep in my heart I feel that I agree with them…
Testing it on the preview site¶
MultiValueDictKeyError: ‘uuid’ after reading a beid card.
After merging two persons, Lino says “Kann Klient XYZ (2248) nicht löschen weil 52 Anwesenheiten darauf verweisen.”. That’s normal. You should not merge Persons as long as one of them is also a client because Lino won’t merge the client-specific slave tables. But when deleting the person, it will also want to delete the client, and that won’t work because related data exists.