Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

General

doctest init:

>>> import lino
>>> lino.startup('lino_book.projects.voga1.settings')
>>> from lino.api.doctest import *
>>> print(analyzer.show_complexity_factors())
...
- 48 plugins
- 95 models
- 6 user types
- 356 views
- 32 dialog actions

The following caused an [ERROR ‘AnonymousUser’ object has no attribute ‘event_type’ in ‘[show cal.UpcomingEvents]’ at position 0-25] because the memo user, used by the parser is both an AnonymousUser and has user_type SiteAdmin. Lino was confused and tried to add a button for the ShowInsert action.

>>> html = dd.plugins.memo.parser.parse("[show cal.UpcomingEvents]")
>>> print(beautiful_soup(html).prettify())
<html>
 <body>
  <h1>
   Upcoming events (Dates 22.10.2020 to ...)
   <a href='javascript:Lino.cal.UpcomingEvents.grid.run(null,{
       "base_params": {  },
       "param_values": {
         "end_date": null, "event_type": null, "event_typeHidden": null,
         "room": null, "roomHidden": null, "start_date": "22.10.2020" } })'
      style="text-decoration:none;"
      title="Show this table in own window">

   </a>
  </h1>
  <table>
   <tbody>
    No data to display
   </tbody>
  </table>
 </body>
</html>

There were two more parameter fields expected in above code snippet before 20251129: presence_guest and user. These parameters were removed from UpcomingEvents because they aren’t meaningful for anonymous users (while UpcomingEvents is).

>>> cal.UpcomingEvents.params_layout.main
'start_date end_date event_type room project'