Python google.appengine.ext.db.IntegerProperty() Examples

The following are 7 code examples of google.appengine.ext.db.IntegerProperty(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module google.appengine.ext.db , or try the search function .
Example #1
Source File: db.py    From jbox with MIT License 5 votes vote down vote up
def get_IntegerField(kwargs):
    """
    Returns an ``IntegerField``, applying the ``db.IntegerProperty`` range
    limits.
    """
    v = validators.NumberRange(min=-0x8000000000000000, max=0x7fffffffffffffff)
    kwargs['validators'].append(v)
    return f.IntegerField(**kwargs) 
Example #2
Source File: db.py    From jbox with MIT License 5 votes vote down vote up
def convert_IntegerProperty(model, prop, kwargs):
    """Returns a form field for a ``db.IntegerProperty``."""
    return get_IntegerField(kwargs) 
Example #3
Source File: db.py    From RSSNewsGAE with Apache License 2.0 5 votes vote down vote up
def get_IntegerField(kwargs):
    """
    Returns an ``IntegerField``, applying the ``db.IntegerProperty`` range
    limits.
    """
    v = validators.NumberRange(min=-0x8000000000000000, max=0x7fffffffffffffff)
    kwargs['validators'].append(v)
    return f.IntegerField(**kwargs) 
Example #4
Source File: db.py    From RSSNewsGAE with Apache License 2.0 5 votes vote down vote up
def convert_IntegerProperty(model, prop, kwargs):
    """Returns a form field for a ``db.IntegerProperty``."""
    return get_IntegerField(kwargs) 
Example #5
Source File: db.py    From googleapps-message-recall with Apache License 2.0 5 votes vote down vote up
def get_IntegerField(kwargs):
    """
    Returns an ``IntegerField``, applying the ``db.IntegerProperty`` range
    limits.
    """
    v = validators.NumberRange(min=-0x8000000000000000, max=0x7fffffffffffffff)
    kwargs['validators'].append(v)
    return f.IntegerField(**kwargs) 
Example #6
Source File: db.py    From googleapps-message-recall with Apache License 2.0 5 votes vote down vote up
def convert_IntegerProperty(model, prop, kwargs):
    """Returns a form field for a ``db.IntegerProperty``."""
    return get_IntegerField(kwargs) 
Example #7
Source File: djangoforms.py    From python-compat-runtime with Apache License 2.0 5 votes vote down vote up
def get_form_field(self, **kwargs):
    """Return a Django form field appropriate for an integer property.

    This defaults to an IntegerField instance.
    """
    defaults = {'form_class': forms.IntegerField}
    defaults.update(kwargs)
    return super(IntegerProperty, self).get_form_field(**defaults)