[web2py] Custom buttons in grid are not displayed on Detail page

2023-10-10 Thread Seth J
I encountered a little issue with SmartGrid not displaying custom links in 
Detail view. Not sure if I'm missing something or it's a limitation of some 
sort.  Here's what's going on.

I have a main grid that looks like this:

[image: main_grid.png]
There are different custom 'ACTIONS' buttons depending on 'APPROVAL' 
status. They all look and work fine in the grid itself.  However, when I 
click on 'View' to display details, there's a "gluon.html" message instead 
of buttons, like so:

[image: details.png]
If there are no custom buttons on that row, I still get '[]' displayed 
instead of nothing:
[image: details2.png]
Here's my code for the grid:

request_links = [dict(header='ACTIONS', body=lambda row: 
_create_requests_links(row.id))]
grid = SQLFORM.smartgrid(db.otrequest, linked_tables = 
['click_history','otrequest_archive'],
 fields=[db.otrequest.description, 
db.otrequest.created_on, db.otrequest.ot_hours, db.otrequest.persons, 
db.otrequest.created_by, db.otrequest.approval, db.otrequest.approved_by, 
db.otrequest.approved_on],
 links=dict(otrequest=request_links), 
 searchable= dict(otrequest=True, 
click_history=False), 
 editable= dict(otrequest=is_admin or (is_owner 
and is_not_approved_or_denied), otrequest_archive=False, 
click_history=False), 
 deletable= dict(otrequest=is_admin or 
(is_owner and is_not_approved_or_denied), otrequest_archive=False, 
click_history=not is_employee and is_assigned), 
 create=dict(otrequest=is_admin or is_manager 
or is_supervisor, otrequest_archive=False, click_history=False), 
 links_in_grid=True, user_signature=True, 
 details=dict(otrequest=True, 
otrequest_archive=False, click_history=False), 
 showbuttontext=True, paginate=30, 
 exportclasses=dict(otrequest=dict(json=False, 
csv_with_hidden_cols=False, 
tsv_with_hidden_cols=False),otrequest_archive=dict(json=False, html=False, 
xml=False, csv_with_hidden_cols=False, tsv_with_hidden_cols=False)),
 orderby=orderby, oncreate=_on_create, 
formname='request_grid')

And here's the code that creates the buttons:

def _create_requests_links(record_id):
now = datetime.datetime.today()
rec_buttons = []
request_status=db(db.otrequest.id == record_id).select().first()
assigned_count = db((db.click_history.request_rec == record_id) & 
(db.click_history.disposition == 'Assigned')).count()

# logger.debug("Count of Assigned for Request {}: People -> 
{}".format(record_id, db(db.otrequest.id == 
record_id).select().first().persons))

