[web2py] Re: Installing web2py in IIS 8.5 wwwroot subfolder

2018-03-27 Thread Edwood
I just ended installing in a different folder outside of Inetpub an it 
worked.


On Friday, March 23, 2018 at 7:05:37 PM UTC-4, Edwood wrote:
>
> I have been successful installing web2py inside "\Inetpub\wwwroot" as the 
> web2py deployment recipe and other resources instruct.  But what I am 
> trying to accomplish is to run it from "\Inetpub\wwwroot\web2py".
>
> What I am trying to avoid is too fill wwwroot with python files since 
> there are many ASP .Net sites already installed in that server.  I want to 
> be careful and not interfere with the operation of those sites.
>
> I suspect I should make changes in the web.config file, but I have not 
> found references to help me with that.
>
> My setup: Windows Server 2012R2, IIS 8.5, latest web2py 2.16.1-stable
>
> Any pointers will be appreciated.
>
>

-- 
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] btn-default

2018-03-27 Thread Andrea Fae'
Where is the definition btn-default in any welcome clone application? I 
need to change the style...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: conditional coloring of table rows

2018-03-27 Thread Dave S


On Monday, March 26, 2018 at 2:03:06 PM UTC-7, Lee Carmichael wrote:
>
> I have a question regarding conditionally setting the color of a table 
> row. What I'm trying to do is similar to this post:
>
> https://groups.google.com/forum/#!topic/web2py/gy01S0TwF70
>
> I guess my lack of experience is keeping me from making the leap from that 
> scenario to my own.
>
> My situation is that I have a JSON object that's returned from a REST API 
> call, rather than a db query. That object that has a field called 
> "entry_type" and "entry_color". I'm trying to use that to format the table 
> in my view but i can't figure out if i should edit the CSS to set the color 
> based on the "entry_type" or maybe simply do something in the view to pull 
> the color form the JSON. 
>
> It feels like this should be a CSS thing but I'm not sure where and how to 
> edit the web2py CSS files appropriately. 
>
> Thanks for any tips!
>

This isn't a complete answer, but I have this in one of my views:


