from models import Account
from segue.purchase.models import Purchase
from segue.filters import FilterStrategies

class AccountFilterStrategies(FilterStrategies):

    def by_id(self, value):
        return Account.id == value

    def by_email(self, value):
        return Account.email.ilike('%'+value+'%')

    def by_name(self, value):
        return Account.name.ilike('%'+value+'%')

    def by_document(self, value):
        return Account.document.like('%'+value+'%')

    def by_product_id(self, value):
        return Purchase.product_id == value

    def by_purchase_id(self, value):
        return Purchase.id == value

    def join_for_purchase_id(self, queryset, needle=None):
        return queryset.join('purchases')

    def join_for_product_id(self, queryset, needle=None):
        return queryset.join('purchases')
a1087b680ee6d841fedac4b0f938673192e36ad3
<mask token>


class AccountFilterStrategies(FilterStrategies):
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def by_product_id(self, value):
        return Purchase.product_id == value
    <mask token>
    <mask token>
    <mask token>

<mask token>


class AccountFilterStrategies(FilterStrategies):
    <mask token>

    def by_email(self, value):
        return Account.email.ilike('%' + value + '%')
    <mask token>
    <mask token>

    def by_product_id(self, value):
        return Purchase.product_id == value
    <mask token>
    <mask token>
    <mask token>

<mask token>


class AccountFilterStrategies(FilterStrategies):
    <mask token>

    def by_email(self, value):
        return Account.email.ilike('%' + value + '%')
    <mask token>

    def by_document(self, value):
        return Account.document.like('%' + value + '%')

    def by_product_id(self, value):
        return Purchase.product_id == value

    def by_purchase_id(self, value):
        return Purchase.id == value
    <mask token>

    def join_for_product_id(self, queryset, needle=None):
        return queryset.join('purchases')

<mask token>


class AccountFilterStrategies(FilterStrategies):

    def by_id(self, value):
        return Account.id == value

    def by_email(self, value):
        return Account.email.ilike('%' + value + '%')
    <mask token>

    def by_document(self, value):
        return Account.document.like('%' + value + '%')

    def by_product_id(self, value):
        return Purchase.product_id == value

    def by_purchase_id(self, value):
        return Purchase.id == value

    def join_for_purchase_id(self, queryset, needle=None):
        return queryset.join('purchases')

    def join_for_product_id(self, queryset, needle=None):
        return queryset.join('purchases')

from models import Account
from segue.purchase.models import Purchase
from segue.filters import FilterStrategies

class AccountFilterStrategies(FilterStrategies):

    def by_id(self, value):
        return Account.id == value

    def by_email(self, value):
        return Account.email.ilike('%'+value+'%')

    def by_name(self, value):
        return Account.name.ilike('%'+value+'%')

    def by_document(self, value):
        return Account.document.like('%'+value+'%')

    def by_product_id(self, value):
        return Purchase.product_id == value

    def by_purchase_id(self, value):
        return Purchase.id == value

    def join_for_purchase_id(self, queryset, needle=None):
        return queryset.join('purchases')

    def join_for_product_id(self, queryset, needle=None):
        return queryset.join('purchases')