if request_status is None:
return rec_buttons
elif request_status.approval == 0 and (auth.has_membership('manager') 
or auth.has_membership('admin')) and request_status.created_on > now:
rec_buttons.append(A(TAG.BUTTON(SPAN(_class="fa-regular 
fa-thumbs-up fa-lg"),T(' 
APPROVE')),callback=URL('default','_approve_this_request', 
args=[record_id]),_title="Approve This Overtime Request") + ' ')

rec_buttons.append(A(TAG.BUTTON(SPAN(_class="fa-solid 
fa-thumbs-down fa-lg"),T(' DENY')),callback=URL('default', 
'_deny_this_request', args=[record_id]),_title="Deny This Overtime 
Request"))

elif request_status.approval == 1 and assigned_count < 
db(db.otrequest.id == record_id).select().first().persons and 
(auth.has_membership('supervisor') or auth.has_membership('admin')) and 
request_status.created_on > now:
rec_buttons.append(TAG.BUTTON(SPAN(_class="fa-solid 
fa-person-circle-plus fa-lg"),T(' ASSIGN'),_onClick="window.location='%s'" 
% URL('default','ot_rankings',args=[record_id]),_title="Assign Overtime to 
Employee"))

return rec_buttons


-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9627508f-6fc6-443d-a3f4-bf6ffb8959cdn%40googlegroups.com.


Re: [web2py] Re: web2py online debugger under python3

2020-07-16 Thread Seth J
So, what would you recommend for "remote debugging" situation?  I have 
web2py running on internal firewalled Windows 2016 Server and have been 
struggling to adopt anything for debugging purposes.

On Tuesday, May 5, 2020 at 9:11:00 PM UTC-4 roge...@gmail.com wrote:

> Hi Clemens
>
> I think a standalone debugger is much better. The online debugger could be 
> great to debug applications in production  though.
>
> Where are you doing your development? On your local machine or Python 
> Anywhere or somewhere else?  I don't think it's possible to debug using 
> Visual Studio Code or PyCharm if web2py is not running on your local 
> machine. The debugger needs to connect to the python process. 
>
> Anyhow, it's not hard to do once you know where to look. I managed to get 
> PyCharm debugging in about 15 minutes - most of that was spent downloading 
> the app for the first time.
>
> Cheers
> Andrew
>
> On Wed, 6 May 2020 at 07:04, Clemens  wrote:
>
>> Hi Andrew,
>>
>> well, I would say, it's because I ever used it and it's okay for me. But 
>> which one would you recommend? And how to connect your favorite debugger 
>> with web2py? Never used another debugger for web2py.
>>
>> Regards
>> Clemens
>>
>>
>> On Tuesday, May 5, 2020 at 1:56:25 AM UTC+2, AGRogers wrote:
>>>
>>> Hi Clemens
>>>
>>> I definitely can't help you with this problem. Sorry. But I am 
>>> interested in why you use the online debugger and not something else?
>>>
>>> Thanks
>>> Andrew
>>>
>>> On Mon, 4 May 2020 at 23:50, Clemens  
>>> wrote:
>>>
 Hello Massimo,

 I hoped the latest web2py version would fix the problem. My current 
 configuration is now:
 web2py version 2.20.4-stable+timestamp.2020.05.03.05.18.50, Running on 
 Rocket 1.2.6, Python 3.6.9, Ubuntu 18.04., Firefox 75.0 (64-bit)

 But the online debugger still doesn't work. The debugger doesn't catch 
 the breakpoint, set in my code. Instead, after waiting a few minutes I got 
 the following new situation:

 [image: Screenshot_2020-05-04 interact.png]

 [image: Screenshot_2020-05-04 interact-02.png]
 Do you have any idea, how I can fix this?

 Best regards
 Clemens


 On Sunday, April 26, 2020 at 8:46:00 AM UTC+2, Massimo Di Pierro wrote:
>
> what browser?
>
> On Monday, 30 March 2020 13:23:57 UTC-7, Clemens wrote:
>>
>> Hello everybody!
>>
>> I've switched my web2py app from python2 to python3. The app itself 
>> works fine, but the web2py online debugger doesn't work anymore and is 
>> mostly freezing. Sometimes a get the following error message:
>>
>> Exception timeout: timeout('timed out',)
>>
>> Traceback (most recent call last): File 
>> "/usr/lib/python3.6/socket.py", line 586, in readinto return 
>> self._sock.recv_into(b) socket.timeout: timed out
>>
>> My configuration is as follows:
>>
>> web2py 2.19.1-stable+timestamp.2020.03.21.21.49.28 (Running on Rocket 
>> 1.2.6, Python 3.6.9), Ubuntu 18.04 LTS
>>
>> What do I have to change additionally that the online debugger is 
>> working under python3?
>>
>>
>> Thanks a lot for any support!
>>
>>
>> Best regards Clemens
>>
> -- 
 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 web...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/ccc32a55-4a15-4f88-9b0f-69326542b6f0%40googlegroups.com
  
 
 .

>>> -- 
>> 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 web2py+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/73792fd3-310e-43e6-89d6-5f615e12546d%40googlegroups.com
>>  
>> 
>> .
>>
>

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

[web2py] Re: Upgraded to 2.19 and SQL Server date insert throws an error

2020-06-03 Thread Seth J
Thanks for pointing the function.  But it looks like the error is happening 
on the Session insert. See below *query* block:


   - Variables
   e DataError('22007', '[22007] [Microsoft][ODBC SQL...e from character 
   string. (241) (SQLExecDirectW)')
   
Context

locals request session response
locals
e : DataError('22007', '[22007] [Microsoft][ODBC SQL...e from character 
string. (241) (SQLExecDirectW)')
fields : [(, '172.20.252.61'), 
(, 0), (, 
'2020-06-04T00:21:23.665000'), (, 
'5258b356-2b72-4a24-8868-710222ac0784'), (, 
datetime.datetime(2020, 6, 4, 0, 21, 23, 665000)), (, 
'\x80\x02cgluon.globals\nSession\nq\x01}q\x02U\x05flashq\x03U\x00s\x85Rq\x04.')]
query : 'INSERT INTO 
"web2py_session_PubView"("client_ip"...FscwpTZXNzaW9uCnEBfXECVQVmbGFzaHEDVQBzhVJxBC4=\');'
self : 
table : 

On Wednesday, June 3, 2020 at 11:09:28 PM UTC-4, Dave S wrote:
>
>
>
> On Wednesday, June 3, 2020 at 2:04:02 PM UTC-7, Seth J wrote:
>>
>> I am not sure how to view the query sent to MSSQL.  
>>
>
> Does this help/?
>  https://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#_lastsql
> >
>
>
>  
>
>> Here's a little more from the error record:
>>
>>
>>- 
>>
>>*File C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py in 
>>insert at line 539* code arguments variables
>>Function argument list
>>
>>(self=, table=>web2py_session_PubView (id, locked, clien...me, modified_datetime, 
>>unique_key, session_data)>, fields=[(, 
>>'172.20.145.208'), (, 0), 
>> (>object>, '2020-06-03T00:26:05.296000'), (, 
>>'affc9c47-0085-45dc-8352-12549c7f93dc'), (, 
>>datetime.datetime(2020, 6, 3, 0, 26, 5, 296000)), (>object>, 
>>
>> '\x80\x02cgluon.globals\nSession\nq\x01}q\x02U\x05flashq\x03U\x00s\x85Rq\x04.')])
>>
>>
> You've got a date conversion error.  Do you need to specify a format 
> string?  Is the ISO 'T' causing problems with a format that expects a 
> space?  How have you defined the field?
>
> /dps
>  
>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/295393b8-2f66-4554-9bd3-3e1529e5dc1c%40googlegroups.com.


[web2py] Re: Upgraded to 2.19 and SQL Server date insert throws an error

2020-06-03 Thread Seth J
I am not sure how to view the query sent to MSSQL.  Here's a little more 
from the error record:


   - 
   
   *File C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py in 
   insert at line 539* code arguments variables
   Function argument list
   
   (self=, table=, fields=[(, 
   '172.20.145.208'), (, 0), (, '2020-06-03T00:26:05.296000'), (, 
   'affc9c47-0085-45dc-8352-12549c7f93dc'), (, 
   datetime.datetime(2020, 6, 3, 0, 26, 5, 296000)), (, 
   
'\x80\x02cgluon.globals\nSession\nq\x01}q\x02U\x05flashq\x03U\x00s\x85Rq\x04.')])
   Code listing
   
   534.
   535.
   536.
   537.
   538.
   539.
   540.
   541.
   542.
   543.
   
   self.execute(query)
   except:
   e = sys.exc_info()[1]
   if hasattr(table, "_on_insert_error"):
   return table._on_insert_error(table, fields, e)
   raise e
   if hasattr(table, "_primarykey"):
   pkdict = dict(
   [(k[0].name, k[1]) for k in fields if k[0].name in 
table._primarykey]
   )
   
   Variables
   e DataError('22007', '[22007] [Microsoft][ODBC SQL...e from character 
   string. (241) (SQLExecDirectW)')
   
Context

On Wednesday, June 3, 2020 at 9:14:15 AM UTC-4, Jim S wrote:
>
> Can you pinpoint the line in your code that is causing the error?
>
> Can you see the SQL statement that is being sent to the server?
>
> -Jim
>
> On Tuesday, June 2, 2020 at 11:29:27 PM UTC-5, Seth J wrote:
>>
>> Yes, same error. 路‍♂️
>>
>> Error ticket for "PubView"Ticket ID
>>
>> 172.20.145.208.2020-06-03.00-26-05.a903caa0-1d7d-4612-a5f9-104967995098
>> Version
>> web2py™ Version 2.20.4-stable+timestamp.2020.05.03.05.18.50
>> Python Python 2.7.10: C:\Python27\python.exe (prefix: C:\Python27)
>> Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>>
>> Traceback (most recent call last):
>>   File ".\gluon\main.py", line 456, in wsgibase
>> session._try_store_in_db(request, response)
>>   File ".\gluon\globals.py", line 1254, in _try_store_in_db
>> record_id = table.insert(**dd)
>>   File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\objects.py", line 888, 
>> in insert
>> ret = self._db._adapter.insert(self, row.op_values())
>>   File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py", line 
>> 539, in insert
>> raise e
>> DataError: ('22007', '[22007] [Microsoft][ODBC SQL Server Driver][SQL 
>> Server]Conversion failed when converting date and/or time from character 
>> string. (241) (SQLExecDirectW)')
>>
>> Error snapshot [image: help] 
>> <https://vmweb2pysql02.gpo.gov/admin/default/ticket/PubView/172.20.145.208.2020-06-03.00-26-05.a903caa0-1d7d-4612-a5f9-104967995098#>
>>
>> (('22007', '[22007] [Microsoft][ODBC SQL Server 
>> Driver][SQL Server]Conversion failed when converting date and/or time from 
>> character string. (241) (SQLExecDirectW)'))
>>
>> On Tuesday, June 2, 2020 at 1:53:37 AM UTC-4, Clemens wrote:
>>>
>>> Have you already tried the latest version 
>>> 2.20.4-stable+timestamp.2020.05.03.05.18.50 
>>> <http://www.web2py.com/init/default/download>?
>>>
>>>
>>> On Monday, June 1, 2020 at 8:12:08 PM UTC+2, Seth J wrote:
>>>>
>>>> I am running IIS connecting to SQL Server.  Upgrade seems to have 
>>>> introduced an error to an otherwise functioning app.  Any ideas???
>>>>
>>>> [image: error_web2py.png]
>>>>
>>>>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5742bfe1-e0ae-4dc8-9455-21a1098572f1%40googlegroups.com.


[web2py] Re: Upgraded to 2.19 and SQL Server date insert throws an error

2020-06-02 Thread Seth J
Yes, same error. 路‍♂️

Error ticket for "PubView"Ticket ID

172.20.145.208.2020-06-03.00-26-05.a903caa0-1d7d-4612-a5f9-104967995098
Version
web2py™ Version 2.20.4-stable+timestamp.2020.05.03.05.18.50
Python Python 2.7.10: C:\Python27\python.exe (prefix: C:\Python27)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

Traceback (most recent call last):
  File ".\gluon\main.py", line 456, in wsgibase
session._try_store_in_db(request, response)
  File ".\gluon\globals.py", line 1254, in _try_store_in_db
record_id = table.insert(**dd)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\objects.py", line 888, in 
insert
ret = self._db._adapter.insert(self, row.op_values())
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py", line 
539, in insert
raise e
DataError: ('22007', '[22007] [Microsoft][ODBC SQL Server Driver][SQL 
Server]Conversion failed when converting date and/or time from character 
string. (241) (SQLExecDirectW)')

Error snapshot [image: help] 
<https://vmweb2pysql02.gpo.gov/admin/default/ticket/PubView/172.20.145.208.2020-06-03.00-26-05.a903caa0-1d7d-4612-a5f9-104967995098#>

(('22007', '[22007] [Microsoft][ODBC SQL Server 
Driver][SQL Server]Conversion failed when converting date and/or time from 
character string. (241) (SQLExecDirectW)'))

On Tuesday, June 2, 2020 at 1:53:37 AM UTC-4, Clemens wrote:
>
> Have you already tried the latest version 
> 2.20.4-stable+timestamp.2020.05.03.05.18.50 
> <http://www.web2py.com/init/default/download>?
>
>
> On Monday, June 1, 2020 at 8:12:08 PM UTC+2, Seth J wrote:
>>
>> I am running IIS connecting to SQL Server.  Upgrade seems to have 
>> introduced an error to an otherwise functioning app.  Any ideas???
>>
>> [image: error_web2py.png]
>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3954861a-1eaa-4795-bcdd-e4d52d18ff78%40googlegroups.com.


[web2py] Re: Virtual Fields do not show in "details" view and are not searchable

2019-04-18 Thread Seth J
Hi,

I'm trying to achieve a very similar thing, but with "smartgrid" and not 
having any luck with response to 'viewargs' on Details page. It always 
displays the entire list of fields without virtuals no matter how I limit 
the fields.  Is there anything I am missing?

On Friday, June 6, 2014 at 8:21:41 AM UTC-4, Anthony wrote:
>
> Virtual field shows up OK in the "table" view, but :
>>
>
>> 1. It does not appear at all when I click on "View" button
>>
>
> By default, virtual fields don't show up in readonly forms, but you can 
> list them in the "fields" argument. To pass the "fields" argument to the 
> view form when using the grid, you can use the "viewargs" argument. Maybe 
> something like:
>
> grid = SQLFORM.grid(db.mytable,
> viewargs={'fields': [f for f in db.mytable.__dict__
>  if isinstance(db.mytable[f], (
> Field, Field.Virtual))]},
> ...)
>
> We should probably add an argument to SQLFORM to automatically include 
> virtual fields in readonly forms. Feel free to submit a Google Code issue 
> about that (reference this thread).
>  
>
>> 2. are not used for "default" search
>>
>
> This would be difficult, as it would require selecting *all* the records 
> from the database, calculating the virtual fields for all records, and then 
> searching the Rows object using Python. Currently the search functionality 
> works by issuing a query to the database (i.e., the database does the 
> searching and returns only the matching records), and because the virtual 
> fields are not stored in the database, it is not possible for search to be 
> based on them. If this is important, you might consider using a computed 
> field instead.
>
> Anthony 
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Insecure string Pickle with web2py 2.15.2

2017-08-07 Thread Seth J
It is Sqlite3 and after following directions in this post to solve the 
"pickle issue" I get the following error with username table.  Am I missing 
something?

 no such column: auth_user.usernameVersion
web2py™ Version 2.15.3-stable+timestamp.2017.08.07.12.51.45
Python Python 2.7.10: C:\Python27\python.exe (prefix: C:\Python27)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.

Traceback (most recent call last):
  File ".\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:/inetpub/wwwroot/applications/PEDchangeLog/controllers/default.py" 
<https://vmweb2pysql02.gpo.gov/admin/default/edit/PEDchangeLog/controllers/default.py>,
 line 90, in 
  File ".\gluon\globals.py", line 409, in 
self._caller = lambda f: f()
  File "C:/inetpub/wwwroot/applications/PEDchangeLog/controllers/default.py" 
<https://vmweb2pysql02.gpo.gov/admin/default/edit/PEDchangeLog/controllers/default.py>,
 line 41, in user
return dict(form=auth())
  File ".\gluon\tools.py", line 1925, in __call__
return getattr(self, args[0])()
  File ".\gluon\tools.py", line 2704, in login
user = table_user(**{username: entered_username})
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\objects.py", line 566, in 
__call__
orderby_on_limitby=False).first()
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\objects.py", line 2211, in 
select
return adapter.select(self.query, fields, attributes)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\sqlite.py", line 
82, in select
return super(SQLite, self).select(query, fields, attributes)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py", line 
762, in select
return self._select_aux(sql, fields, attributes, colnames)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py", line 
718, in _select_aux
rows = self._select_aux_execute(sql)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py", line 
712, in _select_aux_execute
self.execute(sql)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\__init__.py", line 
67, in wrap
return f(*args, **kwargs)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py", line 
412, in execute
rv = self.cursor.execute(command, *args[1:], **kwargs)
OperationalError: no such column: auth_user.username

Error snapshot [image: help] 
<https://vmweb2pysql02.gpo.gov/admin/default/ticket/PEDchangeLog/172.24.216.193.2017-08-07.16-39-27.fc960f63-bfb3-4fd6-9986-becad04c0c46#>

(no such column: auth_user.username)

On Monday, August 7, 2017 at 4:31:22 PM UTC-4, Dave S wrote:
>
>
>
> On Monday, August 7, 2017 at 1:08:47 PM UTC-7, Seth J wrote:
>>
>> So, the data in those tables is permanently gone?!
>>
>
> No, no ... "table files" describes the METADATA that PyDal uses to 
> interface with the Data Base Engine.  Unless you're using Sqlite3, the 
> actual data isn't even in the application directory, and (for production) 
> not even on the same machine.
>  
> /dps
>
>
>
>> On Friday, August 4, 2017 at 12:15:29 PM UTC-4, Leonel Câmara wrote:
>>>
>>> This is weird I would just move all table files to a backup migration 
>>> and do a fake migration to recreate them and see if it solves the problem.
>>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Insecure string Pickle with web2py 2.15.2

2017-08-07 Thread Seth J
So, the data in those tables is permanently gone?!

On Friday, August 4, 2017 at 12:15:29 PM UTC-4, Leonel Câmara wrote:
>
> This is weird I would just move all table files to a backup migration and 
> do a fake migration to recreate them and see if it solves the problem.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Grid edit behavior when no changes are made

2017-08-04 Thread Seth J
So, archives on this page: https://github.com/niphlod/web2py/releases  
don't contain it?!?! 

On Friday, August 4, 2017 at 4:34:16 PM UTC-4, Dave S wrote:
>
>
>
> On Friday, August 4, 2017 at 1:17:08 PM UTC-7, Seth J wrote:
>>
>> Another quick question.  How do I  revert back to 2.14.6 or 2.14.5 then?  
>> I downloaded the appropriate version archive and replaced all of the files 
>> in the installation and it still gives me the same error message:
>>
>
> If you're pulling from the github archive, you need to do a recursive pull 
> to get the correct version of PyDal.   The zip files, during their time on 
> the download page, take care of that for you.
>
> /dps
>
>
>  
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Grid edit behavior when no changes are made

2017-08-04 Thread Seth J
Another quick question.  How do I  revert back to 2.14.6 or 2.14.5 then?  I 
downloaded the appropriate version archive and replaced all of the files in 
the installation and it still gives me the same error message:

Version
web2py™ Version 2.14.5-stable+timestamp.2016.04.13.22.22.13
Python Python 2.7.10: C:\Python27\python.exe (prefix: C:\Python27)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

Traceback (most recent call last):
  File ".\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File "C:/inetpub/wwwroot/applications/CongressionalOfficeDev/models/db.py" 
,
 line 133, in 
migrate=settings.migrate)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\base.py", line 587, in 
define_table
table = self.lazy_define_table(tablename, *fields, **args)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\base.py", line 596, in 
lazy_define_table
fields = list(fields) + [f.clone() for f in common_fields]
AttributeError: 'Table' object has no attribute 'clone'



On Thursday, August 3, 2017 at 1:24:08 PM UTC-4, Leonel Câmara wrote:
>
> Seth that 2.15.2 bug has been fixed in trunk. Please wait for 2.15.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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Grid edit behavior when no changes are made

2017-08-03 Thread Seth J
Thanks, Leonel!  Looking forward to it ...

On Thursday, August 3, 2017 at 1:24:08 PM UTC-4, Leonel Câmara wrote:
>
> Seth that 2.15.2 bug has been fixed in trunk. Please wait for 2.15.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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Grid edit behavior when no changes are made

2017-08-03 Thread Seth J
And it appears to be broken:

web2py™ Version 2.15.2-stable+timestamp.2017.07.19.12.18.41
Python Python 2.7.10: C:\Python27\python.exe (prefix: C:\Python27)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

Traceback (most recent call last):
  File ".\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:/inetpub/wwwroot/applications/CongressionalOfficeDev/models/db.py" 
<https://vmweb2pysql02.gpo.gov/admin/default/edit/CongressionalOfficeDev/models/db.py>,
 line 133, in 
migrate=settings.migrate)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\base.py", line 587, in 
define_table
table = self.lazy_define_table(tablename, *fields, **args)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\base.py", line 596, in 
lazy_define_table
fields = list(fields) + [f.clone() for f in common_fields]
AttributeError: 'Table' object has no attribute 'clone'


On Thursday, August 3, 2017 at 12:46:13 PM UTC-4, Seth J wrote:
>
> We're using 2.14.5 version of web2py so far.  Let me update one of our 
> dev servers and see if that solves the issue.  Thanks, Anthony!!!
>
> On Thursday, August 3, 2017 at 12:30:11 PM UTC-4, Anthony wrote:
>>
>> Also, what version of web2py are you using? Looking at the code, it 
>> appears this issue might be resolved in the current version of the DAL (it 
>> now generates all the fields to be updated *before *call the 
>> _before_update callbacks, which should result in the archive record being 
>> generated due to the new values for modified_on and modified_by).
>>
>> Anthony
>>
>> On Thursday, August 3, 2017 at 12:25:20 PM UTC-4, Anthony wrote:
>>>
>>> The problem is that archiving is handled via a _before_update callback, 
>>> which (a) only receives the fields that are explicitly submitted with the 
>>> form (i.e., not the modified_on and modified_by fields) and (b) archives 
>>> only if the submitted fields differ from those in the original record. The 
>>> modified_on and modified_by values, on the other hand, are not updated 
>>> until after the _before_update callback is called.
>>>
>>> To avoid the behavior, I think you will have to manually check whether 
>>> the submitted fields differ from the original record and then either (a) 
>>> temporarily changed the "update" attribute of the modified_on and 
>>> modified_by fields so their values are not actually updated or (b) 
>>> explicitly add the modified_on and modified_by fields to the form vars so 
>>> the archive record creation will be triggered.
>>>
>>> Anthony
>>>
>>> On Wednesday, August 2, 2017 at 12:45:48 PM UTC-4, Seth J wrote:
>>>>
>>>> Quick question, guys.  I've noticed that when record is edited in a 
>>>> grid and no changes are made to it when hitting 'Submit' no entry is made 
>>>> into a corresponding archive table.  However, fields "modified on" and 
>>>> "modified by" are adjusted according to a user who submitted a change.  Is 
>>>> there way to either not change the latter fields or put an entry in an 
>>>> archive table reflecting previous state?  
>>>> It becomes a little bit misleading and hard to proof that people have 
>>>> not made any changes to the record when their name appears as an editor of 
>>>> the field.  Thanks!
>>>>
>>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Grid edit behavior when no changes are made

2017-08-03 Thread Seth J
We're using 2.14.5 version of web2py so far.  Let me update one of our dev 
servers and see if that solves the issue.  Thanks, Anthony!!!

On Thursday, August 3, 2017 at 12:30:11 PM UTC-4, Anthony wrote:
>
> Also, what version of web2py are you using? Looking at the code, it 
> appears this issue might be resolved in the current version of the DAL (it 
> now generates all the fields to be updated *before *call the 
> _before_update callbacks, which should result in the archive record being 
> generated due to the new values for modified_on and modified_by).
>
> Anthony
>
> On Thursday, August 3, 2017 at 12:25:20 PM UTC-4, Anthony wrote:
>>
>> The problem is that archiving is handled via a _before_update callback, 
>> which (a) only receives the fields that are explicitly submitted with the 
>> form (i.e., not the modified_on and modified_by fields) and (b) archives 
>> only if the submitted fields differ from those in the original record. The 
>> modified_on and modified_by values, on the other hand, are not updated 
>> until after the _before_update callback is called.
>>
>> To avoid the behavior, I think you will have to manually check whether 
>> the submitted fields differ from the original record and then either (a) 
>> temporarily changed the "update" attribute of the modified_on and 
>> modified_by fields so their values are not actually updated or (b) 
>> explicitly add the modified_on and modified_by fields to the form vars so 
>> the archive record creation will be triggered.
>>
>> Anthony
>>
>> On Wednesday, August 2, 2017 at 12:45:48 PM UTC-4, Seth J wrote:
>>>
>>> Quick question, guys.  I've noticed that when record is edited in a grid 
>>> and no changes are made to it when hitting 'Submit' no entry is made into a 
>>> corresponding archive table.  However, fields "modified on" and "modified 
>>> by" are adjusted according to a user who submitted a change.  Is there way 
>>> to either not change the latter fields or put an entry in an archive table 
>>> reflecting previous state?  
>>> It becomes a little bit misleading and hard to proof that people have 
>>> not made any changes to the record when their name appears as an editor of 
>>> the field.  Thanks!
>>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Grid edit behavior when no changes are made

2017-08-02 Thread Seth J
Quick question, guys.  I've noticed that when record is edited in a grid 
and no changes are made to it when hitting 'Submit' no entry is made into a 
corresponding archive table.  However, fields "modified on" and "modified 
by" are adjusted according to a user who submitted a change.  Is there way 
to either not change the latter fields or put an entry in an archive table 
reflecting previous state?  
It becomes a little bit misleading and hard to proof that people have not 
made any changes to the record when their name appears as an editor of the 
field.  Thanks!

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: sqlform.grid maxtextlengths shoots blanks

2017-07-25 Thread Seth J
I have a similar problem with maxtextlengths and I do have the "represent" 
attribute set like so:
Field('f_last_change', type='text',
  label=T('Latest Changes'),
  default = '',
  represent=lambda text, row: HTML(XML('' if text is 
None else text.replace('\n', '')), sanitize=True, 
permitted_tags=['br/'])
 )

Any suggestions how to keep the formatting, but still have field 
truncated?  Thanks!!!


On Friday, June 12, 2015 at 12:07:20 PM UTC-4, Anthony wrote:
>
> Which version of web2py? Also, have you set the "represent" attribute on 
> the field in question?
>
> And just to be clear, is the problem that the actual text truncation isn't 
> happening where you expect, or is it just that the physical width of the 
> table column is smaller than you'd like? Maybe show a screenshot.
>
> Anthony
>
> On Friday, June 12, 2015 at 12:27:27 AM UTC-4, jackso...@quantachrome.com 
>  wrote:
>>
>> I get the same truncated display for the log message text no matter what 
>> I set maxtextlengths...This app is rock+1 on the IQ simplicity scale and 
>> yet it does not work...BTW: I removed all layouts stuff so its not some css 
>> problem. The truncated fields are what the grid wants to display. Its like 
>> the grid is on autopilot, any suggestions???
>>
>> MODEL:
>>
>> db2 = DAL('sqlite://autoflowLog.sqlite')
>> db2.define_table('log_messages',
>> Field('time_stamp', length=30),
>> Field('log_message_text', length = 256))
>> db2.log_messages.id.readable = False
>>
>> VIEW:
>>
>> AutoFlow Log
>> Log Messages:
>> {{=form}}
>>
>>
>> CONTROLLER:
>>
>> def display_log():
>> grid = SQLFORM.grid(db2.log_messages, editable = False, searchable = 
>> False,formstyle = 'divs',maxtextlengths={'log_messages.log_message_text' : 
>> 80})
>> return dict(form=grid)
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Seth J
Yes, two versions are different.  It seems to be the culprit here.  Linux 
has a 2.13.3   version (I think I mentioned it above somewhere).  IIS has 
the latest 2.14.5 on it.  Thanks!

On Friday, June 9, 2017 at 7:01:14 PM UTC-4, Anthony wrote:
>
> On Friday, June 9, 2017 at 4:03:09 PM UTC-4, Seth J wrote:
>>
>> As a matter of fact, I've never specified a table for export control on 
>> any of my other apps written from scratch even on IIS and never had a 
>> problem.  It's just that particular app, for some reason, requires table 
>> name.
>>
>
> No, that's not possible. I think your original code worked with an earlier 
> version of web2py, which may explain the difference between the Linux and 
> Windows machines, but you also said if you created a brand new app on the 
> Windows machine the same code would work, which cannot be the case, as the 
> current version of web2py requires specifying the table names with the 
> exportclasses argument of smartgrid.
>
> Anthony
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Seth J
As a matter of fact, I've never specified a table for export control on any 
of my other apps written from scratch even on IIS and never had a problem. 
 It's just that particular app, for some reason, requires table name.

On Friday, June 9, 2017 at 3:49:12 PM UTC-4, Anthony wrote:
>
> Hmm, thought you said you were running the exact same code on both servers 
> as well as in new apps on the Windows server, and the only thing that 
> wasn't working was the packed app moved from Linux to Windows. But looks 
> like your code itself is wrong, so must not have been the same in the other 
> apps.
>
> On Friday, June 9, 2017 at 2:47:20 PM UTC-4, Seth J wrote:
>>
>> My bad!!! I thought you were referencing my code there!  Thanks a lot!!! 
>> That solved the problem!!!  
>>
>> On Friday, June 9, 2017 at 2:43:45 PM UTC-4, Jim S wrote:
>>>
>>> Sorry, I'm not sure what you're referencing...  Can you give me a line 
>>> number in default.py?
>>>
>>> -Jim
>>>
>>> On Friday, June 9, 2017 at 1:40:52 PM UTC-5, Seth J wrote:
>>>>
>>>> Can you be more specific?  I thought "title=dict(..." is reference 
>>>> enough?!?! 樂
>>>>
>>>> On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:
>>>>>
>>>>> You need to tell it which table you're referencing:
>>>>>
>>>>> title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
>>>>> links=title_links,
>>>>>editable=dict(title=True, 
>>>>> title_archive=False),
>>>>>deletable=dict(title=True, 
>>>>> title_archive=False),
>>>>>create=dict(title=True, 
>>>>> title_archive=False), user_signature=True, details=False,
>>>>>showbuttontext=True, paginate=30, 
>>>>> maxtextlengths={'title.f_title_desc': 50},
>>>>>    
>>>>> exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
>>>>> html=False,
>>>>>   
>>>>> tsv_with_hidden_cols=False, json=False)), orderby=orderby,
>>>>>divider="»", formname='title_grid')
>>>>>
>>>>>
>>>>> -Jim
>>>>>
>>>>> On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>>>>>>
>>>>>> Sorry, didn't think of it that way.  I'm attaching a minimal app that 
>>>>>> has two tables.  You'll need to create an account (sign up).  After that 
>>>>>> you can see this issue in "Title" page (via top menu).  Let me know what 
>>>>>> you think and if it works on your end.  I really appreciate it!
>>>>>>
>>>>>> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>>>>>>>
>>>>>>> You don't have to share the actual app, just create a minimal 
>>>>>>> application that reproduces the problem.
>>>>>>>
>>>>>>> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:
>>>>>>>>
>>>>>>>> I wish I could do that, but it's government code.  Security issues, 
>>>>>>>> etc.  I was just inquiring on how one would troubleshoot something 
>>>>>>>> like 
>>>>>>>> that?!?!  May be it's related to a theme somehow?!?!
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:
>>>>>>>>>
>>>>>>>>> If you'd like, feel free to attach a packed app that exhibits this 
>>>>>>>>> behavior (it should use SQLite as the db).
>>>>>>>>>
>>>>>>>>> On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>>>>>>>>>>
>>>>>>>>>> So, (a) on Linux, the export buttons are properly hidden, (b) on 
>>>>>>>>>> Windows, if you create a new app, again, the export buttons are 
>>>>>>>>>> properly 
>>>>>>>>>> hidden, but (c) if you pack an app from Linux and simply copy it to 
>>>>>>>>>> Windows, the export buttons that were hidde

[web2py] Re: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Seth J
It IS exactly the same! It controlled export just fine with the attached 
code on Linux, but did NOT on Win IIS. It is still a mystery to me and, 
apparently, Jim.

On Friday, June 9, 2017 at 3:49:12 PM UTC-4, Anthony wrote:
>
> Hmm, thought you said you were running the exact same code on both servers 
> as well as in new apps on the Windows server, and the only thing that 
> wasn't working was the packed app moved from Linux to Windows. But looks 
> like your code itself is wrong, so must not have been the same in the other 
> apps.
>
> On Friday, June 9, 2017 at 2:47:20 PM UTC-4, Seth J wrote:
>>
>> My bad!!! I thought you were referencing my code there!  Thanks a lot!!! 
>> That solved the problem!!!  
>>
>> On Friday, June 9, 2017 at 2:43:45 PM UTC-4, Jim S wrote:
>>>
>>> Sorry, I'm not sure what you're referencing...  Can you give me a line 
>>> number in default.py?
>>>
>>> -Jim
>>>
>>> On Friday, June 9, 2017 at 1:40:52 PM UTC-5, Seth J wrote:
>>>>
>>>> Can you be more specific?  I thought "title=dict(..." is reference 
>>>> enough?!?! 樂
>>>>
>>>> On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:
>>>>>
>>>>> You need to tell it which table you're referencing:
>>>>>
>>>>> title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
>>>>> links=title_links,
>>>>>editable=dict(title=True, 
>>>>> title_archive=False),
>>>>>deletable=dict(title=True, 
>>>>> title_archive=False),
>>>>>create=dict(title=True, 
>>>>> title_archive=False), user_signature=True, details=False,
>>>>>showbuttontext=True, paginate=30, 
>>>>> maxtextlengths={'title.f_title_desc': 50},
>>>>>    
>>>>> exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
>>>>> html=False,
>>>>>   
>>>>> tsv_with_hidden_cols=False, json=False)), orderby=orderby,
>>>>>divider="»", formname='title_grid')
>>>>>
>>>>>
>>>>> -Jim
>>>>>
>>>>> On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>>>>>>
>>>>>> Sorry, didn't think of it that way.  I'm attaching a minimal app that 
>>>>>> has two tables.  You'll need to create an account (sign up).  After that 
>>>>>> you can see this issue in "Title" page (via top menu).  Let me know what 
>>>>>> you think and if it works on your end.  I really appreciate it!
>>>>>>
>>>>>> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>>>>>>>
>>>>>>> You don't have to share the actual app, just create a minimal 
>>>>>>> application that reproduces the problem.
>>>>>>>
>>>>>>> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:
>>>>>>>>
>>>>>>>> I wish I could do that, but it's government code.  Security issues, 
>>>>>>>> etc.  I was just inquiring on how one would troubleshoot something 
>>>>>>>> like 
>>>>>>>> that?!?!  May be it's related to a theme somehow?!?!
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:
>>>>>>>>>
>>>>>>>>> If you'd like, feel free to attach a packed app that exhibits this 
>>>>>>>>> behavior (it should use SQLite as the db).
>>>>>>>>>
>>>>>>>>> On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>>>>>>>>>>
>>>>>>>>>> So, (a) on Linux, the export buttons are properly hidden, (b) on 
>>>>>>>>>> Windows, if you create a new app, again, the export buttons are 
>>>>>>>>>> properly 
>>>>>>>>>> hidden, but (c) if you pack an app from Linux and simply copy it to 
>>>>>>>>>> Windows, the export buttons that were hidden on Linux suddenly 
>>>>>>>>>

[web2py] Re: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Seth J
My bad!!! I thought you were referencing my code there!  Thanks a lot!!! 
That solved the problem!!!  

On Friday, June 9, 2017 at 2:43:45 PM UTC-4, Jim S wrote:
>
> Sorry, I'm not sure what you're referencing...  Can you give me a line 
> number in default.py?
>
> -Jim
>
> On Friday, June 9, 2017 at 1:40:52 PM UTC-5, Seth J wrote:
>>
>> Can you be more specific?  I thought "title=dict(..." is reference 
>> enough?!?! 樂
>>
>> On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:
>>>
>>> You need to tell it which table you're referencing:
>>>
>>> title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
>>> links=title_links,
>>>editable=dict(title=True, 
>>> title_archive=False),
>>>deletable=dict(title=True, 
>>> title_archive=False),
>>>create=dict(title=True, 
>>> title_archive=False), user_signature=True, details=False,
>>>showbuttontext=True, paginate=30, 
>>> maxtextlengths={'title.f_title_desc': 50},
>>>
>>> exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
>>> html=False,
>>>       
>>> tsv_with_hidden_cols=False, json=False)), orderby=orderby,
>>>divider="»", formname='title_grid')
>>>
>>>
>>> -Jim
>>>
>>> On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>>>>
>>>> Sorry, didn't think of it that way.  I'm attaching a minimal app that 
>>>> has two tables.  You'll need to create an account (sign up).  After that 
>>>> you can see this issue in "Title" page (via top menu).  Let me know what 
>>>> you think and if it works on your end.  I really appreciate it!
>>>>
>>>> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>>>>>
>>>>> You don't have to share the actual app, just create a minimal 
>>>>> application that reproduces the problem.
>>>>>
>>>>> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:
>>>>>>
>>>>>> I wish I could do that, but it's government code.  Security issues, 
>>>>>> etc.  I was just inquiring on how one would troubleshoot something like 
>>>>>> that?!?!  May be it's related to a theme somehow?!?!
>>>>>>
>>>>>>
>>>>>> On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:
>>>>>>>
>>>>>>> If you'd like, feel free to attach a packed app that exhibits this 
>>>>>>> behavior (it should use SQLite as the db).
>>>>>>>
>>>>>>> On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>>>>>>>>
>>>>>>>> So, (a) on Linux, the export buttons are properly hidden, (b) on 
>>>>>>>> Windows, if you create a new app, again, the export buttons are 
>>>>>>>> properly 
>>>>>>>> hidden, but (c) if you pack an app from Linux and simply copy it to 
>>>>>>>> Windows, the export buttons that were hidden on Linux suddenly appear 
>>>>>>>> on 
>>>>>>>> Windows?
>>>>>>>>
>>>>>>>> I can't think if anything that would cause that behavior, and it 
>>>>>>>> would be hard to diagnose without interacting directly with the system.
>>>>>>>>
>>>>>>>> Anthony
>>>>>>>>
>>>>>>>> On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:
>>>>>>>>>
>>>>>>>>> That's the thing! There's no difference in my code, apart from 
>>>>>>>>> connecting to different database. Controller and view are exactly the 
>>>>>>>>> same. 
>>>>>>>>> Same behavior is exhibited by all other controllers/views (about 10 
>>>>>>>>> in 
>>>>>>>>> total). 
>>>>>>>>> I am not saying that there's an error in framework. Apps created 
>>>>>>>>> on Win Server installation of web2py hide unneeded export options 
>>>>>>>>> just 
>>>>>>>>> fine. 
>>>>>>>>> It's just this app that was originally done on Linux, 2.13 web2py, 
>>>>>>>>> 2.6 python; when packed and installed on Win Server running web2py 
>>>>>>>>> does not 
>>>>>>>>> respond to disabling selected export options. 
>>>>>>>>>
>>>>>>>>> I am at a loss how to even debig this problem?! 路 
>>>>>>>>>
>>>>>>>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-09 Thread Seth J
Can you be more specific?  I thought "title=dict(..." is reference 
enough?!?! 樂

On Friday, June 9, 2017 at 2:37:20 PM UTC-4, Jim S wrote:
>
> You need to tell it which table you're referencing:
>
> title_grid = SQLFORM.smartgrid(db.title, linked_tables=['title_archive'], 
> links=title_links,
>editable=dict(title=True, title_archive=False),
>deletable=dict(title=True, 
> title_archive=False),
>create=dict(title=True, title_archive=False), 
> user_signature=True, details=False,
>showbuttontext=True, paginate=30, 
> maxtextlengths={'title.f_title_desc': 50},
>
> exportclasses=dict(title=dict(csv_with_hidden_cols=False, xml=False, 
> html=False,
>   tsv_with_hidden_cols=False, 
> json=False)), orderby=orderby,
>divider="»", formname='title_grid')
>
>
> -Jim
>
> On Friday, June 9, 2017 at 10:33:01 AM UTC-5, Seth J wrote:
>>
>> Sorry, didn't think of it that way.  I'm attaching a minimal app that has 
>> two tables.  You'll need to create an account (sign up).  After that you 
>> can see this issue in "Title" page (via top menu).  Let me know what you 
>> think and if it works on your end.  I really appreciate it!
>>
>> On Thursday, June 8, 2017 at 5:01:37 PM UTC-4, Anthony wrote:
>>>
>>> You don't have to share the actual app, just create a minimal 
>>> application that reproduces the problem.
>>>
>>> On Thursday, June 8, 2017 at 4:44:11 PM UTC-4, Seth J wrote:
>>>>
>>>> I wish I could do that, but it's government code.  Security issues, 
>>>> etc.  I was just inquiring on how one would troubleshoot something like 
>>>> that?!?!  May be it's related to a theme somehow?!?!
>>>>
>>>>
>>>> On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:
>>>>>
>>>>> If you'd like, feel free to attach a packed app that exhibits this 
>>>>> behavior (it should use SQLite as the db).
>>>>>
>>>>> On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>>>>>>
>>>>>> So, (a) on Linux, the export buttons are properly hidden, (b) on 
>>>>>> Windows, if you create a new app, again, the export buttons are properly 
>>>>>> hidden, but (c) if you pack an app from Linux and simply copy it to 
>>>>>> Windows, the export buttons that were hidden on Linux suddenly appear on 
>>>>>> Windows?
>>>>>>
>>>>>> I can't think if anything that would cause that behavior, and it 
>>>>>> would be hard to diagnose without interacting directly with the system.
>>>>>>
>>>>>> Anthony
>>>>>>
>>>>>> On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:
>>>>>>>
>>>>>>> That's the thing! There's no difference in my code, apart from 
>>>>>>> connecting to different database. Controller and view are exactly the 
>>>>>>> same. 
>>>>>>> Same behavior is exhibited by all other controllers/views (about 10 in 
>>>>>>> total). 
>>>>>>> I am not saying that there's an error in framework. Apps created on 
>>>>>>> Win Server installation of web2py hide unneeded export options just 
>>>>>>> fine. 
>>>>>>> It's just this app that was originally done on Linux, 2.13 web2py, 
>>>>>>> 2.6 python; when packed and installed on Win Server running web2py does 
>>>>>>> not 
>>>>>>> respond to disabling selected export options. 
>>>>>>>
>>>>>>> I am at a loss how to even debig this problem?! 路 
>>>>>>>
>>>>>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-08 Thread Seth J
I wish I could do that, but it's government code.  Security issues, etc.  I 
was just inquiring on how one would troubleshoot something like that?!?! 
 May be it's related to a theme somehow?!?!


On Thursday, June 8, 2017 at 8:38:52 AM UTC-4, Anthony wrote:
>
> If you'd like, feel free to attach a packed app that exhibits this 
> behavior (it should use SQLite as the db).
>
> On Thursday, June 8, 2017 at 8:20:24 AM UTC-4, Anthony wrote:
>>
>> So, (a) on Linux, the export buttons are properly hidden, (b) on Windows, 
>> if you create a new app, again, the export buttons are properly hidden, but 
>> (c) if you pack an app from Linux and simply copy it to Windows, the export 
>> buttons that were hidden on Linux suddenly appear on Windows?
>>
>> I can't think if anything that would cause that behavior, and it would be 
>> hard to diagnose without interacting directly with the system.
>>
>> Anthony
>>
>> On Thursday, June 8, 2017 at 12:27:31 AM UTC-4, Seth J wrote:
>>>
>>> That's the thing! There's no difference in my code, apart from 
>>> connecting to different database. Controller and view are exactly the same. 
>>> Same behavior is exhibited by all other controllers/views (about 10 in 
>>> total). 
>>> I am not saying that there's an error in framework. Apps created on Win 
>>> Server installation of web2py hide unneeded export options just fine. 
>>> It's just this app that was originally done on Linux, 2.13 web2py, 2.6 
>>> python; when packed and installed on Win Server running web2py does not 
>>> respond to disabling selected export options. 
>>>
>>> I am at a loss how to even debig this problem?! 路 
>>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-07 Thread Seth J
Neah, I never compile my apps for that very reason.

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-07 Thread Seth J
That's the thing! There's no difference in my code, apart from connecting to 
different database. Controller and view are exactly the same. Same behavior is 
exhibited by all other controllers/views (about 10 in total).
I am not saying that there's an error in framework. Apps created on Win Server 
installation of web2py hide unneeded export options just fine.
It's just this app that was originally done on Linux, 2.13 web2py, 2.6 python; 
when packed and installed on Win Server running web2py does not respond to 
disabling selected export options.

I am at a loss how to even debig this problem?! 路

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Smartgrid, grid export control works on Linux, but not on Windows Server

2017-06-07 Thread Seth J
I am experiencing a peculiar issue with smartgrid and grid.  I have web2py 
installed on Apache/2.2.15 (Red Hat)  and everything works as it supposed 
to with respect to disabling export options:

title_grid = SQLFORM.smartgrid(db.title, linked_tables = ['title_archive'], 
links=title_links, editable= dict(title=True, title_archive=False), 
deletable= dict(title=True, title_archive=False), create= dict(title=True, 
title_archive=False), user_signature=True, details=False, showbuttontext=
True, paginate=30, maxtextlengths={'title.f_title_desc':50}, exportclasses=
dict(csv_with_hidden_cols=False, xml=False, html=False, tsv_with_hidden_cols
=False, json=False), orderby=orderby, divider="»", formname='title_grid')

Here's a screenshot of it:


However, when the same exact application is installed on web2py 
2.14.5-stable+timestamp.2016.04.14.03.26.16
(Running on Microsoft-IIS/8.5, Python 2.7.10)   I get the full Export 
option regardless of the disabled options:



Is there something I am missing or something can be done to enable control 
over Export options? Thanks!!!

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How can I set the column width of a SQLFORM.grid table?

2016-05-03 Thread Seth J
maxtextlength=500   would make all columns show at most 500 characters.

On Monday, May 2, 2016 at 3:57:37 PM UTC-4, Bernardo Leon wrote:
>
> Hello, I have this table in my model:
>
> db.define_table('data', 
>   Field('description', 'string'), 
>   Field('value', 'integer'))
>
> this controller in default.py:
>
> def index():
>  tableN = SQLFORM.grid(db.data, 
> maxtextlengths={'data.description':500})
>  return locals()
>
> and this view:
>
> 
> {{=tableN}}
> 
>
> Thanks to maxtextlengths I can show all the description texts but since 
> they are large I can't see their respective value in the table that 
> SQLFORM.grid generates unless i use the horizontal scroll. Is there a way I 
> can still show all the description data but in a column with a small width? 
> It doesn't matter if the height of the cell grows but I dont want to use 
> the scroll because the table is big and I dont want to scroll all the time 
> I want to compare a description with their value. How can I achieve this? 
> Thank you!
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.13.3 is OUT

2015-12-24 Thread Seth J
Definitely something has gone awry there. I replaced "ldap_auth.py" and 
"ldap_auth.pyc" from the 2.12.3 version and it works again.


On Thursday, December 24, 2015 at 12:11:27 PM UTC-5, Seth J wrote:
>
> Hi Massimo,
>
> I just upgraded from 2.9.5 and it seemed to kill my LDAP authorization:
>
>  invalid syntax (ldap_auth.py, line 435)
> Versionweb2py™Version 2.13.3-stable+timestamp.2015.12.24.15.09.20PythonPython 
> 2.6.6: /usr/bin/python (prefix: /usr)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
>
> Traceback (most recent call last):
>   File "/opt/web-apps/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
>   File "/opt/web-apps/web2py/applications/CongressionalFoxPro/models/db.py" 
> <https://hqvmlxbgzla02.gpo.gov/admin/default/edit/CongressionalFoxPro/models/db.py>,
>  line 81, in 
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
>   File "/opt/web-apps/web2py/gluon/custom_import.py", line 108, in 
> custom_importer
> return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
>   File "/opt/web-apps/web2py/gluon/contrib/login_methods/ldap_auth.py", line 
> 435
> update_or_insert_values = {f: update_or_insert_values[f] for f in fields}
>^
> SyntaxError: invalid syntax
>
> Error snapshot [image: help] 
> <https://hqvmlxbgzla02.gpo.gov/admin/default/ticket/CongressionalFoxPro/172.24.216.193.2015-12-24.11-48-03.f24e6cfa-e08c-464b-8b30-32deddfcb84c#>
>
> (invalid syntax (ldap_auth.py, line 435))
>
> On Thursday, December 24, 2015 at 10:21:42 AM UTC-5, Massimo Di Pierro 
> wrote:
>>
>> web2py 2.13.3 is out. MERRY CHRISTMAS EVERYBODY!!!
>>
>> It contains some bug fixes for bugs introduced in 2.13.1-2 and most 
>> importantly it contains experimental support for JWT. Here is how it works:
>>
>> 1) instantiate auth with
>>
>> auth = Auth(db, jwt = {'secret_key':'secret'})
>>
>> where 'secret' is your own secret string. 
>>
>> 2) Secorate functions that require login but should accept the 
>> JWT token credentials:
>>
>> @auth.allows_jwt()
>> @auth.requires_login()
>> def myapi(): return 'hello %s' % auth.user.email
>> 
>> Notice jwt is allowed but not required. if user is logged in, 
>> myapi is accessible.
>>
>> 3) Use it!
>> Now API users can obtain a token with
>>
>> http://.../app/default/user/jwt?username=...=
>>
>> (returns json object with a token attribute)
>> API users can refresh an existing token with
>>
>> http://.../app/default/user/jwt?token=...
>>
>> they can authenticate themselves when calling http:/.../myapi by 
>> injecting a header
>>
>> Authorization: Bearer 
>>
>> Any additional attributes in the jwt argument of Auth() below:
>>
>>auth = Auth(db, jwt = {...})
>>
>> are passed to the constructor of class AuthJWT. Look there for 
>> documentation.
>>
>> Thanks Niphlod again for implementing this. 
>> Please help us check it so we will declare it stable in the next release.
>>
>> Massimo
>>
>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.13.3 is OUT

