Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
noi2
: Noi with publisher and without accounting¶
>>> from lino_book.projects.noi2.startup import *
>>> walk_menu_items('robin', severe=False)
...
- Contacts --> Persons : 70
- Contacts --> Organizations : 15
- Contacts --> Partner Lists : 9
- Contacts --> Google contacts : 1
- Working time --> My Tickets : 10
- Working time --> Active tickets : 66
- Working time --> All tickets : 117
- Working time --> Unassigned Tickets : 8
- Working time --> Reference Tickets : 1
- Working time --> Tickets to work : 4
- Working time --> My sessions : 0
- Working time --> Worked hours : 7
- Working time --> Working contracts : 5
- Office --> My Notification messages : 38
- Office --> My Upload files : 3
- Office --> My Excerpts : 0
- Office --> My Comments : 111
- Office --> Recent comments : 758
- Office --> Data problem messages assigned to me : 3
- Publisher --> My Blog entries : 6
- Publisher --> Pages : 55
- Publisher --> Sources : 7
- Polls --> My Polls : 1
- Polls --> My Responses : 1
- Calendar --> My appointments : 15
- Calendar --> Overdue appointments : 1
- Calendar --> My unconfirmed appointments : 7
- Calendar --> My tasks : 1
- Calendar --> My guests : 1
- Calendar --> My presences : 1
- Calendar --> My overdue appointments : 1
- Calendar --> Upcoming events : 7
- Calendar --> Calendar : (not tested)
- Configure --> System --> Site configuration : (not tested)
- Configure --> System --> Users : 8
- Configure --> System --> Teams : 4
- Configure --> System --> System tasks : 12
- Configure --> Contacts --> Legal forms : 17
- Configure --> Contacts --> Functions : 6
- Configure --> Contacts --> List Types : 4
- Configure --> Topics --> Topics : 6
- Configure --> Working time --> Ticket types : 5
- Configure --> Working time --> Session Types : 2
- Configure --> Working time --> Reporting rules : 1
- Configure --> Working time --> Working contracts : 5
- Configure --> Office --> Library volumes : 4
- Configure --> Office --> Upload types : 1
- Configure --> Office --> Excerpt Types : 2
- Configure --> Office --> Comment Types : 1
- Configure --> Publisher --> Blog Entry Types : 1
- Configure --> Publisher --> Special pages : 8
- Configure --> Publisher --> Albums : 13
- Configure --> Publisher --> Licenses : 3
- Configure --> Publisher --> Authors : 6
- Configure --> Polls --> Choice sets : 9
- Configure --> Calendar --> Calendars : 2
- Configure --> Calendar --> Rooms : 1
- Configure --> Calendar --> Recurring events : 16
- Configure --> Calendar --> Guest roles : 1
- Configure --> Calendar --> Calendar entry types : 7
- Configure --> Calendar --> Recurrency policies : 7
- Configure --> Calendar --> Remote Calendars : 1
- Configure --> Calendar --> Planner rows : 3
- Configure --> Places --> Countries : 11
- Configure --> Places --> Places : 82
- Explorer --> System --> content types : 91
- Explorer --> System --> Authorities : 1
- Explorer --> System --> User types : 5
- Explorer --> System --> User roles : 41
- Explorer --> System --> Third-party authorizations : 1
- Explorer --> System --> Changes : 0
- Explorer --> System --> Notification messages : 261
- Explorer --> System --> All dashboard widgets : 1
- Explorer --> System --> User statistics : 37
- Explorer --> System --> Group memberships : 8
- Explorer --> System --> Background procedures : 11
- Explorer --> System --> Data checkers : 15
- Explorer --> System --> Data problem messages : 5
- Explorer --> Contacts --> Contact persons : 4
- Explorer --> Contacts --> Partners : 84
- Explorer --> Contacts --> List memberships : 84
- Explorer --> Contacts --> Address types : 6
- Explorer --> Contacts --> Addresses : 109
- Explorer --> Contacts --> Contact detail types : 6
- Explorer --> Contacts --> Contact details : 6
- Explorer --> Topics --> Tags : 118
- Explorer --> Topics --> Interests : 1
- Explorer --> Working time --> Ticket states : 9
- Explorer --> Working time --> Checks : 1
- Explorer --> Working time --> Nicknamings : 22
- Explorer --> Working time --> Working sessions : 2352
- Explorer --> Working time --> User summaries : 1092
- Explorer --> Working time --> Reporting types : 2
- Explorer --> Office --> Upload files : 23
- Explorer --> Office --> Upload areas : 1
- Explorer --> Office --> Excerpts : 0
- Explorer --> Office --> Mentions : 234
- Explorer --> Office --> Comments : 759
- Explorer --> Office --> Reactions : 0
- Explorer --> Publisher --> Blog entries : 6
- Explorer --> Polls --> Polls : 1
- Explorer --> Polls --> Questions : 1
- Explorer --> Polls --> Choices : 36
- Explorer --> Polls --> Responses : 1
- Explorer --> Polls --> Answer Choices : 1
- Explorer --> Polls --> Answer Remarks : 1
- Explorer --> Calendar --> Calendar entries : 160
- Explorer --> Calendar --> Tasks : 1
- Explorer --> Calendar --> Presences : 1
- Explorer --> Calendar --> Subscriptions : 1
- Explorer --> Calendar --> Entry states : 6
- Explorer --> Calendar --> Presence states : 5
- Explorer --> Calendar --> Task states : 5
- Explorer --> Calendar --> Planner columns : 2
- Explorer --> Calendar --> Display colors : 26
- Explorer --> Calendar --> Agenda items : 58
- Explorer --> Google API --> Syncable contacts : 0
- Explorer --> Google API --> Syncable calendar entries : 0
- Explorer --> Google API --> Deleted contacts : 0
- Explorer --> Google API --> Deleted calendar entries : 0
- Explorer --> Google API --> Sync summaries : 0
- Site --> User sessions : ...
- Site --> About : (not tested)
Installed plugins¶
>>> for p in settings.SITE.installed_plugins:
... print("{}: {}".format(p.app_label, p))
lino: lino
printing: lino.modlib.printing(needed by lino.modlib.system)
system: lino.modlib.system(needs ['lino.modlib.printing'])
contenttypes: django.contrib.contenttypes(needed by lino.modlib.gfks)
gfks: lino.modlib.gfks(needs ['lino.modlib.system', 'django.contrib.contenttypes'])
help: lino.modlib.help(needs ['lino.modlib.system'])
office: lino.modlib.office(needed by lino_xl.lib.countries)
xl: lino_xl.lib.xl(needed by lino_xl.lib.countries)
countries: lino_xl.lib.countries(needed by lino_noi.lib.contacts, needs ['lino.modlib.office', 'lino_xl.lib.xl'])
contacts: lino_noi.lib.contacts(needs ['lino_xl.lib.countries', 'lino.modlib.system'])
social_django: social_django(needed by lino_noi.lib.users)
users: lino_noi.lib.users(needs ['lino.modlib.system', 'social_django'])
topics: lino_xl.lib.topics(needs ['lino_xl.lib.xl', 'lino.modlib.gfks'])
excerpts: lino_xl.lib.excerpts(needed by lino_noi.lib.tickets, needs ['lino.modlib.gfks', 'lino.modlib.printing', 'lino.modlib.office', 'lino_xl.lib.xl'])
memo: lino.modlib.memo(needed by lino.modlib.comments, needs ['lino.modlib.office', 'lino.modlib.gfks'])
comments: lino.modlib.comments(needed by lino_noi.lib.tickets, needs ['lino.modlib.memo'])
noi: lino_noi.lib.noi(needed by lino_noi.lib.tickets)
tickets: lino_noi.lib.tickets(needs ['lino_xl.lib.excerpts', 'lino.modlib.comments', 'lino_noi.lib.noi'])
nicknames: lino_xl.lib.nicknames
summaries: lino.modlib.summaries(needed by lino_xl.lib.working)
channels: channels(needed by lino.modlib.linod)
daphne: daphne(needed by lino.modlib.linod)
linod: lino.modlib.linod(needed by lino.modlib.checkdata)
checkdata: lino.modlib.checkdata(needed by lino_xl.lib.working, needs ['lino.modlib.users', 'lino.modlib.gfks', 'lino.modlib.office', 'lino.modlib.linod'])
working: lino_xl.lib.working(needs ['lino.modlib.summaries', 'lino.modlib.checkdata'])
lists: lino_xl.lib.lists
changes: lino.modlib.changes(needs ['lino.modlib.users', 'lino.modlib.gfks'])
notify: lino.modlib.notify(needs ['lino.modlib.users', 'lino.modlib.memo', 'lino.modlib.linod'])
uploads: lino.modlib.uploads
export_excel: lino.modlib.export_excel
tinymce: lino.modlib.tinymce(needs ['lino.modlib.office'])
smtpd: lino.modlib.smtpd
jinja: lino.modlib.jinja(needed by lino.modlib.weasyprint)
weasyprint: lino.modlib.weasyprint(needs ['lino.modlib.jinja'])
appypod: lino_xl.lib.appypod
dashboard: lino.modlib.dashboard(needs ['lino.modlib.users'])
inbox: lino_xl.lib.inbox(needs ['lino.modlib.comments'])
userstats: lino_xl.lib.userstats(needs ['lino.modlib.users'])
groups: lino_noi.lib.groups
bootstrap3: lino.modlib.bootstrap3(needed by lino.modlib.publisher, needs ['lino.modlib.jinja'])
publisher: lino.modlib.publisher(needed by lino_xl.lib.blogs, needs ['lino.modlib.system', 'lino.modlib.linod', 'lino.modlib.jinja', 'lino.modlib.bootstrap3'])
albums: lino_xl.lib.albums(needed by lino_xl.lib.blogs, needs ['lino.modlib.uploads'])
sources: lino_xl.lib.sources(needed by lino_xl.lib.blogs)
blogs: lino_xl.lib.blogs(needs ['lino.modlib.publisher', 'lino_xl.lib.topics', 'lino_xl.lib.albums', 'lino_xl.lib.sources'])
polls: lino_xl.lib.polls(needs ['lino_xl.lib.xl'])
cal: lino_noi.lib.cal(needs ['lino.modlib.gfks', 'lino.modlib.printing', 'lino_xl.lib.xl', 'lino_noi.lib.noi'])
agenda: lino_xl.lib.agenda(needs ['lino_xl.lib.checkdata'])
calview: lino_xl.lib.calview
about: lino.modlib.about
react: lino_react.react(needs ['lino.modlib.jinja'])
addresses: lino_xl.lib.addresses(needed by lino_xl.lib.google, needs ['lino.modlib.checkdata'])
phones: lino_xl.lib.phones(needed by lino_xl.lib.google)
google: lino_xl.lib.google(needs ['lino.modlib.users', 'lino_xl.lib.addresses', 'lino_xl.lib.phones'])
staticfiles: django.contrib.staticfiles
sessions: django.contrib.sessions
Language selector¶
>>> lang = settings.SITE.languages[1]
>>> lang
LanguageInfo(django_code='bn', name='bn', index=1, suffix='_bn')
>>> ar = rt.login(renderer=dd.plugins.publisher.renderer)
>>> publisher.Page.objects.get(pk=1)
Page #1 ('Home')
>>> ar = publisher.Pages.create_request(parent=ar, selected_pks=[1])
>>> print(ar.get_request_url(ul="bn"))
/p/1?ul=bn
Printable documents¶
We take the first meeting that has some agenda items, clear the cache, ask Lino to print it and check whether we get the expected response.
>>> ses = rt.login("robin")
>>> translation.activate('en')
>>> obj = agenda.Item.objects.first().meeting
>>> obj
Event #249 ('SynodalCon (12.05.2024 10:00)')
>>> obj.clear_cache()
>>> rv = ses.run(obj.do_print)
weasy2pdf render ['cal/Event/default.weasy.html'] ->
.../media/cache/weasy2pdf/cal.Event-249.pdf ('en', {})
>>> print(rv['success'])
True
>>> print(rv['open_url'])
/media/cache/weasy2pdf/cal.Event-249.pdf
>>> print(rv['message'])
Your printable document (<a href="...">cal.Event-249.pdf</a>) should now open in a new browser window. If it doesn't, please ask your system administrator.
Clear the print cache to tidy up:
>>> obj.clear_cache()
Don’t read this¶
Pages:
>>> rt.show('publisher.Pages', display_mode="grid", column_names="ref parent title language")
=========== ============ =============================== ==========
Reference Parent Title Language
----------- ------------ ------------------------------- ----------
index Home en
index হোম bn
index Startseite de
Terms and conditions en
Terms and conditions bn
Allgemeine Geschäftsbediungen de
Privacy policy en
Privacy policy bn
Datenschutz de
Cookie settings en
Cookie settings bn
Cookie settings de
Copyright en
Copyright bn
Autorenrecht de
About us en
About us bn
Über uns de
Home Blog en
হোম Blog bn
Startseite Blog de
Home Calendar en
হোম Calendar bn
Startseite Kalender de
Home Mission en
Home Maxim en
Home Propaganda en
Home About us en
About us Team en
About us History en
About us Contact en
About us Terms & conditions en
হোম Mission bn
হোম Maxim bn
হোম Propaganda bn
হোম About us bn
About us Team bn
About us History bn
About us Contact bn
About us Terms & conditions bn
Startseite Mission de
Startseite Maxim de
Startseite Propaganda de
Startseite Über uns de
Über uns Team de
Über uns History de
Über uns Kontakt de
Über uns Nutzungsbestimmungen de
SynodalCon
Cascaded Continuous Voting
Liquid democracy
Digital vs analog
Software should be free
Synodality
=========== ============ =============================== ==========
Ensure database state:
>>> for obj in linod.SystemTask.objects.all():
... obj.last_start_time = None
... obj.requested_at = None
... obj.disabled = False
... obj.save()
>>> from logging import getLevelName
>>> from asgiref.sync import async_to_sync
>>> bt = linod.SystemTask.objects.get(procedure=linod.Procedures.update_publisher_pages)
>>> bt.status
'Scheduled to run asap'
>>> ar = rt.login("robin")
>>> print(getLevelName(ar.logger.level))
INFO
>>> ar.logger.setLevel("DEBUG")
>>> print(getLevelName(ar.logger.level))
DEBUG
>>> ar.logger.handlers
[<StreamHandler (INFO)>, <AdminEmailHandler (ERROR)>]
>>> [getLevelName(h.level) for h in ar.logger.handlers]
['INFO', 'ERROR']
>>> ar.logger.handlers[0].setLevel("DEBUG")
>>> async_to_sync(bt.start_task)(ar)
Start System task #8 (update_publisher_pages) with logging level INFO
Update publisher pages...
54 pages have been updated.
Successfully terminated System task #8 (update_publisher_pages)
>>> bt.disabled
False
>>> bt.status
'Scheduled to run at ... (... from now)'
>>> bt = linod.SystemTask.objects.get(procedure=linod.Procedures.delete_older_changes)
>>> bt.status
'Scheduled to run asap'
‘Scheduled to run asap’ >>> async_to_sync(bt.start_task)(ar) Start System task #3 (delete_older_changes) with logging level INFO Successfully terminated System task #3 (delete_older_changes) >>> bt.disabled False >>> bt.status #doctest: +ELLIPSIS ‘Scheduled to run at … (… from now)’
>>> bt.run_now.run_from_ui(ar)
>>> bt.message
'Robin Rood requested to run this task at ....'
>>> bt.status
'Requested to run asap (since ... (...))'
Restore database state:
>>> for obj in linod.SystemTask.objects.all():
... obj.last_start_time = None
... obj.requested_at = None
... obj.disabled = False
... obj.save()
>>> dbhash.check_virgin()