Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
nicknames
: Nicknames¶
The lino_xl.lib.nicknames
plugin adds functionality for managing
nicknames.
Table of contents:
Note
Code snippets in this document (lines starting with >>>
) get tested
as part of our development workflow. The following
initialization snippet tells you which demo project is being used.
>>> from lino_book.projects.noi1e.startup import *
>>> ses = rt.login("robin")
>>> translation.activate('en')
Usage¶
When adding this plugin to your application, you must specify the
nicknames.named_model
.
Plugin configuration¶
- nicknames.named_model¶
The model that gets a nickname field.
The application developer defines this as a string referring to the model that should receive the
my_nickname
field. During startup. Lino resolves this into the actual model class.
Namings¶
- class lino_xl.lib.nicknames.Naming¶
Django model used to represent a nicknaming.
That is, for storing the nickname used by a given user for a given database row.
Inherits from UserAuthored
- named¶
The nameable object being named.
- user¶
The user who is using this niackname.
- nickname¶
The nickname given
Welcome messages¶
This plugin adds a welcome message “Your nicknamed Tickets are X, Y,
…” that mentions all Tickets for which the requesting user has given a
nickname. (Replace “Tickets” with the verbose_name_plural
of
your nicknames.named_model
).
Nameables¶
- class lino_xl.lib.nicknames.Nameable¶
This model mixin adds the editable virtual field
my_nickname
- my_nickname¶
The nickname given to this database row by the current user.
Setting this to blank will remove the nicknaming.