Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Custom QuerySet cancels goodjson #269

Open
SteffRainville opened this issue Apr 11, 2021 · 0 comments
Open

Custom QuerySet cancels goodjson #269

SteffRainville opened this issue Apr 11, 2021 · 0 comments

Comments

@SteffRainville
Copy link

If I add a custom QuerySet to a document, the output of document.objects is no longer filtered by goodjson

class SessionQuerySet(me.QuerySet):
    def context(self, session):
        f = session['farm_id']
        return self.filter(farm_id=f)


class WinterDocument(gj.Document):
    farm_id = me.ReferenceField('Farm', required=True, reverse_delete_rule=me.NULLIFY)
    meta = {"abstract": True, 'queryset_class': SessionQuerySet}


{"_id": {"$oid": "6071bbe055bc494c8227898e"}, "farm_id": {"$oid": "6071bbe055bc494c82278985"}, "name": "Vegetative - Baril 1", "ph": 5.8, "phMin": 5.6, "phMax": 6.2, "ec": 1800.0, "ecMin": 1600.0, "ecMax": 2001.0}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant