Thanks.

I have tried the following:

db.define_table("tmp_uts",
                Field ('ut', length=15),
                rname='isi.tmp_uts')

Which resulted correctly in

CREATE TABLE isi.tmp_uts(
    id BIGSERIAL PRIMARY KEY,
    ut VARCHAR(15)
);

But then:

In [1]: db.tmp_uts[0] = dict(ut = '123451234512345')
---------------------------------------------------------------------------
ProgrammingError                          Traceback (most recent call last)
/home/js/web2py/applications/nkb/models/isi/queries.py in <module>()
----> 1 db.tmp_uts[0] = dict(ut = '123451234512345')

/home/js/web2py/gluon/dal.pyc in __setitem__(self, key, value)
   8679         elif str(key).isdigit():
   8680             if key == 0:
-> 8681                 self.insert(**self._filter_fields(value))
   8682             elif self._db(self._id == key)\
   8683                     .update(**self._filter_fields(value)) is None:

/home/js/web2py/gluon/dal.pyc in insert(self, **fields)
   8820         self._attempt_upload(fields)
   8821         if any(f(fields) for f in self._before_insert): return 0
-> 8822         ret =  self._db._adapter.insert(self, self._listify(fields))
   8823         if ret and self._after_insert:
   8824             fields = Row(fields)

/home/js/web2py/gluon/dal.pyc in insert(self, table, fields)
   1261             return dict([(k[0].name, k[1]) for k in fields \
   1262                              if k[0].name in table._primarykey])
-> 1263         id = self.lastrowid(table)
   1264         if not isinstance(id, (int, long)):
   1265             return id

/home/js/web2py/gluon/dal.pyc in lastrowid(self, table)
   2750
   2751     def lastrowid(self,table):
-> 2752         self.execute("""select currval('"%s"')""" %
table._sequence_name)
   2753         return int(self.cursor.fetchone()[0])
   2754

/home/js/web2py/gluon/dal.pyc in execute(self, *a, **b)
   1860
   1861     def execute(self, *a, **b):
-> 1862         return self.log_execute(*a, **b)
   1863
   1864     def represent(self, obj, fieldtype):

/home/js/web2py/gluon/dal.pyc in log_execute(self, *a, **b)
   1854         self.db._lastsql = command
   1855         t0 = time.time()
-> 1856         ret = self.cursor.execute(command, *a[1:], **b)
   1857         self.db._timings.append((command,time.time()-t0))
   1858         del self.db._timings[:-TIMINGSSIZE]

ProgrammingError: relation "si.tmp_ut_id_seq" does not exist
LINE 1: select currval('"si.tmp_ut_id_seq"')


Regards
Johann


On 22 October 2013 14:28, Niphlod <[email protected]> wrote:

> ehm... what ? are you searching for the word "schema" in the code ? :D
> see the new rname attribute
>
>
> On Tuesday, October 22, 2013 2:05:57 PM UTC+2, Johann Spies wrote:
>>
>> The only context I can see 'schema' being used in DAL is in connection
>> with GEO field types.
>>
>> Regards
>> Johann
>>
>  --
> 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.
>



-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 
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.

Reply via email to