当前位置: 首页>>代码示例>>Python>>正文


Python RegressionTestModel.save方法代码示例

本文整理汇总了Python中gae2django.models.RegressionTestModel.save方法的典型用法代码示例。如果您正苦于以下问题:Python RegressionTestModel.save方法的具体用法?Python RegressionTestModel.save怎么用?Python RegressionTestModel.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gae2django.models.RegressionTestModel的用法示例。


在下文中一共展示了RegressionTestModel.save方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_listproperty_save_restore

# 需要导入模块: from gae2django.models import RegressionTestModel [as 别名]
# 或者: from gae2django.models.RegressionTestModel import save [as 别名]
 def test_listproperty_save_restore(self):
     obj = TestModel()
     obj.xlist = ["foo", "bar", "baz"]
     obj.save()
     tobj = TestModel.get_by_id(obj.key().id())
     self.assertEqual(tobj, obj)
     self.assertEqual(tobj.xlist, ["foo", "bar", "baz"])
开发者ID:andialbrecht,项目名称:django-gae2django,代码行数:9,代码来源:test_datastore_model.py

示例2: test_filter_unicode

# 需要导入模块: from gae2django.models import RegressionTestModel [as 别名]
# 或者: from gae2django.models.RegressionTestModel import save [as 别名]
 def test_filter_unicode(self):  # issue22
     # This test passes with Python >= 2.6 either way.
     obj = TestModel()
     obj.xstring = 'foo'
     obj.save()
     query = db.GqlQuery((u'SELECT * FROM RegressionTestModel'
                          u' WHERE xstring = :foo'), foo=u'foo')
     self.assertEqual(query.count(), 1)
开发者ID:andialbrecht,项目名称:django-gae2django,代码行数:10,代码来源:test_gql.py

示例3: test_blobproperty_save_restore

# 需要导入模块: from gae2django.models import RegressionTestModel [as 别名]
# 或者: from gae2django.models.RegressionTestModel import save [as 别名]
 def test_blobproperty_save_restore(self):
     obj = TestModel()
     obj.blob = db.Blob("test")
     obj.save()
     tobj = TestModel.get_by_id(obj.key().id())
     self.assertEqual(tobj, obj)
     self.assertEqual(obj.blob, "test")
     self.assertEqual(tobj.blob, "test")
     self.assert_(isinstance(tobj.blob, db.Blob))
开发者ID:andialbrecht,项目名称:django-gae2django,代码行数:11,代码来源:test_datastore_model.py

示例4: test_auto_current_user_add

# 需要导入模块: from gae2django.models import RegressionTestModel [as 别名]
# 或者: from gae2django.models.RegressionTestModel import save [as 别名]
 def test_auto_current_user_add(self):
     c = Client()
     c.login(username='test', password='testpw')
     response = c.get('/')
     user = response.context['user']
     self.assert_(user is not None)
     obj = TestModel()
     obj.save()
     self.assertEqual(obj.xuser, user)
开发者ID:andialbrecht,项目名称:django-gae2django,代码行数:11,代码来源:test_datastore_model.py

示例5: test_user_property_patched

# 需要导入模块: from gae2django.models import RegressionTestModel [as 别名]
# 或者: from gae2django.models.RegressionTestModel import save [as 别名]
 def test_user_property_patched(self):
     c = Client()
     c.login(username='test', password='testpw')
     response = c.get('/')
     user = response.context['user']
     obj = TestModel()
     obj.save()
     self.assert_(callable(obj.xuser.email))
     self.assert_(hasattr(obj.xuser, 'nickname'))
     self.assert_(callable(obj.xuser.nickname))
开发者ID:factisresearch,项目名称:rietveld-docker,代码行数:12,代码来源:test_datastore_model.py

示例6: test_query_listproperty

# 需要导入模块: from gae2django.models import RegressionTestModel [as 别名]
# 或者: from gae2django.models.RegressionTestModel import save [as 别名]
 def test_query_listproperty(self):
     obj = TestModel()
     obj.xlist = ['foo', 'bar', 'baz']
     obj.save()
     query = db.GqlQuery(('SELECT * FROM RegressionTestModel'
                          ' WHERE xlist = :1'), 'foo')
     self.assertEqual([obj], list(query))
     self.assertEqual(query.count(), 1)
     tobj = query.get()
     self.assertEqual(tobj.xlist, ['foo', 'bar', 'baz'])
     query = db.GqlQuery(('SELECT * FROM RegressionTestModel'
                          ' WHERE xlist = :1'), 'nomatch')
     self.assertEqual([], list(query))
     self.assertEqual(query.count(), 0)
     tobj.xlist = ['bar', 'baz']
     tobj.save()
     query = db.GqlQuery(('SELECT * FROM RegressionTestModel'
                          ' WHERE xlist = :1'), 'foo')
     self.assertEqual([], list(query))
     self.assertEqual(query.count(), 0)
开发者ID:andialbrecht,项目名称:django-gae2django,代码行数:22,代码来源:test_gql.py

示例7: setUp

# 需要导入模块: from gae2django.models import RegressionTestModel [as 别名]
# 或者: from gae2django.models.RegressionTestModel import save [as 别名]
 def setUp(self):
     TestModel.objects.all().delete()
     for i in range(10):
         obj = TestModel()
         obj.xstring = 'foo%d' % i
         obj.save()
开发者ID:andialbrecht,项目名称:django-gae2django,代码行数:8,代码来源:test_db.py

示例8: test_dbwrite

# 需要导入模块: from gae2django.models import RegressionTestModel [as 别名]
# 或者: from gae2django.models.RegressionTestModel import save [as 别名]
 def test_dbwrite(self):
     # Note: This test mainly makes sense with PostgreSQL backend.
     obj = RegressionTestModel()
     obj.xstring = CallableString(u"möhrenbrei")
     obj.save()
开发者ID:andialbrecht,项目名称:django-gae2django,代码行数:7,代码来源:test_utils.py


注:本文中的gae2django.models.RegressionTestModel.save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。