Re: [web2py] Re: Error ticket for "admin" when trying to create a view

2021-12-20 Thread Dave S
On Friday, December 17, 2021 at 9:12:55 AM UTC-8 mostwanted wrote:

> This is happening on a live app, its live, hosted on pythonanywhere. I am 
> starting to suspect something though, I recently received an email from 
> pythonanywhere.com informing me that I should change  the system image of 
> my app because my app is running on an old one called "dangermouse", in a 
> year's time that system image will be absolute so I was encouraged to use a 
> new one & I changed it. But they also warned that  my code might need 
> modification to run with the new system image & i am starting to suspect 
> that the system image i chose is the one affecting the normal functionality 
> of my app Just suspicions because before i changed my system image all 
> was good.
>
>
Did the python version change when you changed system images?  

Also, in the ticket you may be able to see which of request.vars.sender and 
anchor is the null value.

Dave S
/dps


 

> On Friday, December 17, 2021 at 2:52:22 PM UTC+2 Jim S wrote:
>
>> Is it possible your were no longer logged in or that you cleared your 
>> browser cache before this happened?
>>
>> Sense really weird. Have you tried with a fresh install of web2py?
>>
>> Jim
>>
>> On Fri, Dec 17, 2021, 5:56 AM mostwanted  wrote:
>>
>>> But that's just the thing, I wasn't trying pass any data, i just trying 
>>> to create a new view for a new function In my admin interface, as soon as I 
>>> clicked create the error popped up & the view failed to create.
>>>
>>> On Thursday, December 16, 2021 at 7:31:55 PM UTC+2 Jim S wrote:
>>>
 Looks like you're passing some data through the request vars and the 
 value is Null.  Would need to see more code to be able to help.

 -Jim

 On Wednesday, December 15, 2021 at 12:09:08 AM UTC-6 mostwanted wrote:

> Hi guys, I'm updating one of my very early projects, I was trying to 
> create a view and I got an error:  Error ticket for "admin", I dont 
> know what's causing it, how do I fix this? Its a new error that I have 
> never encountered before, thats the traceback below. I developed it with  
> Version 2.14.6
>
> Traceback
> Traceback (most recent call last):
> File "/home/sesoa/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
> File "/home/sesoa/web2py/applications/admin/controllers/default.py" 
> ,
>  
> line 2000, in 
> File "/home/sesoa/web2py/gluon/globals.py", line 417, in 
> self._caller = lambda f: f()
> File "/home/sesoa/web2py/applications/admin/controllers/default.py" 
> ,
>  
> line 1484, in create_file
> redirect(request.vars.sender + anchor)
> TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
>


-- 
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/e58c8d44-a412-4f13-ad68-bfea6bc4c6b5n%40googlegroups.com.


[web2py] SQLTABLE columns in 2.21.1

2021-12-20 Thread Dave S
The code in sqlhtml.py for SQLTABLE has changed along the way from 2.18.5 
to 2.21.1, especially in the way it handles columns.

This used to work:
in 2.21.1, I get an error

{{=SQLTABLE(rows, truncate=35, headers = {'QuarterMaster.IssueYr':'Year', 
'QuarterMaster.StateNm':'State', 'QuarterMaster.Other':'Other', 
'QuarterMaster.Mint':'Mint', 'QuarterMaster.NumAdded':'Count'}, 
columns=['QuarterMaster.IssueYr', 'QuarterMaster.StateNm', 
'QuarterMaster.Other', 'QuarterMaster.Mint', 'QuarterMaster.NumAdded'], 
_class="table-striped myeheaders")}}

in 2.21.1, I get an error

Traceback (most recent call last):
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\restricted.py", 
line 219, in restricted
exec(ccode, environment)
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\applications\QuarterMaster\views\default/sortedQ.html",
 
line 77, in 
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\sqlhtml.py", line 
3544, in __init__
"Column %s not found (SQLTABLE)" % colname)
KeyError: 'Column IssueYr not found (SQLTABLE)'

I've tried "QuarterMaster.IssueYr", "db.QuarterMaster.IssueYr", "IssueYr", 
and "rows.IssueYr".
Same error.

If I eliminate the columns argument, no error, but my data doesn't show. 
I've verified in the controller that the data gets into rows, and looks like



What do I need to make this work again?

Dave S
/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/9cc3a2b1-635e-4477-9794-b6f1b6eec84bn%40googlegroups.com.


[web2py] Re: DataTable() not a function

2021-12-20 Thread Dave S
Jim?  Other datatable gurus?

/dps


On Thursday, December 2, 2021 at 4:30:20 AM UTC-8 Dave S wrote:

> That's the error I'm getting, according to Chrome's console.
>
> The view code is pretty simple:
>
> 
> var table;
> $(document).ready(function(){
>table = $('#tableXactions').DataTable( {
>"data": {{=results}} ,
>"columns": [
> /* { data: 'xaction.PostDate'}, */
>  { data: 'xaction.Id' },
>  { data: 'xaction.Amount' },
>  { data: 'xaction.Expense' },
>  { data: 'xaction.Tag' }
> 
> ]
>
> });
>
>  });
> 
>
> 
>
>
>   Id
>   Amount
>   Expense
>   Tag
>
> 
> 
> 
>
> The console shows that jquery.dataTables.min.js (and the css) is loaded 
> from the datatables.net cdn (1.10.19, not the latest but close).  Both my 
> debug code and the console show that my results are as expected, so I don't 
> think the controller is where I messed up.
>  
> The actual console message is 
>
> listing:96 Uncaught TypeError: $(...).DataTable is not a function
> at HTMLDocument. (listing:96)
> at i (jquery.js:2)
> at Object.fireWith [as resolveWith] (jquery.js:2)
> at Function.ready (jquery.js:2)
> at HTMLDocument.K (jquery.js:2)
> (listing is my view/default/listing.html)
>   
> I get this error even if I have no options in the DataTable() call.  (And 
> I should be using DataTable(), not the dataTable() version, right?  
> Equivalent, but different return types)
>
> I have Roger's example, but it's much more complex than I'm ready for.  
> The sample on web2pyslices.com is about right, but uses a much older 
> version.  The examples on datatables.net are snippets that they assume 
> you know where to put them.
>
> What's the fix for my mistake (or at least, what's my mistake?)
>
> /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/69bebf83-c0c3-42ff-ad2b-977965a932afn%40googlegroups.com.