Changeset bd2b0fb in rattail


Ignore:
Timestamp:
07/08/19 19:23:50 (7 months ago)
Author:
Lance Edgar <ledgar@…>
Branches:
master
Children:
d123391
Parents:
f5d8802
Message:

Fix main version query, to remove duplicate results

at least, i hope this just fixes that and breaks nothing else...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rattail/db/continuum.py

    rf5d8802 rbd2b0fb  
    141141        classes.append(cls)
    142142
    143     return query.filter(sa.or_(
    144             *[cls.uuid != None for cls in classes]))
     143    # TODO: i don't recall why we apply this filter, but presumably we'd
     144    # otherwise get some irrelevant results?  it seems to require at least one
     145    # of the model records be properly referenced by a version (?)
     146    query = query.filter(sa.or_(
     147        *[cls.uuid != None for cls in classes]))
     148
     149    # we may get multiple results for the same transaction, depending on which
     150    # child classes were involved etc.  this should set things straight
     151    query = query.distinct()
     152
     153    return query
Note: See TracChangeset for help on using the changeset viewer.