Search Mitglieder¶
For validation of the search parameters the following class is used:
-
class
SearchSchema
(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]¶ Base class for search parameters
You could just use
json.dumps()
on a dictionary to create the search string but this would bypass all the type and spell checking.This also takes care of the miss-spelled search key
'mitgliedsNummber'
so that the user of this API can use the correct spelling.Example
from pynami.search import SearchSchema searchKeys = {'vorname': 'Max', 'nachname': 'Mustermann'} searchedValues = SearchSchema().dumps(searchKeys, separators=(',', ':')) print(searchedValues)
from pynami.tools import tabulate2x from pynami.nami import NaMi with NaMi(username='MITGLIEDSNUMMER', password='PASSWORD') as nami: searchResults = nami.search(untergliederungId=[1,2]) print(tabulate2x(searchResults))
-
__model__
¶ alias of
pynami.schemas.base.BaseModel
-
Search Keys¶
-
SearchSchema.
withEndedTaetigkeiten
¶ Whether to search also in activities that have already ended
Type: bool
Restrict search to some group or level¶
There are two way to search only in a specified group or level which are mutually exclusive: