Source code for snow.resource.fields.choice

from .text import Text
from .numeric import Numeric
from .base import BaseField

from ..query import BaseOperator


[docs]class ChoiceBase(BaseField):
[docs] def oneof(self, *values): """ All records in which the field is populated by the given values """ return self._segment(BaseOperator.ONEOF, ",".join(values))
[docs] def not_oneof(self, *values): """ All records in which the field is not populated by the given values """ return self._segment(BaseOperator.NOT_ONEOF, ",".join(values))
[docs]class NumericChoice(ChoiceBase, Numeric): pass
[docs]class TextChoice(ChoiceBase, Text): pass