2015-12-24 Thread Seth J
Hi Massimo,

I just upgraded and it seemed to kill my LDAP authorization:

 invalid syntax (ldap_auth.py, line 435)
Versionweb2py™Version 2.13.3-stable+timestamp.2015.12.24.15.09.20PythonPython 
2.6.6: /usr/bin/python (prefix: /usr)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.

Traceback (most recent call last):
  File "/opt/web-apps/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File "/opt/web-apps/web2py/applications/CongressionalFoxPro/models/db.py" 
,
 line 81, in 
from gluon.contrib.login_methods.ldap_auth import ldap_auth
  File "/opt/web-apps/web2py/gluon/custom_import.py", line 108, in 
custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
  File "/opt/web-apps/web2py/gluon/contrib/login_methods/ldap_auth.py", line 435
update_or_insert_values = {f: update_or_insert_values[f] for f in fields}
   ^
SyntaxError: invalid syntax

Error snapshot [image: help] 


(invalid syntax (ldap_auth.py, line 435))

On Thursday, December 24, 2015 at 10:21:42 AM UTC-5, Massimo Di Pierro 
wrote:
>
> web2py 2.13.3 is out. MERRY CHRISTMAS EVERYBODY!!!
>
> It contains some bug fixes for bugs introduced in 2.13.1-2 and most 
> importantly it contains experimental support for JWT. Here is how it works:
>
> 1) instantiate auth with
>
> auth = Auth(db, jwt = {'secret_key':'secret'})
>
> where 'secret' is your own secret string. 
>
> 2) Secorate functions that require login but should accept the JWT 
> token credentials:
>
> @auth.allows_jwt()
> @auth.requires_login()
> def myapi(): return 'hello %s' % auth.user.email
> 
> Notice jwt is allowed but not required. if user is logged in, 
> myapi is accessible.
>
> 3) Use it!
> Now API users can obtain a token with
>
> http://.../app/default/user/jwt?username=...=
>
> (returns json object with a token attribute)
> API users can refresh an existing token with
>
> http://.../app/default/user/jwt?token=...
>
> they can authenticate themselves when calling http:/.../myapi by 
> injecting a header
>
> Authorization: Bearer 
>
> Any additional attributes in the jwt argument of Auth() below:
>
>auth = Auth(db, jwt = {...})
>
> are passed to the constructor of class AuthJWT. Look there for 
> documentation.
>
> Thanks Niphlod again for implementing this. 
> Please help us check it so we will declare it stable in the next release.
>
> Massimo
>
>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: smartgrid linked tables Query Not Supported: no such column undocumented feature