*.odd  {background-color: #E5EECC}  /* light desert-y green */
*.odd  {background-color: #ddffcc}  /* light green-bar  */
*.odd  {background-color: #d0d0f0}  /* light blue grey  */




It's used in displaying a table, to give that lineprinter paper effect 
("green bar").  The order is significant; the last line overrides the other 
two; depending on my needs, I switch the order around to change the chosen 
color.

It's placed below the {{ extend layout.html }} line, so after all the css 
files have been read.  

For a dynamic situation, I'd make set up a css class, and then use 
javascript to add that classname to the td or tr element.

/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: Is there a typo !? uploadfs

2018-03-27 Thread Dave S


On Tuesday, March 27, 2018 at 10:52:20 AM UTC-7, Yoel Benitez Fonseca wrote:
>
> h! 
>
> In the book, 
>
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-constructor
>  
>
> Says: 
>
> "uploadfs allows you specify a different file system where to upload 
> files, including an Amazon S3 storage or a remote SFTP storage. This 
> option requires PyFileSystem installed. uploadfs must point to 
> PyFileSystem. uploadfs 
>
>
> widget must be one of the available widget objects, including custom 
> widgets,..." 
>
>
> At the end is 'must point to PyFileSystem.uploadfs' or 'must point to 
> PyFileSystem' and the last '. uploadfs' don't belongs there ? 
>   
>

I suspect it does, without a space between dot and yew:  
"PyFileSystem.uploadfs".

I'm not a PyFileSystem user, but I bet you instantiate the file system, 
creating a directory object.  In the book, that last "uploadfs" would be 
the name of the directory object.  (And I suspect you can use different 
names if you want, as long as you match the Field's target and the 
directory object name.)

We'll see what the experts say, though.

/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] UnicodeDecodeError "'utf-8' codec can't decode..." when inserting a blob in database (python 3.6.3)

2018-03-27 Thread alexandre . henry
Hello All,

I'm an absolute newbie with web2py so I'm not sure if the issue lies in 
web2py/3.6 or my own mistakes... My apologies in advance.

I encounter this error in a db.my_table.update_or_insert(..)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 96328: 
invalid start byte'


What I'm trying to do:
I have a text file that is the representation of a datamodel in a specific 
COTS format.
I want to parse it, list the tables to be created and create them actually.
I know that the file countains non-utf-8 characters, that's why I open it 
in binary:

   dpm_file = gzip.open(filepath,'rb')

... parse it using binary regex: (I imported the 'regex' module)
regexp = regex.compile(b':columns 
(\(((?>[^()]+)|(?1))*\))',regex.DOTALL)
header_classes = regexp.findall(one_format_text)[0]

... and insert the results in db blob fields: (the error occurs here)
db.dpm_header.update_or_insert(db.dpm_header.dpm == my_dpm_id, dpm = 
my_dpm_id, header_classes  = header_classes, header_objects  = 
header_objects)

I defined blob fields because I thought that it was the way to write 
directly in binary in database.
I really wanted to use binary preciselly to avoid to manage the 
encoding/decoding issues.

In addition, this project is an attempt to transport in web2py an older 
project that was working perfectly in pure python 3.6.3 (unix and windows) 
(except that instead of creating tables in a DB, I created text files in a 
filer...).
Is it a issue on web2py/python 3.6? Or my misunderstanding on database 
management...

Thank you for your help!

Here is the trace

Traceback (most recent call last):
  File "D:\web\zz\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "D:/web/zz/web2py/applications/dpm_manager/controllers/default.py" 
, 
line 175, in 
  File "D:\web\zz\web2py\gluon\globals.py", line 419, in 
self._caller = lambda f: f()
  File "D:\web\zz\web2py\gluon\tools.py", line 3982, in f
return action(*a, **b)
  File "D:/web/zz/web2py/applications/dpm_manager/controllers/default.py" 
, 
line 131, in analyze
header_classes  = header_classes)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\objects.py", line 811, in 
update_or_insert
record = self(_key)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\objects.py", line 565, in 
__call__
orderby_on_limitby=False).first()
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\objects.py", line 2250, in 
select
return adapter.select(self.query, fields, attributes)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\sqlite.py", line 82, 
in select
return super(SQLite, self).select(query, fields, attributes)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 762, 
in select
return self._select_aux(sql, fields, attributes, colnames)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 741, 
in _select_aux
return processor(rows, fields, colnames, cacheable=cacheable)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 305, 
in parse
for row in rows
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 302, 
in 
self._parse(
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 231, 
in _parse
value = self.parse_value(value, fit, ft, blob_decode)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\adapters\base.py", line 198, 
in parse_value
return self.parser.parse(value, field_itype, field_type)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 
101, in parse
return self.registered[field_itype](value, field_type)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 
76, in __call__
return self.call(value, field_type)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 
73, in _call
return self.f(self.parser, value)
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\parsers\base.py", line 37, in 
_blob
return to_native(b64decode(to_bytes(value)))
  File "D:\web\zz\web2py\gluon\packages\dal\pydal\_compat.py", line 82, in 
to_native
return obj.decode(charset, errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 96328: 
invalid start byte

-- 
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] Is there a typo !? uploadfs

2018-03-27 Thread Yoel Benítez Fonseca

h!

In the book, 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-constructor


Says:

"uploadfs allows you specify a different file system where to upload 
files, including an Amazon S3 storage or a remote SFTP storage. This 
option requires PyFileSystem installed. uploadfs must point to 
PyFileSystem. uploadfs



widget must be one of the available widget objects, including custom 
widgets,..."



At the end is 'must point to PyFileSystem.uploadfs' or 'must point to 
PyFileSystem' and the last '. uploadfs' don't belongs there ?



regards,
Yoel Benítez Fonseca

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