django_any/models.py
def any_date_field(field, **kwargs):
    """
    Return random value for DateField,
    skips auto_now and auto_now_add fields

    >>> result = any_field(models.DateField())
    >>> type(result)
    <type 'datetime.date'>
    """
    if field.auto_now or field.auto_now_add:
        return None
    from_date = kwargs.get('from_date', date(1990, 1, 1))
    to_date = kwargs.get('to_date', date.today())
    return xunit.any_date(from_date=from_date, to_date=to_date)
def any_date_field(field, **kwargs):
    """
    Return random value for DateField,
    skips auto_now and auto_now_add fields

    >>> result = any_field(models.DateField())
    >>> type(result)
    <type 'datetime.date'>
    """
    if field.auto_now or field.auto_now_add:
        return None
    from_date = kwargs.get('from_date', date(1990, 1, 1))
    to_date = kwargs.get('to_date', date.today())
    return xunit.any_date(from_date=from_date, to_date=to_date)
def any_date_field ( field , * * kwargs ) : if field . auto_now or field . auto_now_add : return None from_date = kwargs . get ( 'from_date' , date ( 1990 , 1 , 1 ) ) to_date = kwargs . get ( 'to_date' , date . today ( ) ) return xunit . any_date ( from_date = from_date , to_date = to_date )
Return random value for DateField,
    skips auto_now and auto_now_add fields

    >>> result = any_field(models.DateField())
    >>> type(result)
    <type 'datetime.date'>
Return random value for DateField skips auto_now and auto_now_add fields >>> result = any_field ( models . DateField () ) >>> type ( result ) <type datetime . date >