Hi everyone,
Although I have used database serveral times, I have not done anything
beyond very basic, so I am wondering what would be the best practice for
this case:
I have a database table for storing a 'real-time' playlist of songs like
this:
db.define_table('playlist',Field('title','string'),
Field('start_time','integer'),
Field('duration','integer')
)
For example:
row 0: Title: Imagine ; start time:
0:00 ; duration 3:43
row 1: Title: My way ; start time:
3:43 ; duration 4:00
row 2: Title: I feel good ; start time:
7:43 ; duration 4:00
As you see, start time of every song stands for the 'real time' at which
the song will be played.
What I need to know is the best approach in web2py for insert a new row in
the middle of the table and update songs below.
Example, say that I add, "my song" between 0 and 1:
row 0: Title: Imagine ; start time:
0:00 ; duration 3:43
row 1: Title: My Song ; start time:
3:43 ; duration 3:00
row 2: Title: My way ; start time:
7:43 ; duration 4:00
row 3: Title: I feel good ; start time:
11:43 ; duration 4:00
I need to update and change start times for old rows 1 and 2...
I have never face this kind of problem but I have seen that in a SQL
triggers could do the update. How could I approach this problem in web2py?
Thanks in advance
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.