2014-05-15 Thread Seth J
You have to pass ordering instructions for each table separately like so:

orderby={'tile': ~db.tile.name, 'tile_archive':~db.tile_archive.modified_on}


-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Virtual Field not present in a record view of smartgrid

2014-05-15 Thread Seth J
I don't know if it's intentional or an omission.  I have defined a Virtual 
Field in one of the table definitions like so:

db.define_table('t_sig_count',
Field('f_jacket_no', type='string',
  label=T('Jacket')),
Field('f_quantity', type='integer',
  label=T('Quantity')),
Field('f_dept', type='string',
  label=T('Department')),
Field('f_title', type='string',
  label=T('Title')),
Field.Virtual('f_sig_count',
  lambda row: 
db(row.t_sig_count.id==db.t_jack_sigs.f_jacket_id).select(db.t_jack_sigs.f_sig.max()).first()[db.t_jack_sigs.f_sig.max()],
  label=T('Sig Count')),
Field('f_comments', type='text',
  label=T('Comments')),
Field('created_on', type='date', default=request.now,
  label=T('Date')),
format='%(f_jacket_no)s',
migrate=settings.migrate)

db.define_table('t_jack_sigs',
Field('f_jacket_id', 'reference t_sig_count',
  label=T('Jacket')),
Field('f_sig', type='integer',
  label=T('Sig')),
Field('f_no', type='integer',
  label=T('No.')),
Field('created_on', type='date', default=request.now,
  label=T('Date')),
Field('f_shift', type='integer',
  label=T('Shift')),
Field('f_loc', type='string',
  label=T('Loc.')),
Field('f_comments', type='text',
  label=T('Comments')),
format='%(f_sig)s',
migrate=settings.migrate)

