For now I have reverted trunk to the old DAL. The new DAL has moved in
dal.py.
I will post this as 1.74.1 stable since there are some old fixes
collected over time.
If you want to test the new DAL do

   cp gluon/dal.py gluon/sql.py

Completing the new DAL will take another week or two probably.
1.74.* will be the last release with the old DAL.

About the problem below with SQLCustomType. SQLCustomType does not
work well with the new DAL and it may go completely away in favor of a
better API for custom types. I will not enforce backward compatibility
on custom types since it was never officially documented. It was
implemented as a quick hack to solve some immediate needs.

If you oppose and think SQLCustomType should remain backward
compatible please tell us know.

Massimo

On Dec 14, 9:59 am, Fran <francisb...@googlemail.com> wrote:
> On Dec 13, 5:27 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > I am rewriting the DAL to make more modular. 75% is done and it is in
> > trunk.
> > Please take a look. I need one official tester for each supported
> > database backend (except sqlite since I can do that)
>
> Am using sqlite with r1455, the below code breaks when trying to
> insert a new record:
> Traceback (most recent call last):
>   File "C:\Bin\web2py\gluon\restricted.py", line 173, in restricted
>     exec ccode in environment
>   File "C:/Bin/web2py/applications/sahana/models/zzz_1st_run.py", line
> 17, in <module>
>     theme = 1
>   File "C:\Bin\web2py\gluon\sql.py", line 1890, in insert
>     self._db._adapter.execute(query)
>   File "C:\Bin\web2py\gluon\sql.py", line 202, in execute
>     return self.cursor.execute(*a, **b)
> IntegrityError: s3_setting.uuid may not be NULL
>
> # Reusable UUID field (needed as part of database synchronization)
> import uuid
> from gluon.sql import SQLCustomType
> s3uuid = SQLCustomType(
>                 type = 'string',
>                 native = 'VARCHAR(64)',
>                 encoder = (lambda x: "'%s'" % (uuid.uuid4() if x==""
> else str(x).replace("'", "''"))),
>                 decoder = (lambda x: x)
>             )
>
> uuidstamp = db.Table(None, 'uuidstamp',
>                      Field('uuid',
>                           type=s3uuid,
>                           length=64,
>                           notnull=True,
>                           unique=True,
>                           readable=False,
>                           writable=False,
>                           default=""))
>
> F

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to