My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
# encoding: utf-8
"""
model.py
$Id$
Created by Roman Kirillov on 2010-01-25.
"""

import datetime
from google.appengine.ext import db
from google.appengine.api import users


class Visitor(db.Model):
'''
Simple object which uses Google DataStore persistence model
'''

'''UserProperty encapsulates information about a Google's
user account available to application. It is set to
use current user as a default user automatically
whever new object is created'''
user = db.UserProperty(required = True, auto_current_user_add = True)

'''DateTimeProperty uses standard underlying datetime.datetime
and is set to auto-update to now() whenever record is saved'''
lastVisit = db.DateTimeProperty(auto_now = True)

'''Very simple integer property with default value of 0'''
hits = db.IntegerProperty(default = 0)

Change log

r4 by sigizmund on Jan 25, 2010   Diff
Id tags added
Go to: 
Project members, sign in to write a code review

Older revisions

r2 by sigizmund on Jan 25, 2010   Diff
Initial import
All revisions of this file

File info

Size: 892 bytes, 30 lines

File properties

svn:keywords
Id
Powered by Google Project Hosting