本文整理汇总了Python中model_mommy.timezone.now函数的典型用法代码示例。如果您正苦于以下问题:Python now函数的具体用法?Python now怎么用?Python now使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了now函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
self.recipe_attrs = {
"name": "John Doe",
"nickname": "joe",
"age": 18,
"bio": "Someone in the crowd",
"birthday": now().date(),
"appointment": now(),
"blog": "http://joe.blogspot.com",
"wanted_games_qtd": 4,
"birth_time": now(),
}
self.person_recipe = Recipe(Person, **self.recipe_attrs)
示例2: setUp
def setUp(self):
self.recipe_attrs = {
'name': 'John Doe',
'nickname': 'joe',
'age': 18,
'bio': 'Someone in the crowd',
'birthday': now().date(),
'appointment': now(),
'blog': 'http://joe.blogspot.com',
'wanted_games_qtd': 4,
'birth_time': now()
}
self.person_recipe = Recipe(
Person,
**self.recipe_attrs
)
示例3: Recipe
from model_mommy.recipe import related
from model_mommy.timezone import now
from test.generic.models import TEST_TIME, Person, Dog, DummyDefaultFieldsModel, DummyUniqueIntegerFieldModel
from six import u
from datetime import timedelta
person = Recipe(Person,
name = 'John Doe',
nickname = 'joe',
age = 18,
bio = 'Someone in the crowd',
blog = 'http://joe.blogspot.com',
wanted_games_qtd = 4,
birthday = now().date(),
appointment = now(),
birth_time = now()
)
serial_person = Recipe(Person,
name = seq('joe'),
)
serial_numbers = Recipe(DummyDefaultFieldsModel,
default_decimal_field = seq(Decimal('20.1')),
default_int_field = seq(10),
default_float_field = seq(1.23)
)
serial_numbers_by = Recipe(DummyDefaultFieldsModel,
示例4: gen_time
def gen_time():
return now().time()
示例5: gen_datetime
def gen_datetime():
return now()
示例6: gen_date
def gen_date():
return now().date()