The model is ok except make attendance a boolean.
Make a API to return all the attendance for the class.
Make an API to post an attendance change.
Use vue.js and axios.js to call the first API loop and display name and 
checkbox for each record in a tabular form.
Use vue.js to trigget a call to the second API on change.


On Friday, 5 May 2017 16:02:36 UTC-5, Toe Khaing Oo wrote:
>
>
> I'm building student attendance app. It has 3 databases, *class*, *student 
> *and *attendance*. 
>
> db.define_table('classes',
>                 Field('name', notnull=True, requires=IS_NOT_EMPTY()),
>                 Field('created_on', 'datetime', default=request.now),
>                 format = '%(name)s')
>
> db.define_table('students',
>                 Field('name', notnull=True, requires=IS_NOT_EMPTY()),
>                 Field('class_id', db.classes),
>                 Field('created_on', 'datetime', default=request.now),
>                 format = '%(name)s'
>                 )
>
> db.define_table('attendance',
>                 Field('class_id', db.classes, default= db.classes.id),
>                 Field('student_id', db.students),
>                 Field('Attend', notnull=True, requires = IS_IN_SET([
> 'Absent', 'Present']), default='Present'),
>                 Field('created_on', 'datetime', default=request.now)
>                 )
>
> I wanna show specific class like this .. 
>
> Class - A 
> students list 
> 1. John Doe       [Absent/Present] <- which is selection option
> 2. Smith            [Absent/Present]
> [Submit] <- which is submit button 
>
> When user checks absent or present for a specific student and click 
> submit, all records will insert into attendance table. 
> How should I write controller function?
>
> Best Regards .. 
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to