本文整理汇总了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)
开发者ID:berinhard,项目名称:model_mommy,代码行数:13,代码来源:test_recipes.py
示例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
)
开发者ID:lucassimon,项目名称:model_mommy,代码行数:16,代码来源:test_recipes.py
示例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,
开发者ID:renatooliveira,项目名称:model_mommy,代码行数:31,代码来源:mommy_recipes.py
示例4: gen_time
def gen_time():
return now().time()
开发者ID:VerosK,项目名称:model_mommy,代码行数:2,代码来源:generators.py
示例5: gen_datetime
def gen_datetime():
return now()
开发者ID:VerosK,项目名称:model_mommy,代码行数:2,代码来源:generators.py
示例6: gen_date
def gen_date():
return now().date()
开发者ID:VerosK,项目名称:model_mommy,代码行数:2,代码来源:generators.py
注:本文中的model_mommy.timezone.now函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论