Hi,

I tried that and I can now successfully choose a View from "Add controls from 
Data Environment" in class designer. The column names also show up in the grid. 
The app runs, but I get the following traceback:

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 1466
9, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "C:\projects\dabo\ui\uiwx\dGrid.py", line 2250, in _restoreSort
    self.processSort(sortCol, toggleSort=False)
  File "C:\projects\dabo\ui\uiwx\dGrid.py", line 2894, in processSort
    biz.sort(columnToSort, sortOrder, self.caseSensitiveSorting)
  File "C:\projects\dabo\biz\dBizobj.py", line 1209, in sort
    cc.sort(col, ordr, caseSensitive)
  File "C:\projects\dabo\db\dCursorMixin.py", line 560, in sort
    _("Invalid column specified for sort: ") + col)
dabo.dException.dException: Invalid column specified for sort: Gebeurtenis

Gebeurtenis is a column in the grid/view. When I then proceed to click on the 
tab in which the grid in question is situated I get an endless loop with the 
following traceback:

Traceback (most recent call last):
  File "C:\projects\dabo\ui\uiwx\dGrid.py", line 331, in GetValue
    ret = self.getStringValue(bizobj.getFieldVal(field, row))
  File "C:\projects\dabo\biz\dBizobj.py", line 1872, in getFieldVal
    ret = self._CurrentCursor.getFieldVal(fld, row, _rowChangeCallback=changeRow
NumCallback)
  File "C:\projects\dabo\db\dCursorMixin.py", line 940, in getFieldVal
    _("Field"), fld, _("does not exist in the data set")))
dabo.dException.FieldNotFoundException: Field 'Julian' does not exist in the dat
a set

Julian is a column in the grid/view. This traceback repeats and cycles all the 
column names from the View. How should I proceed? Is there any other info you 
need from me?

Thanks again.
Dewald

On Mar 2, 2012, at 5:31 PM, John Fabiani wrote:

> On Friday, March 02, 2012 07:27:41 AM John Fabiani wrote:
>> On Friday, March 02, 2012 01:56:16 PM Dewald Jacobs wrote:
>>> Hi,
>>> 
>>> I have a SQLite database with a View (created with the command CREATE
>>> VIEW, just to be clear) that was created by combining 2 tables plus and
>>> an added column to compute JULIANDAY. How would I go about adding this
>>> View in a grid in Class Designer? I want to treat this view exactly the
>>> same as a normal table and have tried to implement it as such, but have
>>> failed to do so.
>>> 
>>> Any tips or advice would be much appreciated.
>>> 
>>> Thanks
>>> Dewald
>> 
>> I don't use SQLite.
>> But, looking at the code - dbSQLite.py - the views are not retrieved.
>> Something like
>> select name from sqlite_master where type = 'view'
>> is needed.
>> 
>> Question is how best to add in the views and will anything need changing to
>> support ClassDesigner.
>> 
>> Johnf
> 
> Opps - sent to fast!
> 
> Try this and see if it works.
> In dbSQLite.py
>       def getTables(self, cursor, includeSystemTables=False):
>               cursor.execute("select * from sqlite_master")
>               rs = cursor.getDataSet()
>               if includeSystemTables:
>                       tables = [rec["name"] for rec in rs
>                                       if rec["type"] == "table"]
>               else:
>                       tables = [rec["name"] for rec in rs
>                                       if rec["type"] == "table" or 
> rec['type'] == 'view'
>                                       and not 
> rec["name"].startswith("sqlite_")]
>               return tuple(tables)
> _______________________________________________
> Post Messages to: [email protected]
> Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
> Searchable Archives: http://leafe.com/archives/search/dabo-users
> This message: http://leafe.com/archives/byMID/1397013.NQbhjzTa81@linux-12



--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to