Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
lets2
: Second prototype of the LETS tutorial¶
Version 2 of the demo project used in The LETS tutorial. See explanations in Version 2.
>>> from lino_book.projects.lets2.startup import *
>>> walk_menu_items('robin')
- Market --> Products : 7
- Market --> Offers : 6
- Market --> Demands : 4
- Members --> Members : 10
- Office --> My Upload files : 1
- Configure --> Market --> Places : 5
- Configure --> System --> Members : 10
- Configure --> System --> Site configuration : (not tested)
- Configure --> Office --> Library volumes : 2
- Configure --> Office --> Upload types : 1
- Explorer --> Market --> Delivery units : 4
- Explorer --> System --> Authorities : 1
- Explorer --> System --> User types : 3
- Explorer --> System --> User roles : 4
- Explorer --> System --> content types : 14
- Explorer --> Office --> Mentions : 0
- Explorer --> Office --> Upload files : 3
- Explorer --> Office --> Upload areas : 1
- Site --> About : (not tested)
- Site --> User sessions : ...
User roles and permissions¶
>>> rt.show(users.UserTypes)
======= =========== ===============
value name text
------- ----------- ---------------
000 anonymous Anonymous
100 user User
900 admin Administrator
======= =========== ===============
Here is the UserRoles
table for our
application:
>>> rt.show(users.UserRoles)
...
==================== ===== ===== =====
Name 000 100 900
-------------------- ----- ----- -----
lets2.SiteAdmin ☑
lets2.SiteUser ☑
office.OfficeStaff ☑
office.OfficeUser ☑ ☑
==================== ===== ===== =====
>>> analyzer.show_db_overview()
15 plugins: lino, about, jinja, react, market, printing, system, users, office, contenttypes, gfks, memo, uploads, staticfiles, sessions.
13 models:
========================== ===================== ========= =======
Name Default table #fields #rows
-------------------------- --------------------- --------- -------
contenttypes.ContentType gfks.ContentTypes 3 13
market.Demand market.Demands 4 3
market.Offer market.Offers 8 5
market.Place market.Places 2 4
market.Product market.Products 6 6
memo.Mention memo.Mentions 5 0
sessions.Session users.Sessions 3 ...
system.SiteConfig system.SiteConfigs 3 0
uploads.Upload uploads.Uploads 12 2
uploads.UploadType uploads.UploadTypes 6 0
uploads.Volume uploads.Volumes 4 1
users.Authority users.Authorities 3 0
users.User users.AllUsers 21 9
========================== ===================== ========= =======
>>> analyzer.show_db_structure()
- contenttypes.ContentType : id, app_label, model
- market.Demand : id, customer, product, urgent
- market.Offer : id, body, body_short_preview, body_full_preview, provider, product, valid_until, price
- market.Place : id, name
- market.Product : id, body, body_short_preview, body_full_preview, name, delivery_unit
- memo.Mention : id, owner_type, owner_id, target_type, target_id
- sessions.Session : session_key, session_data, expire_date
- system.SiteConfig : id, default_build_method, simulate_today
- uploads.Upload : id, user, owner_type, owner_id, file, mimetype, file_size, upload_area, type, volume, library_file, description
- uploads.UploadType : id, name, upload_area, max_number, wanted, shortcut
- uploads.Volume : id, ref, root_dir, description
- users.Authority : id, user, authorized
- users.User : id, start_date, end_date, email, language, modified, created, password, last_login, username, user_type, initials, first_name, last_name, remarks, verification_password, verification_code, verification_code_sent_on, time_zone, date_format, place