labapi.entry.entries.unknown.UnknownEntry#
- class labapi.entry.entries.unknown.UnknownEntry( )[source]#
-
Fallback entry wrapper for unknown upstream part types.
Methods
__init__(eid, data, user, *, part_type)Initialize an unknown entry wrapper.
class_of(part_type)Return the registered entry class for
part_type.from_part_type(part_type, eid, data, user)Create an entry instance for a LabArchives part type.
is_registered(part_type)Return whether an entry class is registered for
part_type.Attributes
Return the raw entry payload.
Return the original upstream part type.
Return the unique identifier of the entry.
- static class_of(
- part_type: str,
Return the registered entry class for
part_type.
- static from_part_type( ) Entry[Any]#
Create an entry instance for a LabArchives part type.
This method takes a part type string and returns the corresponding entry class instance when one is registered. Recognized-but-unimplemented part types resolve to
UnimplementedEntry, while truly unknown part types fall back toUnknownEntry.- Parameters:
part_type – The type of entry to create (e.g., “heading”, “text entry”, “plain text entry”, “attachment”, “widget entry”).
eid – The unique ID of the entry.
data – The entry data. For text-based entries, this is the text content. For attachment entries, this is the caption.
user – The authenticated user associated with this entry.
- Returns:
An entry instance of the appropriate type.