2011년 9월 28일 수요일

replyingtv - model.py

replyingtv의 소스코드 중 모델 선언부분인 model.py를 살펴보겠습니다.

# -*- coding: utf-8 -*-

'''
Created on 2011. 9. 8.

@author: Park
'''

from google.appengine.ext import db 


class Program(db.Model):
    """this class saves the program titles, channel and the date which
    the program instance made
    """
    channel = db.StringProperty()
    date = db.DateTimeProperty(auto_now_add=True)

class Comment(db.Model):
    """this class saves comments
    program references the Program class.
    written_via is for the multi-platform extension.(ex i-phone, LGtv etc 
    """
    #if there would be another platform, 'commenter' should be changed as string or etc for many format
    commenter = db.EmailProperty()
    written_datetime = db.DateTimeProperty()
    program = db.ReferenceProperty(Program)
    written_via = db.StringProperty()
    text = db.StringProperty()

class Parameter(db.Model):
    """this class is for saving some parameters which need to run
    the whole program.
    2011.09.29: now only has date.
    """
    date = db.DateProperty()
    
class ProgramGuide(db.Model):
    """it saves the channel guide today. channel and program time, and
    the title as a key_name. 
    """
    programTime = db.DateTimeProperty()
    channel = db.StringProperty(multiline=True)   #ex) kbs1, kbs2 ...


별다른 어려운 부분은 없지만, Parameter 클래스는 변수 몇가지를 저장하기 위해 모델을 만들어 쓰게 돼서, 다른 방법이 없을까 하는 생각도 들었습니다만 뾰족한 방법을 모르겠네요

댓글 없음:

댓글 쓰기

function foo()
{
}