Hi all,
Thanks Koen for that last answer on making my WFormWidget descendant. I
think I might give that a go and give you a github pull request once I get
the first version of this blog app I'm writing out the door.
I've switched to using your auth lib, rather than my own wittyPlus version.
Thanks for that Koen and other devs .. as usual best quality C++ code I've
ever come across :)
My next questions are:
*With dbo is there a way to specify a unique secondary key ?*
I have a 'blog post' and I like having the standard 'id' field being an
int, but I want to add an index with a not null constraint on the 'name'
field. At the moment, I'm just doing it by executing SQL straight out.
Something like: create unique index blog_post_name on blog_post (name);
*With dbo, what decides if a field is NOT NULL ?*
This code:
template <class Action>
void persist(Action& a) {
namespace dbo = Wt::Dbo;
dbo::id(a, _name, "name");
dbo::field(a, _title, "title");
dbo::field(a, dateTime, "dateTime");
dbo::field(a, body, "body");
dbo::hasMany(a, tags, Wt::Dbo::ManyToMany, "post_tag");
}
generates this table in PostgreSQL:
Column | Type | Modifiers
----------+-----------------------------+--------------------------------------------------------
id | integer | not null default
nextval('blog_post_id_seq'::regclass)
version | integer | not null
name | text | not null
title | text | not null
dateTime | timestamp without time zone |
body | text | not null
Indexes:
"blog_post_pkey" PRIMARY KEY, btree (id)
"blog_post_name" UNIQUE, btree (name)
Referenced by:
TABLE "post_tag" CONSTRAINT "fk_post_tag_key2" FOREIGN KEY
(blog_post_id) REFERENCES blog_post(id)
I don't see how name and title get a NOT NULL constraint .. but dateTime
doesn't .. (I'd like it to have one too).
Thanks heaps as always.
Happy post Christmas recuperation and New Year to all :)
Matthew Sherborne
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest