Squashed commit of the following:

commit 997c1138f549766d797f1ba6da26e1e8394387e2
Author: emeric <itmfr@yahoo.fr>
Date:   Sat Jan 10 17:50:20 2015 +0100

    Implemented save, load and delete playlists

commit bee08a16b544bb21785c45f083ab7c10e65bfa6e
Author: emeric <itmfr@yahoo.fr>
Date:   Thu Jan 8 23:46:43 2015 +0100

    Reworked the database code layout in order to add playlists
This commit is contained in:
emeric
2015-01-10 17:51:24 +01:00
parent 2d110b0280
commit e89b08fc39
31 changed files with 483 additions and 96 deletions
+7
View File
@@ -20,7 +20,9 @@
#ifndef DATABASE_USER_HPP
#define DATABASE_USER_HPP
#include <vector>
#include <Wt/Dbo/Dbo>
#include <Wt/Auth/Dbo/AuthInfo>
namespace Database {
@@ -28,6 +30,8 @@ namespace Database {
class User;
typedef Wt::Auth::Dbo::AuthInfo<User> AuthInfo;
class Playlist;
class User {
public:
@@ -68,6 +72,7 @@ class User {
Wt::Dbo::field(a, _isAdmin, "admin");
Wt::Dbo::field(a, _audioBitrate, "audio_bitrate");
Wt::Dbo::field(a, _videoBitrate, "video_bitrate");
Wt::Dbo::hasMany(a, _playlists, Wt::Dbo::ManyToOne, "user");
}
private:
@@ -87,6 +92,8 @@ class User {
int _audioBitrate;
int _videoBitrate;
Wt::Dbo::collection< Wt::Dbo::ptr<Playlist> > _playlists;
};
} // namespace Databas'