2008/08/24
2008/08/23
2008/08/13
Tutorial - Create a Simple Blog using GAEO
We still keep working on GAEO and its latest release is 'trunk-r68'.
In this release, we also provides a simple tutorial to describe how you can use GAEO to create a simple blog. Please visit here and give us any suggestions and comments. The sample could be downloaded from the GAEO's project site.
Please keep watching the GAEO project. Thanks!
In this release, we also provides a simple tutorial to describe how you can use GAEO to create a simple blog. Please visit here and give us any suggestions and comments. The sample could be downloaded from the GAEO's project site.
Please keep watching the GAEO project. Thanks!
2008/08/04
Enhanced Model
AppEngine has provided a basic model class,
Now (after SVN revision 49), you can create your model by extending from
Let's show you one of the useful methods in
then, you can update the attributes like this:
or,
or,
Please try to use the extended class,
google.appengine.ext.db.Model. However, we decide to extend it and add more useful methods that working on the data.Now (after SVN revision 49), you can create your model by extending from
gaeo.model.BaseModel. This class extends from google.appengine.ext.db.Model, so you can also use the its methods and BaseModel's.Let's show you one of the useful methods in
BaseModel -- update_attributes. By using update_attributes method, you can simply update the attributes of a model. For example, if you defined a model like this:from google.appengine.ext import db
from gaeo.model import BaseModel
class Foo(BaseModel):
x = db.StringProperty()
y = db.IntegerProperty()
z = db.StringProperty()then, you can update the attributes like this:
foo = Foo.gql(......).get()
foo.x = 'abc'
foo.y = 123
foo.z = 'def'
foo.put()or,
foo = Foo.gql(....).get()
foo.update_attributes(x='abc', y=123, z='def')
#no need calling put()or,
foo = Foo.gql(....).get()
foo.update_attributes({'x': 'abc', 'y': 123, 'z': 'def'})
#no need calling put()Please try to use the extended class,
BaseModel, and you will feel easy to manipulate the data.
Tags:
model
Subscribe to:
Posts (Atom)