Did I find the right examples for you? yes no

All Samples(178)  |  Call(125)  |  Derive(0)  |  Import(53)
A class to encapsulate handy functionality for lists of choices
for a Django model field.

Each argument to ``Choices`` is a choice, represented as either a
string, a two-tuple, or a three-tuple.

If a single string is provided, that string is used as the
database representation of the choice as well as the
human-readable presentation.
(more...)

src/b/a/batter-HEAD/batter/music/models.py   batter(Download)
from django.utils.translation import ugettext_lazy as _
 
from model_utils import Choices
from model_utils.models import TimeStampedModel
 
class MusicUpload(TimeStampedModel):
    release = models.ForeignKey('Release')
    torrent = models.OneToOneField('torrents.Torrent')
    format = Choices(('mp3', _('MP3')),
                     ('flac', _('FLAC')),
                     ('aac', _('AAC')),
                     ('ac3', _('AC3')),
                     ('dts', _('DTS')))
    bitrate = Choices(('192', _('192')),
class Release(TimeStampedModel):
    master = models.ForeignKey('Master')
    label = models.ForeignKey('Label', **optional)
    release_type = Choices(('album', _('Album')),
                           ('soundtrack', _('Soundtrack')),

src/d/j/django-payway-HEAD/payway/qiwi/models.py   django-payway(Download)
# -*- coding: UTF-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils import Choices
from payway.accounts.models import ResponsePayment
 
TERMINATION_CODES = Choices(
    (0, 'SUCCESS',_('0 Success')),
    (13, 'SERVER_IS_BUSY', _('13 Server is busy, please repeat your request later')),
    (150, 'AUTHORIZATION_ERROR', _('150 Authorization error (wrong login/password)  ')),
class Bill(ResponsePayment):
 
 
    STATUS = Choices(
        (50, 'MADE', _('50 Made')),
    )
    payment_system = _('Qiwi Wallet')
    status = models.PositiveSmallIntegerField(_('Status'), choices=STATUS)
    user = models.CharField(_('User phone number'), max_length=10)
    date = models.CharField(_('Billing date'), max_length=20)

src/c/r/crate.web-HEAD/crate/web/packages/models.py   crate.web(Download)
from django.utils.translation import ugettext_lazy as _
 
from model_utils import Choices
from model_utils.fields import AutoCreatedField, AutoLastModifiedField
from model_utils.models import TimeStampedModel
class ReleaseFile(models.Model):
 
    TYPES = Choices(
        ("sdist", _("Source")),
        ("bdist_egg", "Egg"),
    release = models.ForeignKey(Release, related_name="files")
 
    type = models.CharField(max_length=25, choices=TYPES)
    file = models.FileField(upload_to=release_file_upload_to, storage=package_storage, max_length=512, blank=True)
    filename = models.CharField(max_length=200, help_text="This is the file name given to us by PyPI", blank=True, null=True, default=None)
class ReleaseRequire(models.Model):
 
    KIND = Choices(
        ("requires", "Requirement"),
        ("requires_dist", "Dist Requirement"),
    release = models.ForeignKey(Release, related_name="requires")
 
    kind = models.CharField(max_length=50, choices=KIND)
    name = models.CharField(max_length=150)
    version = models.CharField(max_length=50, blank=True)

src/m/o/moztrap-HEAD/moztrap/model/execution/models.py   moztrap(Download)
from django.db.models import Q, Count, Max
 
from model_utils import Choices
 
from ..mtmodel import MTModel, TeamModel, DraftStatusModel
class Result(MTModel):
    """A result of a User running a RunCaseVersion in an Environment."""
    STATUS = Choices("assigned", "started", "passed", "failed", "invalidated",
                     "blocked", "skipped")
    REVIEW = Choices("pending", "reviewed")
    environment = models.ForeignKey(Environment, related_name="results")
    status = models.CharField(
        max_length=50, db_index=True, choices=STATUS, default=STATUS.assigned)
    comment = models.TextField(blank=True)
    is_latest = models.BooleanField(default=True)
 
    review = models.CharField(
        max_length=50, db_index=True, choices=REVIEW, default=REVIEW.pending)

src/c/r/crate-site-HEAD/crateweb/apps/packages/models.py   crate-site(Download)
from django.utils.translation import ugettext_lazy as _
 
from model_utils import Choices
from model_utils.fields import AutoCreatedField, AutoLastModifiedField
from model_utils.models import TimeStampedModel
class ReleaseFile(models.Model):
 
    TYPES = Choices(
        ("sdist", _("Source")),
        ("bdist_egg", "Egg"),
    release = models.ForeignKey(Release, related_name="files")
 
    type = models.CharField(max_length=25, choices=TYPES)
    file = models.FileField(upload_to=release_file_upload_to, storage=package_storage, max_length=512, blank=True)
    filename = models.CharField(max_length=200, help_text="This is the file name given to us by PyPI", blank=True, null=True, default=None)
class ReleaseRequire(models.Model):
 
    KIND = Choices(
        ("requires", "Requirement"),
        ("requires_dist", "Dist Requirement"),
    release = models.ForeignKey(Release, related_name="requires")
 
    kind = models.CharField(max_length=50, choices=KIND)
    name = models.CharField(max_length=150)
    version = models.CharField(max_length=50, blank=True)

src/d/j/django-swingers-1.1.1/swingers/sauth/models.py   django-swingers(Download)
from swingers.utils.auth import make_nonce
 
from model_utils import Choices
 
from reversion import revision
class Job(models.Model):
    STATES = Choices("queued", "running", "completed")
    name = models.CharField(max_length=320, unique=True)
    args = models.TextField(null=True, blank=True)
    output = models.TextField(null=True, blank=True)
    state = models.CharField(choices=STATES, default=STATES.queued,
class ApplicationLink(models.Audit):
    AUTH_METHOD = Choices('basic', 'md5', 'sha1', 'sha224', 'sha256', 'sha384',
                          'sha512')
    client_name = models.CharField(
        max_length=320,
                                  help_text="Timeout of oauth tokens in "
                                            "seconds")
    auth_method = models.CharField(choices=AUTH_METHOD,
                                   default=AUTH_METHOD.sha256, max_length=20)
 

src/l/o/localshop-HEAD/localshop/apps/packages/models.py   localshop(Download)
from django.utils.functional import LazyObject
from django.utils.html import escape
from model_utils import Choices
from model_utils.fields import AutoCreatedField, AutoLastModifiedField
 
class ReleaseFile(models.Model):
 
    TYPES = Choices(
        ('sdist', 'Source'),
        ('bdist_egg', 'Egg'),
    size = models.IntegerField(null=True)
 
    filetype = models.CharField(max_length=25, choices=TYPES)
 
    distribution = models.FileField(upload_to=release_file_upload_to,

src/p/r/preciosa-HEAD/preciosa/precios/models.py   preciosa(Download)
from django.db.models.signals import post_save
from annoying.functions import get_object_or_None
from model_utils import Choices
from model_utils.fields import MonitorField
from model_utils.models import TimeStampedModel
    UNIDADES_PESO = [UM_GRAMO, UM_KILO]
    UNIDADES_VOLUMEN = [UM_ML, UM_L]
    UNIDADES_CHOICES = Choices(UM_GRAMO, UM_KILO, UM_ML, UM_L,
                               UM_UN, UM_M, UM_M2)
 
                                    null=True, blank=True)
    unidad_medida = models.CharField(max_length=10,
                                     choices=UNIDADES_CHOICES, null=True, blank=True)
    notas = models.TextField(null=True, blank=True)
    foto = ThumbnailerImageField(null=True, blank=True, upload_to='productos')

src/l/o/localshop-0.4.1/localshop/apps/packages/models.py   localshop(Download)
from django.utils.functional import LazyObject
from django.utils.html import escape
from model_utils import Choices
from model_utils.fields import AutoCreatedField, AutoLastModifiedField
 
class ReleaseFile(models.Model):
 
    TYPES = Choices(
        ('sdist', 'Source'),
        ('bdist_egg', 'Egg'),
    size = models.IntegerField(null=True)
 
    filetype = models.CharField(max_length=25, choices=TYPES)
 
    distribution = models.FileField(upload_to=release_file_upload_to,

src/c/r/crate.web-HEAD/crate/web/history/models.py   crate.web(Download)
 
from jsonfield import JSONField
from model_utils import Choices
from model_utils.models import TimeStampedModel
 
class Event(TimeStampedModel):
 
    ACTIONS = Choices(
            ("package_create", _("Package Created")),
            ("package_delete", _("Package Deleted")),
    version = models.CharField(max_length=512, blank=True)
 
    action = models.CharField(max_length=25, choices=ACTIONS)
 
    data = JSONField(null=True, blank=True)

  1 | 2 | 3 | 4 | 5 | 6  Next