Commit graph

3431 commits

Author SHA1 Message Date
Lance Edgar 6ae5bd11f0 Add ScheduledShift model to schema
Also add some convenience methods to `WorkedShift`, for time sheet display.
2016-04-28 18:13:54 -05:00
Lance Edgar 7883fe1d5e Add time.get_sunday() convenience function 2016-04-28 18:12:28 -05:00
Lance Edgar d805698af0 Add RattailConfig.workdir() convenience method 2016-04-28 18:10:23 -05:00
Lance Edgar 4a72bf6927 Update changelog 2016-04-26 14:29:43 -05:00
Lance Edgar 17eebdee7d Tweak default behavior for importer-based datasync consumer
Add `host_object` kwarg to `process_change()` method; make that and the
`invoke_importer()` method return the (final) local object where
relevant/possible.
2016-04-26 14:27:22 -05:00
Lance Edgar ad9ef92b9e Update changelog 2016-04-26 12:59:50 -05:00
Lance Edgar 8bf65d286d Tweak when we add new data instance to session, to avoid premature flushes 2016-04-26 12:58:42 -05:00
Lance Edgar 9db47cc5b0 Update changelog 2016-04-25 19:48:01 -05:00
Lance Edgar f528e871b1 Add bulk Rattail importer, plus various tweaks
Tweaks are mostly for the sake of a `host_session`, if one is involved.
2016-04-25 19:39:03 -05:00
Lance Edgar d4707a80cc Add WorkedShift data model to schema, importer 2016-04-25 19:37:59 -05:00
Lance Edgar 176fb8e4c1 Update changelog 2016-04-24 17:29:44 -05:00
Lance Edgar 3459876c00 Add invoke_importer() method to datasync import consumers
Also tweak `process_change()` to allow caller to specify host data.
2016-04-23 20:11:35 -05:00
Lance Edgar 0099e54bc1 Fix setup bug in bulk Postgres importer 2016-04-23 16:00:13 -05:00
Lance Edgar cc5840deb4 Add initial begin/rollback/commit abstraction to import handlers
Hopefully lets each handler define local/host behavior as needed.
2016-04-22 18:35:02 -05:00
Lance Edgar 8adc8caf4e Alter make_utc() function to allow returning zone-aware time 2016-04-22 17:20:27 -05:00
Lance Edgar 82c3e173bb Add data kwarg to Importer.cache_instance_data() method
This was needed for a POS transaction importer, so it could auto-filter
local data based on date range which was derived from host data.
2016-04-21 22:39:55 -05:00
Lance Edgar 5c28719f8b Provide method by which importers may prevent create/update/delete
One needn't pass flags on command line to invoke default behavior.
2016-04-21 22:38:49 -05:00
Lance Edgar 295f2d53c4 Add multi-batch change transaction support for datasync consumers
Otherwise it was possible for the rattail transaction to fall out of
sync from consumer, if it was committing more often than us.
2016-04-21 19:26:28 -05:00
Lance Edgar d7cb42a98b Add RattailConfig.production() method
Convenience to differentiate when running in production mode.
2016-04-21 17:51:39 -05:00
Lance Edgar 5db81bfe79 Add --start-date and --end-date args to importer command
Also stash the args in the importer, so extra args are always available.
2016-04-21 17:36:47 -05:00
Lance Edgar a3c4921270 Add base importer and handler for PostgreSQL "bulk copy" importing 2016-04-21 13:41:43 -05:00
Lance Edgar 739629eab9 Add model_mapper and model_table attributes to base importer class 2016-04-21 13:41:37 -05:00
Lance Edgar 2cfa543e05 Add Consumer.setup() method for datasync 2016-04-21 13:33:22 -05:00
Lance Edgar 01357e7164 Stop assuming handler will return changes from import 2016-04-21 13:33:01 -05:00
Lance Edgar 3564178d8d Add config.parse_bool() function
For those generic needs...
2016-04-21 13:32:17 -05:00
Lance Edgar 9ff8f9ca11 Skip data sync for "empty" host record, in importer-based consumers
I.e. if the importer normalizes the host record to `None`, there is no
need to sync to the local system.
2016-04-18 09:52:59 -05:00
Lance Edgar 9d72f723e8 Add Watcher.setup() method for datasync 2016-04-18 09:49:15 -05:00
Lance Edgar 9c487a7a33 Add add_mail_alias() fabric function 2016-04-14 17:19:34 -05:00
Lance Edgar 5b0dfd2ee8 Update changelog 2016-04-12 14:27:24 -05:00
Lance Edgar 1ef8f1ec7c Fix bug where usedb flag wasn't being set from make_config()
Whatever was in the config file would override what was passed in.
2016-04-07 00:11:48 -05:00
Lance Edgar c4be67d6bf Update changelog 2016-04-06 11:45:44 -05:00
Lance Edgar c0a302b112 Fix bug in ProductCode importer when new records are created
Seems like this still could be better somehow...
2016-04-06 11:41:59 -05:00
Lance Edgar b6b41fcb9d Update changelog 2016-04-05 22:16:24 -05:00
Lance Edgar 4c602dc87e Fix config bug for recording changes in rattail db
Was turning ON the flag if the setting name was present at all.  Now we
interpret the setting value as a boolean instead.
2016-04-05 21:04:18 -05:00
Lance Edgar 8c662831bf Update changelog 2016-04-05 13:12:56 -05:00
Lance Edgar fa745e1a29 Fix rattail importer bugs, when updating local instance
Must track the instance returned by that method now.
2016-04-05 11:12:17 -05:00
Lance Edgar 374756dfa2 Add Importer.get_single_instance() for easier customization
That way `get_instance()` can keep checking the cache, then fallback to
this new method.
2016-03-24 21:37:08 -05:00
Lance Edgar 84ef87d183 Add deletion support to importer-based datasync 2016-03-23 23:59:10 -05:00
Lance Edgar 50c3c3c27f Add handler convenience when defining importers for datasync consumer 2016-03-23 23:59:10 -05:00
Lance Edgar b2581bcf00 Skip change if host instance not found, in importer-based datasync 2016-03-23 23:59:10 -05:00
Lance Edgar a8386400bb Add mechanism to record changes only for sessions on certain engines
Finally!
2016-03-23 23:59:10 -05:00
Lance Edgar 80f7caf3a5 Remove some unwanted logging noise 2016-03-23 23:59:07 -05:00
Lance Edgar 41d4c20348 Tweak unicode rendering of User objects 2016-03-23 23:52:09 -05:00
Lance Edgar f184f7f30f Add host session to main transaction, when importing from SQLAlchemy
Not really the same transaction, but you get the idea.
2016-03-23 23:50:58 -05:00
Lance Edgar 80ceb09b60 Fix bug in User model importer 2016-03-23 23:49:45 -05:00
Lance Edgar db4708962a Tweak logging when recording a data change 2016-03-22 17:54:02 -05:00
Lance Edgar 509014826f Make a copy of the RecordRenderer class for new importer framework
I'm still not so sure about this whole 'record renderer' concept, but
for now at least wanted to stop relying on the old 'importing' package.
Still have one place left, the 'import-csv' command...
2016-03-21 15:21:12 -05:00
Lance Edgar f7fa9a812b Add new importer-based datasync consumer class
Yay, I'm really hoping this simplifies things going forward.  Ideally
one should only have to define the real data mapping logic once, in the
importer.  The datasync consumer should then lean on that "entirely".
2016-03-21 15:15:50 -05:00
Lance Edgar d734f658e2 Improve the core importer class to better allow non-SQLAlchemy targets
I.e. stop forcing the 'local' data update process to use the Rattail
session, etc.  This commit also improves the default progress message.
2016-03-21 15:14:39 -05:00
Lance Edgar 281f33990f Tweak import warnings email template
Improve some styles, and embed the actual host and local title strings
in the summary paragraph.
2016-03-21 15:12:10 -05:00