def add_note(data): o = Note.objects.filter(name=data[0]) if len(o)==1: c = o[0] else: c = Note() #c.name, c.address, c.phone = data c.save() return c
def create(self): if request.method == 'POST': if request.forms.get('message'): Note.create( user=auth.get_logged_in_user(), message=request.forms['message'], ) next = request.forms.get('next') or self.dashboard_url() return redirect(next)
def add_note(data): o = Note.objects.filter(name=data[0]) if len(o) == 1: c = o[0] else: c = Note() #c.name, c.address, c.phone = data c.save() return c
def get_context(self): return { 'note_list': Note.select().order_by(Note.created_date.desc()).paginate(1, 3) }