This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW "joined_batches_fieldmapperview_290" AS | |
SELECT T1_1.id AS id, | |
T1_1.added AS added, | |
T1_1.updated AS updated, | |
T1_1.notes AS notes, | |
T1_1.uid AS uid, | |
T1_1.relates_to_id AS relates_to_id, | |
T1_1.role_id AS role_id, | |
T1_1.row AS row, | |
T1_1.fields || coalesce(T1_2.fields, '{}'::JSONB) || coalesce(T1_3.fields, '{}'::JSONB) AS fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def import_regular_records( | |
self, role: VOSSRole, direction: Optional[str]): | |
"""Using list API, imports records for a non-relation role. | |
:param role: Selected role to import records for. | |
:param direction: Hierarchy traversal direction or `None` if the | |
default traversal behaviour is required. | |
""" | |
if direction == 'default': | |
direction = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l = [1, 2, 3, 4, 6, 7, 8, 10, 12] | |
ranges, last = [], None | |
for i in l: | |
if last is None or i - last > 1: | |
ranges.append([i, i]) | |
else: | |
ranges[-1][1] = i | |
last = i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH table_join AS ( | |
SELECT rowdex, "value", field_id FROM cucm_csv_batrepeatingfield | |
WHERE batdata_id = 10 AND role = 'phone' AND | |
((field_id = 327 AND value ILIKE '%US%') OR | |
(field_id = 295 AND value ILIKE '%10000%') OR | |
(field_id = 220 AND value ILIKE '%Cu1%'))), | |
sort_join AS ( | |
SELECT s0.rowdex, "Directory Number", "Route Partition" FROM | |
(SELECT DISTINCT table_join.rowdex, table_join.value as "Directory Number" FROM table_join WHERE table_join.field_id = 295) AS s0 FULL OUTER JOIN | |
(SELECT DISTINCT table_join.rowdex, table_join.value as "Route Partition" FROM table_join WHERE table_join.field_id = 220) AS s1 ON s0.rowdex = s1.rowdex) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH table_join AS ( | |
SELECT row, value, field_id FROM cucm_csv_batentity | |
WHERE batdata_id = 10 AND role = 'phone' AND ((field_id = 2 AND value = 'Cisco 6921') OR (field_id = 1))), | |
add_table_join AS ( | |
SELECT row, value, field_id from cucm_csv_batadditional | |
WHERE batdata_id = 10 AND role = 'phone' AND ((field_id = 2 AND value != '') OR (field_id = 1 AND value != ''))), | |
add_sort_join AS ( | |
SELECT a0.row, "Import Notes", "Import Date" FROM | |
(SELECT DISTINCT add_table_join.row, add_table_join.value as "Import Notes" FROM add_table_join WHERE add_table_join.field_id = 2) AS a0 INNER JOIN | |
(SELECT DISTINCT add_table_join.row, add_table_join.value as "Import Date" FROM add_table_join WHERE add_table_join.field_id = 1) AS a1 ON a0.row = a1.row), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cursor.execute(textwrap.dedent(''' | |
DROP TABLE IF EXISTS repeating; | |
CREATE TEMPORARY TABLE repeating ON COMMIT DROP | |
AS SELECT | |
{bat}.row, {cucm}.used_for, {bat}.field_id, {bat}.index | |
FROM {bat} INNER JOIN {cucm} ON | |
{cucm}.system_type = %s AND | |
{bat}.field_id = {cucm}.id | |
WHERE {bat}.row IN %s AND {cucm}.used_for IN %s {index} | |
''')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Implements manager with "UPDATE .. RETURNING" clause support. Columns following | |
the "RETURNING" clause may be provided using `values_list()` method. If not | |
specified, the update statement will yield full records. | |
Queries executed with use of `UpdateReturningManager` or | |
`UpdateReturningDefaultManager` return a generator allowing easy iterating over | |
the returned entries. | |
Based on https://github.com/kanu/django-update-returning, with modifications to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asdasd asasd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save_configuration(): | |
''' | |
Saves program configuration in the `config` module to a JSON file specified | |
via `config.general.CONFIG_PATH`. The function will skip any configuration | |
directives not listed in the provided `_ADJUSTABLE` lists. | |
''' | |
log.info('Saving program configuration.') | |
configuration = {} | |
# Get all section classes in the `config` module. | |
sections = inspect.getmembers(config, inspect.isclass) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Apr 10 09:38:05 mtcdp user.info kernel: usb 1-1: USB disconnect, address 100 | |
Apr 10 09:38:08 mtcdp user.info kernel: usb 1-1: new full speed USB device using at91_ohci and address 101 | |
Apr 10 09:38:13 mtcdp user.err kernel: usb 1-1: device not accepting address 101, error -62 | |
Apr 10 09:38:13 mtcdp user.err kernel: hub 1-0:1.0: unable to enumerate USB device on port 1 | |
Apr 10 09:38:14 mtcdp user.info kernel: usb 1-1: new full speed USB device using at91_ohci and address 103 | |
Apr 10 09:38:14 mtcdp user.info kernel: usb 1-1: New USB device found, idVendor=1bc7, idProduct=0021 | |
Apr 10 09:38:14 mtcdp user.info kernel: usb 1-1: New USB device strings: Mfr=18, Product=19, SerialNumber=20 | |
Apr 10 09:38:14 mtcdp user.info kernel: usb 1-1: Product: Telit Wireless Module | |
Apr 10 09:38:14 mtcdp user.info kernel: usb 1-1: Manufacturer: Telit wireless solutions | |
Apr 10 09:38:14 mtcdp user.info kernel: usb 1-1: SerialNumber: 351579051972428 |
NewerOlder