Commit graph

2937 commits

Author SHA1 Message Date
Lance Edgar 8be4fd7b0a Simplify how certain "list" data is cleared, when importing to Rattail
this is the 2nd commit which tries to "fix" this use case, since apparently the
last "fix" didn't quite do it.  i wish i'd done a better job with its commit
message b/c now i don't recall the details behind that code diff..  anyway here
are the notes for this one:

i had an importer for Person which included 'email_address' field, and source
data had no email for a certain person, which meant it was to be cleared out of
the target (Rattail) side.  with the most recent changes in place, this was
sometimes working (it seemed?) but definitely sometimes not, in which case was
seeing an error like:

      File "/srv/envs/milo/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2533, in _flush
        assert _reg, "Failed to add object to the flush context!"
    AssertionError: Failed to add object to the flush context!

searching for that ultimately led me to this old ticket:
https://github.com/sqlalchemy/sqlalchemy/issues/4040

so then it looked like my approach to clearing out the list must be
wrong (since it was the only recent change which could explain the new error),
and i searched for "how it should be done" which sort of led me to this:
https://stackoverflow.com/a/29908201

and here we are
2020-10-14 18:57:32 -05:00
Lance Edgar 207aaf4419 Update changelog 2020-10-13 17:03:00 -05:00
Lance Edgar d36fd56e4b Allow datasync to export to rattail but *not* record changes
sometimes the "record changes" feature is desirable in all but 1 case, which is
real-time datasync, when such changes are "one way only" and have no need to
boomerang back to the originating system, and trying to do so can result in
misc. race conditions which are better avoided
2020-10-13 17:02:57 -05:00
Lance Edgar a2fd5fca23 Stop creating separate 'batch' folder for rattail make-appdir
that needs to exist underneath 'data' folder instead
2020-10-06 22:24:33 -05:00
Lance Edgar 8f1b2f1d96 Delay an import, for sake of windows 2020-10-06 22:19:35 -05:00
Lance Edgar 5eb0747d90 Stop trying to use win32 api to know "default config paths"
at least for now, let's not worry if "Python for Windows Extensions" is not
installed
2020-10-06 22:17:00 -05:00
Lance Edgar 2ac8f3a9ed Lower log level to avoid some nightly noise 2020-10-06 12:01:18 -05:00
Lance Edgar 879fc2f1e5 Log warning instead of assertion error, if runas_user doesn't exist
within context of X -> Rattail importer, in local/target session
2020-10-05 18:46:57 -05:00
Lance Edgar e18250faff Fix a downgrade bug in alembic migration
this probably never would have come up again, but did for me today
2020-10-03 21:28:07 -05:00
Lance Edgar 6fa69a8dc9 Update changelog 2020-10-02 19:33:30 -05:00
Lance Edgar 2dc05860e7 Make sure model extension tables are eagerly joined for Rattail importing
had several model importers which weren't inheriting base functionality
2020-10-02 19:05:19 -05:00
Lance Edgar 88ac8c491a Load "runas user" into current session, for X -> Rattail importers
in particular, this is helpful when assigning runas user as author of new
export records, etc.  otherwise runas user would be from other/stale session
2020-10-02 15:40:37 -05:00
Lance Edgar 7c9be5142d Fix how record associations are removed for rattail importing 2020-09-30 18:09:19 -05:00
Lance Edgar c378969357 Update changelog 2020-09-24 13:53:35 -05:00
Lance Edgar 11e4479fc4 Fix variable name bug in Excel report 2020-09-24 13:51:34 -05:00
Lance Edgar 74d707e8de Add "summary" sheet to Excel-based reports
show report name, params and allow arbitrary extra totals to show here
2020-09-23 19:47:56 -05:00
Lance Edgar 39c84183a3 Add methods to create new sheet, and toggle grid lines for ExcelWriter 2020-09-23 19:46:38 -05:00
Lance Edgar ad89d39bc1 Update changelog 2020-09-22 19:39:23 -05:00
Lance Edgar 8e4070a81b Turn on display of rattail deprecation warnings by default 2020-09-22 17:36:12 -05:00
Lance Edgar b71e75f77b Tweak a log message
so can actually track down the problem if desired
2020-09-21 22:28:52 -05:00
Lance Edgar cdad4e621a Add more flexible "extensions" mechanism for Rattail model importers
allows for multiple extensions on a given model
2020-09-21 18:10:55 -05:00
Lance Edgar 08854bda1d Use static default timezone for new 'fabric' project
instead of making that part of the generated code
2020-09-20 17:47:14 -05:00
Lance Edgar 8b38a14f31 Allow skipping tests when building new release 2020-09-19 16:14:47 -05:00
Lance Edgar 10f879dfc8 Update changelog 2020-09-19 16:12:09 -05:00
Lance Edgar 84b6099477 Add --no-password flag for rattail make-user command
so we can automatically create initial "system" users
2020-09-19 16:08:51 -05:00
Lance Edgar f3883ddc4f Fix email settings for diff warnings from rattail import-versions
per latest conventions
2020-09-19 16:06:03 -05:00
Lance Edgar a66dcc5db7 Give importer diff emails an automatic default subject
including host, local titles
2020-09-19 14:02:40 -05:00
Lance Edgar c890e0ba82 Add batch handler methods for writing, updating from worksheet
just stub methods, not implemented by default, but could be a useful pattern
2020-09-18 12:18:02 -05:00
Lance Edgar da9b5cbf31 Add makedirs kwarg for Batch.absolute_filepath() method 2020-09-18 11:16:02 -05:00
Lance Edgar 973e47ae51 Allow overriding column header labels when writing Excel file 2020-09-18 11:15:35 -05:00
Lance Edgar dbe907a87e Add default help URL for Theo installs 2020-09-18 11:15:19 -05:00
Lance Edgar 188bcc596c Include 'datadir' in config for theo installs 2020-09-16 22:29:47 -05:00
Lance Edgar d24a84f3bc Update changelog 2020-09-16 22:22:13 -05:00
Lance Edgar 8ea4084483 Do the apt upgrade by default, when bootstrapping theo server
this addresses at least one issue which i saw using vagrant/ubuntu, where the
'python3-venv' package wasn't available at first, but was after `apt update`
2020-09-16 21:37:20 -05:00
Lance Edgar 83cdad0130 Add support for generating a 'fabric' project
mostly for sake of simplifying Theo install
2020-09-16 20:51:37 -05:00
Lance Edgar 529475afac Always create 'data' dir when making app dir 2020-09-16 15:50:40 -05:00
Lance Edgar 827b312c98 Update changelog 2020-09-14 13:08:37 -05:00
Lance Edgar 25eb38e4ca Only call mkvirtualenv if the env is missing outright
b/c sometimes re-running that seems to just cause problems
2020-09-08 19:31:40 -05:00
Lance Edgar d69a67f3c5 More tweaks to generated project, for better Ubuntu support 2020-09-08 18:01:00 -05:00
Lance Edgar c2a1f226bf Require rattail-fabric2 by default, for new generated projects 2020-09-08 15:23:13 -05:00
Lance Edgar b4a14ef865 Improve lots more things about generating a new project
mostly for sake of Catapult integration example
2020-09-08 14:11:33 -05:00
Lance Edgar f3b31d490e Add "Catapult integration" support for generating new project 2020-09-06 19:59:14 -05:00
Lance Edgar 10a413fd1c Improve default web menus for generated project 2020-09-06 15:44:38 -05:00
Lance Edgar 2a2f201aac Fix some bugs in default generated project 2020-09-06 15:33:05 -05:00
Lance Edgar 5f68db5a9f Include more files when generating 'rattail' project
not sure why these weren't already included
2020-09-06 14:43:55 -05:00
Lance Edgar 53dff881a5 Add basic/incomplete support for generating new 'byjove' project
just wanted to get the placeholder in here for now
2020-09-06 13:52:16 -05:00
Lance Edgar cc38f85da7 Add handler/template for generating new rattail-based project
this was copied as-is from titeship
2020-09-06 12:25:33 -05:00
Lance Edgar 9c5fffb011 Update changelog 2020-09-02 13:42:46 -05:00
Lance Edgar e1ba4c6dcd Add Product.average_weight to schema
for sake of Mercato export
2020-09-02 13:37:31 -05:00
Lance Edgar f129a1bd48 Ignore bad UPC when reading products from file for label batch 2020-08-23 11:21:40 -05:00