As you can see, it finds a highest value of one field in a linked table. 
 It works just fine and displays a calculated value in a grid:

https://lh5.googleusercontent.com/-SP1vhpLdNVc/U3S-Qsde6BI/BfI/eQj_DKPxbtI/s1600/smartgrid_virt_F.png
However, when I click on a View button to see that record virtual field and 
its value is nowhere to be found.

https://lh4.googleusercontent.com/-5RqPZH83IG4/U3S-no6NBCI/BfQ/h4YaBzT_3IY/s1600/smartgrid_virt_f_view.png
So, my question is it why is it not displayed?

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Virtual Field not present in a record view of smartgrid

2014-05-15 Thread Seth J
Also, I have discovered with this set up that all Export functions/buttons 
except JSON and XML will crash not finding the column.  Is that a glitch?!?!

https://lh4.googleusercontent.com/-OT2ySMqgrpc/U3UUR_XfRTI/Bfg/6ruaP-do1Xs/s1600/Export_error.png

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Fieldset styling in custom search widget of SQLFORM.smartgrid

2014-05-07 Thread Seth J
So, I progressed to being able to successfully create a custom search 
widget for SQLFORM.smartgrid .  Along the way I discovered that you can 
only put one form there (may be I'm wrong, then I would appreciate hints). 
 As an alternate solution I implemented all fields in a single form, but 
decided to separate them by fieldsets like so:

def customSearch(self, url):
# Build a simple form
userId = auth.user_id
userDates = 
db(db.work_log.created_by==userId).select(distinct=db.work_log.created_on)
userYears = list(set(str(userDates[i].created_on.year) for i in 
range(len(userDates
options = [OPTION(userYears[i], _value=str(userYears[i])) for i in 
range(len(userYears))]
optionsAdded=options[:]
optionsAdded.insert(0, OPTION('All Records', _value=0))

form = FORM(FIELDSET(TAG.legend(Yearly Report),
SELECT(_name='year', _id='year', _style='width:150px;', 
value=request.get_vars.year, *optionsAdded),
INPUT(_type='submit',_value=T('Yearly Report')),
INPUT(_type='submit',_value=T('Clear'), 
_onclick=jQuery('#year').val('');jQuery('#jac_num').val('');), 
_id=yearly_report),
FIELDSET(TAG.legend(Jacket Search),
INPUT(_name='jac_num', _id='jac_num', _style='width:150px;', 
value=request.get_vars.jac_num),
INPUT(_type='submit', _value=T('Search for Jacket')),
INPUT(_type='submit', _value=T('Clear'), 
_onclick=jQuery('#jac_num').val('');jQuery('#year').val('');), 
_id=jacket_search),
_method=GET,_action='self', _id='contactSearch', formstyle = 
'bootstrap')
return form

However the result I get is a separation of fields by heavy headers:   

https://lh3.googleusercontent.com/-FeEF8fQ1LP8/U2pidrCaY3I/Bew/VBspyKIjXII/s1600/fieldset_problem.png

I found some fieldset formatting in web2py.css  but when I disable it, only 
minor changes are done to fieldset (font, background, etc).  What I'm 
looking for is to achieve a default html fieldset look that surrounds 
related fields in a thin line with legend that intersects that line like so:

http://www.webstandards.org/files/accessible-forms/nested-fieldset.gif

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Smartgrid and archive buttons

2014-05-02 Thread Seth J
Found a solution to my last question here:   

db.your_table_archive._plural = 'Your Label'
renames record archive links for smartgrid.  Topic is considered closed by 
me.


On Monday, April 7, 2014 6:18:29 PM UTC-4, Seth J wrote:

 Thanks for leading me in the right direction regarding separating 
 permissions!!!

 After I explicitly defined a table, I was able to set separate 'editable' 
 and 'deletable' parameters:
   
 editable= dict(work_log=is_owner, work_log_archive=False), deletable= dict
 (work_log=is_owner, work_log_archive=False)

 My other question regarding changing a wording on a link Work log 
 archives remains.  I cannot really create another custom link as the 
 default one would also be showing.  If I disable links_in_grid, none of the 
 links show up.

 On Monday, April 7, 2014 5:41:21 PM UTC-4, 黄祥 wrote:

 had you already try to define the linked_table explicit in your smartgrid?
 e.g.
 linked_tables = ['detail']

 best regards,
 stifan



-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error when implementing search_widget for SQLFORM.smartgrid

2014-05-02 Thread Seth J
Found a solution to this problem.  It appears that contactSearch needs 
two parameters and should be defined as follows (older examples had it 
wrong):

def contactSearch(self, url):
...
   return form

Topic is considered to be closed by me.

On Friday, April 11, 2014 1:49:12 PM UTC-4, Seth J wrote:

 Hello again,

 I apologize for potentially naive question as I am new to web2py.  I am 
 trying to implement a custom search_widget on SQLFORM.smartgrid and ran 
 into an error.

 My table is defined in db.py as such:

 ## We prepend f_ to fieldnames for disambiguity
 db._common_fields.append(auth.signature)  ## adds signature fields to all 
 tables

 db.define_table('work_log',
 Field('f_jacket_no', type='string',
   label=T('Jacket Number')),
 Field('f_job_title_format_no', type='string',
   label=T('Job Title  Format Number')),
 Field('f_assoc_no', type='string',
   label=T('Associated Information')),
 Field('f_status_destination', type='string',
   label=T('Status  Destination')),
 Field('f_probe', type='boolean',
   label=T('Peps')),
 Field('created_on', type='date', default=request.now,
   label=T('Date Out')),
 format='%(f_job_title_format_no)s',
 migrate=settings.migrate)

 db.work_log._plural = T('Work Log')
 db.work_log._singular = T('Work Entry')
 db.work_log.f_jacket_no.requires = IS_MATCH('\d{3}-\d{3}', strict=True, 
 error_message='Please use 000-000 format for Jacket No. (including leading 
 0)')
 db.work_log.f_job_title_format_no.requires = requires=IS_IN_SET(['Public 
 Law: 6580', 'WM Hearing: 5011', 'VA Hearing: 5011', 'State Disburse: 
 9334', 'Leg Calendar: 7800', 'Leg Branch Appro: 3700', 'Final Calendar: 
 7800', '112th Congress: 7800', 'CFR: 8091 (Indicate title  vol. num. at 
 Assoc. Info.)', 'Other (Indicate at Assoc. Info.)'])
 db.work_log.f_status_destination.requires = requires=IS_IN_SET(['1st Try: 
 PR', 'OK to Print: TE', 'CX\'s: PR', 'AA\'s: PR', 'Converted: TP'])
 db.work_log.created_on.represent = lambda value, x: 
 value.strftime('%m/%d/%Y')
 db.work_log.created_on.writable = False

 ## after defining tables, uncomment below to enable auditing
 auth.enable_record_versioning(db)

 In a default.py controller I have among other standard things these two 
 functions of interest  I followed example from this topic (
 https://groups.google.com/forum/#!topic/web2py/tku5zkVZfZc) :

 def contactSearch(self):
 # Build a simple form
 userId = auth.user_id
 
 form = FORM('',
 LABEL('Name:', _for='asset_name'),
 INPUT(_name='asset_name',_value=userId, _id='web2py_asset_name'),
 INPUT(_type='submit',_value=T('Search')),
 INPUT(_type='submit',_value=T('Clear'), 
 _onclick=jQuery('#asset_name').val('');), _method=GET,_action='self', 
 _id='contactSearch')
 return form


 @auth.requires_login()
 def work_log_manage():
 is_owner = (lambda row: row.created_by == auth.user_id) if auth.user 
 else False
 db.work_log.id.readable=False # Since we do not want to expose the id 
 field on the grid
 db.work_log.created_by.readable=True # Show owner of record
 db.work_log_archive.id.readable=False # Since we do not want to expose 
 the id field on the grid
 links = [lambda row: A('View 
 Post',_href=URL(default,work_log_archive.current_record,args=[row.id
 ]))]
 orderby = ['created_on']
 
 searchForms = dict(work_log=contactSearch, work_log_archive=None)
 
 grid = SQLFORM.smartgrid(db.work_log, linked_tables = 
 ['work_log_archive'], editable= dict(work_log=is_owner, 
 work_log_archive=False), deletable= dict(work_log=is_owner, 
 work_log_archive=False), user_signature=True, details=False, 
 search_widget=searchForms, showbuttontext=True, links_in_grid=False, 
 links=links, paginate=30, 
 maxtextlengths={'work_log.f_job_title_format_no':60}, orderby=orderby)
 return dict(grid=grid)

 I know contactSearch doesn't do much.  At the moment I am simply trying to 
 display a widget.  I get the following error when accessing a page:

 Version
 web2py™ Version 2.9.5-stable+timestamp.2014.03.16.02.35.39
 Python Python 2.7.3: /usr/bin/python (prefix: /usr)
 Traceback

 Traceback (most recent call last):
 File /home/www-data/web2py/gluon/restricted.py, line 220, in restricted
 exec ccode in environment
 File /home/www-data/web2py/applications/worklog/controllers/default.py, 
 line 104, in module
 File /home/www-data/web2py/gluon/globals.py, line 385, in lambda
 self._caller = lambda f: f()
 File /home/www-data/web2py/gluon/tools.py, line 3287, in f
 return action(*a, **b)
 File /home/www-data/web2py/applications/worklog/controllers/default.py, 
 line 101, in work_log_manage
 grid = SQLFORM.smartgrid(db.work_log, linked_tables = 
 ['work_log_archive'], editable= dict(work_log

[web2py] Error when implementing search_widget for SQLFORM.smartgrid

2014-04-13 Thread Seth J
Hello again,

I apologize for potentially naive question as I am new to web2py.  I am 
trying to implement a custom search_widget on SQLFORM.smartgrid and ran 
into an error.

My table is defined in db.py as such:

## We prepend f_ to fieldnames for disambiguity
db._common_fields.append(auth.signature)  ## adds signature fields to all 
tables

db.define_table('work_log',
Field('f_jacket_no', type='string',
  label=T('Jacket Number')),
Field('f_job_title_format_no', type='string',
  label=T('Job Title  Format Number')),
Field('f_assoc_no', type='string',
  label=T('Associated Information')),
Field('f_status_destination', type='string',
  label=T('Status  Destination')),
Field('f_probe', type='boolean',
  label=T('Peps')),
Field('created_on', type='date', default=request.now,
  label=T('Date Out')),
format='%(f_job_title_format_no)s',
migrate=settings.migrate)

db.work_log._plural = T('Work Log')
db.work_log._singular = T('Work Entry')
db.work_log.f_jacket_no.requires = IS_MATCH('\d{3}-\d{3}', strict=True, 
error_message='Please use 000-000 format for Jacket No. (including leading 
0)')
db.work_log.f_job_title_format_no.requires = requires=IS_IN_SET(['Public 
Law: 6580', 'WM Hearing: 5011', 'VA Hearing: 5011', 'State Disburse: 
9334', 'Leg Calendar: 7800', 'Leg Branch Appro: 3700', 'Final Calendar: 
7800', '112th Congress: 7800', 'CFR: 8091 (Indicate title  vol. num. at 
Assoc. Info.)', 'Other (Indicate at Assoc. Info.)'])
db.work_log.f_status_destination.requires = requires=IS_IN_SET(['1st Try: 
PR', 'OK to Print: TE', 'CX\'s: PR', 'AA\'s: PR', 'Converted: TP'])
db.work_log.created_on.represent = lambda value, x: 
value.strftime('%m/%d/%Y')
db.work_log.created_on.writable = False

## after defining tables, uncomment below to enable auditing
auth.enable_record_versioning(db)

In a default.py controller I have among other standard things these two 
functions of interest  I followed example from this topic 
(https://groups.google.com/forum/#!topic/web2py/tku5zkVZfZc) :

def contactSearch(self):
# Build a simple form
userId = auth.user_id

form = FORM('',
LABEL('Name:', _for='asset_name'),
INPUT(_name='asset_name',_value=userId, _id='web2py_asset_name'),
INPUT(_type='submit',_value=T('Search')),
INPUT(_type='submit',_value=T('Clear'), 
_onclick=jQuery('#asset_name').val('');), _method=GET,_action='self', 
_id='contactSearch')
return form


@auth.requires_login()
def work_log_manage():
is_owner = (lambda row: row.created_by == auth.user_id) if auth.user 
else False
db.work_log.id.readable=False # Since we do not want to expose the id 
field on the grid
db.work_log.created_by.readable=True # Show owner of record
db.work_log_archive.id.readable=False # Since we do not want to expose 
the id field on the grid
links = [lambda row: A('View 
Post',_href=URL(default,work_log_archive.current_record,args=[row.id]))]
orderby = ['created_on']

searchForms = dict(work_log=contactSearch, work_log_archive=None)

grid = SQLFORM.smartgrid(db.work_log, linked_tables = 
['work_log_archive'], editable= dict(work_log=is_owner, 
work_log_archive=False), deletable= dict(work_log=is_owner, 
work_log_archive=False), user_signature=True, details=False, 
search_widget=searchForms, showbuttontext=True, links_in_grid=False, 
links=links, paginate=30, 
maxtextlengths={'work_log.f_job_title_format_no':60}, orderby=orderby)
return dict(grid=grid)

I know contactSearch doesn't do much.  At the moment I am simply trying to 
display a widget.  I get the following error when accessing a page:

Version
 web2py™ Version 2.9.5-stable+timestamp.2014.03.16.02.35.39
 Python Python 2.7.3: /usr/bin/python (prefix: /usr)
 Traceback

 Traceback (most recent call last):
 File /home/www-data/web2py/gluon/restricted.py, line 220, in restricted
 exec ccode in environment
 File /home/www-data/web2py/applications/worklog/controllers/default.py, 
 line 104, in module
 File /home/www-data/web2py/gluon/globals.py, line 385, in lambda
 self._caller = lambda f: f()
 File /home/www-data/web2py/gluon/tools.py, line 3287, in f
 return action(*a, **b)
 File /home/www-data/web2py/applications/worklog/controllers/default.py, 
 line 101, in work_log_manage
 grid = SQLFORM.smartgrid(db.work_log, linked_tables = 
 ['work_log_archive'], editable= dict(work_log=is_owner, 
 work_log_archive=False), deletable= dict(work_log=is_owner, 
 work_log_archive=False), user_signature=True, details=False, 
 search_widget=searchForms, showbuttontext=True, links_in_grid=False, 
 links=links, paginate=30, 
 maxtextlengths={'work_log.f_job_title_format_no':60}, orderby=orderby)
 File /home/www-data/web2py/gluon/sqlhtml.py, line 2800, in smartgrid
 

Re: [web2py] Smartgrid and archive buttons

2014-04-09 Thread Seth J
Thanks for leading me in the right direction regarding separating 
permissions!!!

After I explicitly defined a table, I was able to set separate 'editable' 
and 'deletable' parameters:
  
editable= dict(work_log=is_owner, work_log_archive=False), deletable= dict(
work_log=is_owner, work_log_archive=False)

My other question regarding changing a wording on a link Work log 
archives remains.  I cannot really create another custom link as the 
default one would also be showing.  If I disable links_in_grid, none of the 
links show up.

On Monday, April 7, 2014 5:41:21 PM UTC-4, 黄祥 wrote:

 had you already try to define the linked_table explicit in your smartgrid?
 e.g.
 linked_tables = ['detail']

 best regards,
 stifan


-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Smartgrid and archive buttons

2014-04-07 Thread Seth J
The problem is that there are no field explicitly defined for that link. 
 It appears automatically when I enable record_versioning. 

On Monday, April 7, 2014 2:49:00 AM UTC-4, Johann Spies wrote:




 On 4 April 2014 00:01, Seth J iva...@vsevolod.com javascript: wrote:

 Hi guys,


 As you can see there's Work log archives link before the button.  When 
 I click on it, it takes me to an archive for that record and they have the 
 same buttons attached to the right of every 'version'.  How do I disable 
 all buttons only in an archive table?  Also, is there a way to change the 
 wording on that link to something different than Work log archives in 
 smartgrid?


 Try adding  label = 'your desired label'  to the field.

 Regards
 Johann

 -- 
 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Smartgrid and archive buttons

2014-04-03 Thread Seth J
Hi guys,

New to web2py and have a potentially simple question about smartgrid.

In db.py I have an archive enabled after definition of my 'work_log' 
table:

## after defining tables, uncomment below to enable auditing
auth.enable_record_versioning(db)

in default.py controller I have the following:

@auth.requires_login()
def work_log_manage():
is_owner = (lambda row: row.created_by == auth.user_id) if auth.user 
else False  #Determine if user is an owner of a record
db.work_log.id.readable=False # Since we do not want to expose the id 
field on the grid
db.work_log_archive.id.readable=False # Since we do not want to expose 
the id field on the grid
db.work_log.created_by.readable=True # Show owner of a record
orderby = ['created_on']  # Order by record creation date
grid = SQLFORM.smartgrid(db.work_log, editable=is_owner, 
deletable=is_owner, user_signature=True, paginate=30, 
maxtextlengths={'work_log.f_job_title_format_no':50}, orderby=orderby)
return dict(grid=grid)

The goal is for each user to only be able to edit or delete his/her own 
record.  It works perfectly 

https://lh3.googleusercontent.com/-0ZOMoy7jcys/Uz3Y-BLpZrI/BeE/DdFGkUwEpN8/s1600/work_log.png
As you can see there's Work log archives link before the button.  When I 
click on it, it takes me to an archive for that record and they have the 
same buttons attached to the right of every 'version'.  How do I disable 
all buttons only in an archive table?  Also, is there a way to change the 
wording on that link to something different than Work log archives in 
smartgrid?

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.