Shell
check_membership(importer, name, record_id)
¶
A convenience function which checks if the given record ID is a member of the given view. If it isn't, the reason why is printed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
importer
|
DataImporter
|
a DataImporter instance |
required |
name
|
str
|
name of the view |
required |
record_id
|
Union[str, int]
|
record ID (can be int or str, we deal with it) |
required |
Source code in dataimporter/cli/shell.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
find_unsuitable_records(importer, view_name, skip_deleted=True)
¶
Finds and returns lists of records in a view that are no longer members or no longer match the publishing rules.Effectively a dry run of purge_unsuitable_records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
importer
|
DataImporter
|
a DataImporter instance |
required |
view_name
|
str
|
name of the view |
required |
skip_deleted
|
bool
|
whether to skip deleted records when iterating over mongo records (True, default), or return a report on these too (False) |
True
|
Returns:
| Type | Description |
|---|---|
Dict[str, List[Tuple[str, str]]]
|
a dict |
Source code in dataimporter/cli/shell.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
print_record_data(importer, name, record_id)
¶
A convenience function for printing record data from the given data store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
importer
|
DataImporter
|
a DataImporter instance |
required |
name
|
str
|
the store to look up the record ID in |
required |
record_id
|
Union[str, int]
|
a record ID (can be int or str, we deal with it) |
required |
Source code in dataimporter/cli/shell.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
setup_env(importer)
¶
Returns a dict of variables to made available in the maintenance shell.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
importer
|
DataImporter
|
a DataImporter instance |
required |
Returns:
| Type | Description |
|---|---|
dict
|
a dict |
Source code in dataimporter/cli/shell.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |