Not clear about the dot notation

Zeynel azeynel1 at gmail.com
Sun Jan 16 15:44:35 EST 2011


On Jan 16, 3:24 pm, TomF <tomf.sess... at gmail.com> wrote:

> vote refers to the Vote instance.

So he must have instatiated previously like

vote = Vote()

is this correct?

So I have a model

class Item(db.Model):
    title = db.StringProperty()
    url = db.StringProperty()
    date = db.DateTimeProperty(auto_now_add=True)
    author = db.UserProperty()

and to write to the database I do

            item = Item()
            item.title = self.request.get("title")
            item.url = self.request.get("url")
            item.author = users.get_current_user()
            item.put()
            self.redirect("/newest")

so his vote.vote is like my item.url ?



More information about the Python-list mailing list