I can execute the controller code again and again with the same value
in request.vars.email with success. I was expecting an exception to be
throw (which I would catch) when I tried to insert an existing email
address.
> I can execute the controller code again and again with the same value
> in request.vars.email with success. I was expecting an exception to be
> throw (which I would catch) when I tried to insert an existing email
> address.
> > I can execute the controller code again and again with the same value
> > in request.vars.email with success. I was expecting an exception to be
> > throw (which I would catch) when I tried to insert an existing email
> > address.
db.user.insert isn't throwing an exception if a duplicate record is
inserted but instead continues to the db.commit() instruction -- when
I using appadmin I can confirm that the duplicate record has been
added.
Curiously... if I go to:
.../appadmin/select/db?query=db.user.id>0 then try to add a record
with a duplicate email address the form reports "value already in
database!"
This suggests that my db.py setting is okay. What am I missing in my
code?
Carl
On Apr 30, 7:17 pm, Carl <carl.ro...@gmail.com> wrote:
> > > I can execute the controller code again and again with the same value
> > > in request.vars.email with success. I was expecting an exception to be
> > > throw (which I would catch) when I tried to insert an existing email
> > > address.
> db.user.insert isn't throwing an exception if a duplicate record is
> inserted but instead continues to the db.commit() instruction -- when
> I using appadmin I can confirm that the duplicate record has been
> added.
> Curiously... if I go to:
> .../appadmin/select/db?query=db.user.id>0 then try to add a record
> with a duplicate email address the form reports "value already in
> database!"
> This suggests that my db.py setting is okay. What am I missing in my
> code?
> Carl
> On Apr 30, 7:17 pm, Carl <carl.ro...@gmail.com> wrote:
> > thanks M / very speedy concise reply.
> > p 138/139 explains it all - sorry to have missed this detail.
> > On Apr 30, 6:45 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > > I can execute the controller code again and again with the same value
> > > > in request.vars.email with success. I was expecting an exception to be
> > > > throw (which I would catch) when I tried to insert an existing email
> > > > address.
> On 1 Mag, 05:06, Carl <carl.ro...@gmail.com> wrote:
> > db.user.insert isn't throwing an exception if a duplicate record is
> > inserted but instead continues to the db.commit() instruction -- when
> > I using appadmin I can confirm that the duplicate record has been
> > added.
> > Curiously... if I go to:
> > .../appadmin/select/db?query=db.user.id>0 then try to add a record
> > with a duplicate email address the form reports "value already in
> > database!"
> > This suggests that my db.py setting is okay. What am I missing in my
> > code?
> > Carl
> > On Apr 30, 7:17 pm, Carl <carl.ro...@gmail.com> wrote:
> > > thanks M / very speedy concise reply.
> > > p 138/139 explains it all - sorry to have missed this detail.
> > > > > I can execute the controller code again and again with the same value
> > > > > in request.vars.email with success. I was expecting an exception to be
> > > > > throw (which I would catch) when I tried to insert an existing email
> > > > > address.
The database should throw and OperationalError at insert. Look into
sql.log and you should find the "CREATE TABLE... EMAIL UNIQUE..." I do
not know why sqlite is ignoring it.
Massimo
On 1 Mag, 08:17, Carl <carl.ro...@gmail.com> wrote:
> and then for FORMs I have:
> db.user.email.requires=[IS_LOWER(), IS_EMAIL(), IS_NOT_IN_DB(db,
> db.user.email)]
> db.user.greet.requires=[IS_NOT_EMPTY()]
> I can't find in the web2py framework code where the exception would be
> thrown.
> I'm using sqlite locally.
> On May 1, 2:13 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > what's the model? is unique=True in there?
> > On 1 Mag, 05:06, Carl <carl.ro...@gmail.com> wrote:
> > > db.user.insert isn't throwing an exception if a duplicate record is
> > > inserted but instead continues to the db.commit() instruction -- when
> > > I using appadmin I can confirm that the duplicate record has been
> > > added.
> > > Curiously... if I go to:
> > > .../appadmin/select/db?query=db.user.id>0 then try to add a record
> > > with a duplicate email address the form reports "value already in
> > > database!"
> > > This suggests that my db.py setting is okay. What am I missing in my
> > > code?
> > > Carl
> > > On Apr 30, 7:17 pm, Carl <carl.ro...@gmail.com> wrote:
> > > > thanks M / very speedy concise reply.
> > > > p 138/139 explains it all - sorry to have missed this detail.
> > > > > > I can execute the controller code again and again with the same value
> > > > > > in request.vars.email with success. I was expecting an exception to be
> > > > > > throw (which I would catch) when I tried to insert an existing email
> > > > > > address.
ah! sqlite had become confused such that adding 'unique=True' to my
table definition didn't update the data store.
Deleting the data store and starting again has the behaviour sorted.
thanks for your feedback.
On May 1, 2:29 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> The database should throw and OperationalError at insert. Look into
> sql.log and you should find the "CREATE TABLE... EMAIL UNIQUE..." I do
> not know why sqlite is ignoring it.
> Massimo
> On 1 Mag, 08:17, Carl <carl.ro...@gmail.com> wrote:
> > and then for FORMs I have:
> > db.user.email.requires=[IS_LOWER(), IS_EMAIL(), IS_NOT_IN_DB(db,
> > db.user.email)]
> > db.user.greet.requires=[IS_NOT_EMPTY()]
> > I can't find in the web2py framework code where the exception would be
> > thrown.
> > I'm using sqlite locally.
> > On May 1, 2:13 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > what's the model? is unique=True in there?
> > > On 1 Mag, 05:06, Carl <carl.ro...@gmail.com> wrote:
> > > > db.user.insert isn't throwing an exception if a duplicate record is
> > > > inserted but instead continues to the db.commit() instruction -- when
> > > > I using appadmin I can confirm that the duplicate record has been
> > > > added.
> > > > Curiously... if I go to:
> > > > .../appadmin/select/db?query=db.user.id>0 then try to add a record
> > > > with a duplicate email address the form reports "value already in
> > > > database!"
> > > > This suggests that my db.py setting is okay. What am I missing in my
> > > > code?
> > > > Carl
> > > > On Apr 30, 7:17 pm, Carl <carl.ro...@gmail.com> wrote:
> > > > > thanks M / very speedy concise reply.
> > > > > p 138/139 explains it all - sorry to have missed this detail.
> > > > > > > I can execute the controller code again and again with the same value
> > > > > > > in request.vars.email with success. I was expecting an exception to be
> > > > > > > throw (which I would catch) when I tried to insert an existing email
> > > > > > > address.
yes sqlite does not understand migrations well. In particular it
cannot alter table and change a column type. It just stores new values
according to the new type.
Massimo
On 1 Mag, 09:35, Carl <carl.ro...@gmail.com> wrote:
> ah! sqlite had become confused such that adding 'unique=True' to my
> table definition didn't update the data store.
> Deleting the data store and starting again has the behaviour sorted.
> thanks for your feedback.
> On May 1, 2:29 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > The database should throw and OperationalError at insert. Look into
> > sql.log and you should find the "CREATE TABLE... EMAIL UNIQUE..." I do
> > not know why sqlite is ignoring it.
> > Massimo
> > On 1 Mag, 08:17, Carl <carl.ro...@gmail.com> wrote:
> > > and then for FORMs I have:
> > > db.user.email.requires=[IS_LOWER(), IS_EMAIL(), IS_NOT_IN_DB(db,
> > > db.user.email)]
> > > db.user.greet.requires=[IS_NOT_EMPTY()]
> > > I can't find in the web2py framework code where the exception would be
> > > thrown.
> > > I'm using sqlite locally.
> > > On May 1, 2:13 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > > what's the model? is unique=True in there?
> > > > On 1 Mag, 05:06, Carl <carl.ro...@gmail.com> wrote:
> > > > > db.user.insert isn't throwing an exception if a duplicate record is
> > > > > inserted but instead continues to the db.commit() instruction -- when
> > > > > I using appadmin I can confirm that the duplicate record has been
> > > > > added.
> > > > > Curiously... if I go to:
> > > > > .../appadmin/select/db?query=db.user.id>0 then try to add a record
> > > > > with a duplicate email address the form reports "value already in
> > > > > database!"
> > > > > This suggests that my db.py setting is okay. What am I missing in my
> > > > > code?
> > > > > Carl
> > > > > On Apr 30, 7:17 pm, Carl <carl.ro...@gmail.com> wrote:
> > > > > > thanks M / very speedy concise reply.
> > > > > > p 138/139 explains it all - sorry to have missed this detail.
> > > > > > > > I can execute the controller code again and again with the same value
> > > > > > > > in request.vars.email with success. I was expecting an exception to be
> > > > > > > > throw (which I would catch) when I tried to insert an existing email
> > > > > > > > address.
> yes sqlite does not understand migrations well. In particular it
> cannot alter table and change a column type. It just stores new values
> according to the new type.
> Massimo
> On 1 Mag, 09:35, Carl <carl.ro...@gmail.com> wrote:
> > ah! sqlite had become confused such that adding 'unique=True' to my
> > table definition didn't update the data store.
> > Deleting the data store and starting again has the behaviour sorted.
> > thanks for your feedback.
> > On May 1, 2:29 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > The database should throw and OperationalError at insert. Look into
> > > sql.log and you should find the "CREATE TABLE... EMAIL UNIQUE..." I do
> > > not know why sqlite is ignoring it.
> > > Massimo
> > > On 1 Mag, 08:17, Carl <carl.ro...@gmail.com> wrote:
> > > > and then for FORMs I have:
> > > > db.user.email.requires=[IS_LOWER(), IS_EMAIL(), IS_NOT_IN_DB(db,
> > > > db.user.email)]
> > > > db.user.greet.requires=[IS_NOT_EMPTY()]
> > > > I can't find in the web2py framework code where the exception would be
> > > > thrown.
> > > > I'm using sqlite locally.
> > > > On May 1, 2:13 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > > > what's the model? is unique=True in there?
> > > > > On 1 Mag, 05:06, Carl <carl.ro...@gmail.com> wrote:
> > > > > > db.user.insert isn't throwing an exception if a duplicate record is
> > > > > > inserted but instead continues to the db.commit() instruction -- when
> > > > > > I using appadmin I can confirm that the duplicate record has been
> > > > > > added.
> > > > > > Curiously... if I go to:
> > > > > > .../appadmin/select/db?query=db.user.id>0 then try to add a record
> > > > > > with a duplicate email address the form reports "value already in
> > > > > > database!"
> > > > > > This suggests that my db.py setting is okay. What am I missing in my
> > > > > > code?
> > > > > > Carl
> > > > > > On Apr 30, 7:17 pm, Carl <carl.ro...@gmail.com> wrote:
> > > > > > > thanks M / very speedy concise reply.
> > > > > > > p 138/139 explains it all - sorry to have missed this detail.
> > > > > > > > > I can execute the controller code again and again with the same value
> > > > > > > > > in request.vars.email with success. I was expecting an exception to be
> > > > > > > > > throw (which I would catch) when I tried to insert an existing email
> > > > > > > > > address.
On GAE there is no concept of alter table so you can add columns and
you can drop (they will not be dropped, just ignored). You can change
some attributes of a column (like length) since they are ignored
anyway. Some migrations will not work.
Massimo
On May 1, 9:48 am, Carl <carl.ro...@gmail.com> wrote:
> My target database is Google's AppEngine. Do you know if it handles
> migrations smoothly?
> On May 1, 3:46 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > yes sqlite does not understand migrations well. In particular it
> > cannot alter table and change a column type. It just stores new values
> > according to the new type.
> > Massimo
> > On 1 Mag, 09:35, Carl <carl.ro...@gmail.com> wrote:
> > > ah! sqlite had become confused such that adding 'unique=True' to my
> > > table definition didn't update the data store.
> > > Deleting the data store and starting again has the behaviour sorted.
> > > thanks for your feedback.
> > > On May 1, 2:29 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > > The database should throw and OperationalError at insert. Look into
> > > > sql.log and you should find the "CREATE TABLE... EMAIL UNIQUE..." I do
> > > > not know why sqlite is ignoring it.
> > > > Massimo
> > > > On 1 Mag, 08:17, Carl <carl.ro...@gmail.com> wrote:
> > > > > and then for FORMs I have:
> > > > > db.user.email.requires=[IS_LOWER(), IS_EMAIL(), IS_NOT_IN_DB(db,
> > > > > db.user.email)]
> > > > > db.user.greet.requires=[IS_NOT_EMPTY()]
> > > > > I can't find in the web2py framework code where the exception would be
> > > > > thrown.
> > > > > I'm using sqlite locally.
> > > > > On May 1, 2:13 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > > > > what's the model? is unique=True in there?
> > > > > > On 1 Mag, 05:06, Carl <carl.ro...@gmail.com> wrote:
> > > > > > > db.user.insert isn't throwing an exception if a duplicate record is
> > > > > > > inserted but instead continues to the db.commit() instruction -- when
> > > > > > > I using appadmin I can confirm that the duplicate record has been
> > > > > > > added.
> > > > > > > Curiously... if I go to:
> > > > > > > .../appadmin/select/db?query=db.user.id>0 then try to add a record
> > > > > > > with a duplicate email address the form reports "value already in
> > > > > > > database!"
> > > > > > > This suggests that my db.py setting is okay. What am I missing in my
> > > > > > > code?
> > > > > > > Carl
> > > > > > > On Apr 30, 7:17 pm, Carl <carl.ro...@gmail.com> wrote:
> > > > > > > > thanks M / very speedy concise reply.
> > > > > > > > p 138/139 explains it all - sorry to have missed this detail.
> > > > > > > > > > I can execute the controller code again and again with the same value
> > > > > > > > > > in request.vars.email with success. I was expecting an exception to be
> > > > > > > > > > throw (which I would catch) when I tried to insert an existing email
> > > > > > > > > > address.