Re: [web2py] Re: web2py 2.18.5 is OUT

2019-07-28 Thread Angelo Compagnucci
HI Massimo,

Can you tag R-2.18.5?

Thanks!

Il giorno ven 5 lug 2019 alle ore 07:18 黄祥
 ha scritto:
>
> already tried define the length on field constructor and change web server 
> because error above refer to rocket.py
> ref:
> https://groups.google.com/d/msg/web2py/2B9B9o151II/UyfREFmlBgAJ
>
> modules/table_test.py
> test = db.define_table('test',
> Field('test', length = 255),
> on_define = on_define_test)
>
> $ python ~/learn/python/web2py/anyserver.py -s gevent -i 0.0.0.0 -p 8000
> starting gevent on 0.0.0.0:8000...
> Traceback (most recent call last):
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py",
>  line 976, in handle_one_response
> self.run_application()
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py",
>  line 924, in run_application
> self.process_result()
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py",
>  line 910, in process_result
> self.write(data)
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py",
>  line 757, in write
> self._write_with_headers(data)
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py",
>  line 778, in _write_with_headers
> self._write(data)
>   File 
> "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py",
>  line 733, in _write
> header_str = b'%x\r\n' % len(data)
> TypeError: object of type 'Field' has no len()
> 2019-07-03T10:07:08Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '63729', 
> 'HTTP_HOST': 'localhost:8000', (hidden keys: 28)} failed with TypeError
>
> btw, anyserver.py cant run gunicorn in 2.18.5, no error occured on terminal, 
> but cant be access on browser
>
> $ python ~/learn/python/web2py/anyserver.py -s gunicorn -i 0.0.0.0 -p 8000
> starting gunicorn on 0.0.0.0:8000...
> [2019-07-03 17:01:19 +0700] [71683] [INFO] Starting gunicorn 19.9.0
> [2019-07-03 17:01:19 +0700] [71683] [INFO] Listening at: http://0.0.0.0:8000 
> (71683)
> [2019-07-03 17:01:19 +0700] [71683] [INFO] Using worker: sync
> [2019-07-03 17:01:19 +0700] [71687] [INFO] Booting worker with pid: 71687
>
> any way out ?
>
> thx n 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/web2py/40c55b2d-0a29-420d-9453-bcf701dbb009%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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/CA%2BTH9V%3D7mNO112PLsCeyQc_VtJfRVRnej1gWK_FwcLPpmRTbGQ%40mail.gmail.com.


Re: [web2py] web2py 2.17.1

2018-08-10 Thread Angelo Compagnucci
Hi Massimo,
Il giorno lun 6 ago 2018 alle ore 03:12 Massimo Di Pierro
 ha scritto:
>
> Hello everybody,
>
> I released pyDAL 18.08 and web2py 2.17.1

Could you release pyDAL also on Pypi?! We use it in buildroot and the
recipe for downloading it and building it refers to pypi.

Thanks!

> They mostly contain bug fixes as well as better support for python 3 and 
> bootstrap 4 by default.
> Thanks to all those who contributed!
>
> Please check them out and report any issue with them.
>
> I have a been a little slow checking this group because of lots of traveling 
> but I will do my best to catch up. :-)
>
> 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.



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Buying a template for the community...

2015-10-11 Thread Angelo Compagnucci
I Jason,

2015-10-11 9:24 GMT+02:00 Jason (spot) Brower :
> I have been thinking, the admin interface could use some fixin' up.
> If I bought the extended licence to some theme, say...
> https://wrapbootstrap.com/theme/wrapkit-responsive-admin-template-WB09280SN?l=e
> or any other there...
> we would then have the power to sublincence it as LGPL or similar with
> restriction to the gpl stuff.
> That way we have a nice theme to play with and can start working on some of
> fun features to fill it in.

I used this in the past:

http://startbootstrap.com/template-overviews/sb-admin-2/

License is apache 2, so we should not worry about it. I had a very
nice experience with it.

Sincerely, Angelo

> BR,
> Jason Brower
>
> --
> 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.



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Multiprocessing queue and web2py

2015-07-31 Thread Angelo Compagnucci
Dear Developers,

I really would like to use multiprocessing python queue in web2py but
I'm asking for an advice. I googled the forum but cannot find an
answer.

I have a worker process (a can bus message processing daemon) that
actually it's a web2py application that shares a database table with
the main application.

Unfortunately I'm on an embedded arm (400mhz with slow uSD card) and
accessing the database for sharing messages it's really killing my
app.

Using multiprocessing queues would solve my problems but I have a
several questions popping around:

* I have to maintain a queue handler in main process but web2py
doesn't support writing a singleton shared by all controllers, is a
cache.ram that never expires the only way to keep that handler in
memory for the application lifetime?

* The worker process should be spawned by web2py, but again, I should
keep an handler in cache.ram and check if the process was previously
spawned at each request, right?

* This is not the most elegant solution, do you know of a more elegant one?

Thank you for you advice!

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Re: Setup.py

2015-04-27 Thread Angelo Compagnucci
Hi Massimo,

I will look into this. So in the end is definitively possibile to
install web2py core with python distutils and keep the application
outside.

I'll try with having applications in /var/www and serve that with
apache using web2py.

I'll post my results as soon as possible.

Sincerely, Angelo

2015-04-21 0:59 GMT+02:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 It is possible to have a the gluon folder under site packages and the
 applications folder somewhere else. This used to work. I am not sure how and
 when it broke but it has nothing to do with the web2py default folder
 structure. Perhaps the problem is that the options.py example moved from
 web2py/ to web2py/examples/


 On Monday, 20 April 2015 09:30:05 UTC-5, AngeloC wrote:

 Hi Massimo,

 I'm trying to look at it. I have only a question about permission.
 Applications should run in a writable folder such as the whole web2py.
 I don't think there is an easy way to give writable permissions to
 slices of python sitepackage.

 I don't think also web2py could be disjointed to have the application
 directory in a path totally different from web2py path.

 In the end I dont think could be easily feasible to use python package
 infrastructure to pack web2py.

 What do you think?

 Sincerely, Angelo.

 2015-04-18 4:58 GMT+02:00 Massimo Di Pierro massimo.dipie...@gmail.com:
  It is very well possible that it does not work. Somebody should adopt
  it.
 
 
  On Friday, 17 April 2015 15:05:37 UTC-5, AngeloC wrote:
 
  Hello List,
 
  I'm trying to understand how setup.py works. It seems to me that it
  doesn't work.
 
  There is no web2py binary in system path or somewhere else.
 
  It's a bug or feature?
 
  Thank you!
 
  Sincerely, Angelo
 
  --
  Profile: http://it.linkedin.com/in/compagnucciangelo
 
  --
  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.



 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

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



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Re: Setup.py

2015-04-20 Thread Angelo Compagnucci
Hi Massimo,

I'm trying to look at it. I have only a question about permission.
Applications should run in a writable folder such as the whole web2py.
I don't think there is an easy way to give writable permissions to
slices of python sitepackage.

I don't think also web2py could be disjointed to have the application
directory in a path totally different from web2py path.

In the end I dont think could be easily feasible to use python package
infrastructure to pack web2py.

What do you think?

Sincerely, Angelo.

2015-04-18 4:58 GMT+02:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 It is very well possible that it does not work. Somebody should adopt it.


 On Friday, 17 April 2015 15:05:37 UTC-5, AngeloC wrote:

 Hello List,

 I'm trying to understand how setup.py works. It seems to me that it
 doesn't work.

 There is no web2py binary in system path or somewhere else.

 It's a bug or feature?

 Thank you!

 Sincerely, Angelo

 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

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



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Setup.py

2015-04-17 Thread Angelo Compagnucci
Hello List,

I'm trying to understand how setup.py works. It seems to me that it
doesn't work.

There is no web2py binary in system path or somewhere else.

It's a bug or feature?

Thank you!

Sincerely, Angelo

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Re: Log db operation to file

2015-04-13 Thread Angelo Compagnucci
Hi Massimo!

2015-04-11 6:09 GMT+02:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 All the db operations are on db._timings along with their timings.
 You can do {{=response.toolbar()}} to embed a toolbar to see them all. You
 can log them to a file yourself

 open('file','w').write(repr(db._timings))

Poking at the coe I found the way!

Enable the logging is simply a matter of:

db._debug =True

When you want to disable:

db._debug = False.

It's really useful for me, the only drawback I found is that sometimes
web2py crashes cause this logging is not threadsafe.

But It could suffice for me right now!

Sincerely, Angelo.



 On Thursday, 9 April 2015 10:23:59 UTC-5, AngeloC wrote:

 Hello List,

 I'm debugging an application not written by me running in production.
 I'm looking for a way to log all db operations to file for a certain
 controller.
 I'm not looking for a global logging of all operations, but only on
 controllers of interest.

 Is there such a nice feature in web2py?

 Thank you!

 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

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



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Log db operation to file

2015-04-09 Thread Angelo Compagnucci
Hello List,

I'm debugging an application not written by me running in production.
I'm looking for a way to log all db operations to file for a certain controller.
I'm not looking for a global logging of all operations, but only on
controllers of interest.

Is there such a nice feature in web2py?

Thank you!

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Github tagged releases

2015-04-02 Thread Angelo Compagnucci
Dear Massimo, Developers,

I'm in the process of proposing a package for inclusion in buildroot.
Buildroot unfortunately doesn't embrace the concept of rolling release
so and I'm wondering for a solution.

The basic idea is that if I download the buildroot release 2015.02 in
a year or two, it should download, build and install the same exact
version of software as two year before, so the build could be
reproducible.

Actually, we haven't a policy for older versions of web2py not
considering github tagged releases.

What I'm proposing here is to attach to github releases a working copy
of the web2py sources (with subrepos of course!) so everyone can
download older versions without to much of a hassle.

Unfortunately we cannot rely on github to make that thing for us, so
we should build manually the package and upload it to the release.

Or alternatively, is there another way to have a stable link to web2py
older releases?

Thank you very much!

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Re: web2py 2.10.1 is OUT

2015-04-01 Thread Angelo Compagnucci
Hi Massimo,

The realease is not tagget in git. Could you tag it?

Thank you!

2015-04-01 0:27 GMT+02:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 Also. Thanks to Kathy and Luca for all your GAE tests!


 On Tuesday, 31 March 2015 17:26:18 UTC-5, Massimo Di Pierro wrote:

 - welcome app defaults to Bootstrap 3
 - DAL - pyDAL (thanks Giovanni, Niphlod, Paolo)
   - new modular dal
   - fixed problems with GAE support
   - moved to full NDB support
   - improved connection pooling logic
 - optional cache.ram.max_ram_utilization = 90 (experimental)
 - improved cache.disk logic (thanks Niphlod and Leonel)
 - lots of pep8 improvements, thanks Richard
 - added support for email attchments when auth.settings.server='gae'
 - fixed app.yaml.example for GAE
 - fixed many small issues
 - many many more tests (thanks Giovanni, Niphlod, Paolo)
 - upgrading static libraries (bootstrap, codemirror, jquery, etc)

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



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] for Testers

2015-03-17 Thread Angelo Compagnucci
Hi Massimo,

I just downloaded the src zip and this is the error output:

Traceback (most recent call last):
  File web2py.py, line 18, in module
import gluon.widget
  File /home/angelo/Scaricati/web2py/gluon/__init__.py, line 29, in module
You can also download a complete copy from http://www.web2py.com.;
RuntimeError: web2py depends on pydal, which apparently you have not installed.
Probably you cloned the repository using git without '--recursive'
To fix this, please run (from inside your web2py folder):

 git submodule update --init --recursive

You can also download a complete copy from http://www.web2py.com.


Unfortunately is not a git repository, so it cannot be done!

Ciao!

2015-03-17 15:40 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 Can you please help us test the for testers version of web2py?

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



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Re: Weird Error Message From Web2py - OSError: [Errno 24] Too many open files ???????

2015-03-02 Thread Angelo Compagnucci
Hi Yannick,

Probably it's a regression with hardcron, if you search the list you
can find several thread about that problem.

I had it several times in the past and simply I gave up using hard
cron in web2py. I ususally use the plain and simple unix cron to
schedule activities!

Sincerely, Angelo

2015-03-02 18:39 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 This usually happens when you open but you do not close connections. It can
 happen if you put open connections in cache-ram. Do you open many files?


 On Monday, 2 March 2015 00:24:57 UTC-6, Yusuf Kaka wrote:

 I've got the same error, was there any resolution?

 On Monday, February 22, 2010 at 2:28:17 AM UTC+2, Pascal wrote:

 Thanks for the note... I'm usually running Web2py through Wing IDE
 since it is easy for debugging...
 Please let me know if you have any questions regarding this issue

 Yannick P.

 On Feb 21, 4:02 pm, Massimo Di Pierro mdipie...@cs.depaul.edu wrote:
  This is interesting I will take a look asap.
 
  Meanwhile, if you are not using cron, run web2py with -N.
 
  Massimo
 
  On Feb 21, 2010, at 1:28 PM, Yannick wrote:
 
   Hello mate,
   I'm using the latest version of Web2py and Mac OS and since few
   web2py
   release I have been having this problem and I don't know what is the
   cause of this...
   When it happens I can't access my application anymore I got a this
   message from the browser: Internal error
   Ticket issued: unrecoverable 
   So basicallly I just have to reboot the server to get my appl working
   again...
 
   Here is the exceptions I got from Web2py:
 
   ###
   Exception in thread Thread-106:
   Traceback (most recent call last):
File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/threading.py, line 486, in __bootstrap_inner
  self.run()
File /Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py, line
   229, in run
  shell=self.shell)
File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/subprocess.py, line 587, in __init__
  errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/subprocess.py, line 953, in _get_handles
  errread, errwrite = os.pipe()
   OSError: [Errno 24] Too many open files
   
   Exception in thread Thread-107:
   Traceback (most recent call last):
File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/threading.py, line 486, in __bootstrap_inner
  self.run()
File /Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py, line
   229, in run
  shell=self.shell)
File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/subprocess.py, line 587, in __init__
  errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/subprocess.py, line 933, in _get_handles
  p2cread, p2cwrite = os.pipe()
   OSError: [Errno 24] Too many open files
   #
   Exception in thread Thread-1:
   Traceback (most recent call last):
File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/threading.py, line 486, in __bootstrap_inner
  self.run()
File /Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py, line
   55, in run
  s.run()
File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
   python2.5/sched.py, line 114, in run
File /Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py, line
   47, in launch
  crondance(self.path, 'hard', startup = self.startup)
File /Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py, line
   261, in crondance
  f = open(crontab, 'rt')
   IOError: [Errno 24] Too many open files:
   ##
 
   Please any idea ?

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



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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] Re: Mobile and Tablets detection

2013-07-18 Thread Angelo Compagnucci
Hi Marcio,

I'm planning to grow the supported mobile devices list in web2py, but the
support right now is fairly extensive.
I got the user agent strings here
http://www.useragentstring.com/pages/Mobile%20Browserlist/ and added at
least one of the devices for each family to the unit test of
gluon/contrib/user_agent_parser.py .

That class right now could discriminate between phone and tablets, so I
think you can't find somany differences with http://mobiledetect.net/ .

Sincerly,
Angelo

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: app design page takes a long time to load

2013-03-15 Thread Angelo Compagnucci
Hi Rocco!

I think you can open Web2py in Ecplise and lauch it in debug mode.

When you hit the performance penalty, press the pause button and you can
start to debug the design/welcome function!

Angelo


2013/3/15 Massimo Di Pierro massimo.dipie...@gmail.com

 Strange. Anybody else seeing this?


 On Friday, 15 March 2013 05:15:13 UTC-5, Rocco wrote:

 Dear all,

 after I installed web2py version 2.4.2 stable the time to load the design
 page (pressing modify in the admin page) of a particular app is extremely
 increases.

 Usually it takes more than 60 seconds to load, but, when done, all is
 working well as expected.
 Using the app I don't have any delay and works fast.

 I checked the cpu usage using the linux top command, and the web2py
 python process takes all the cpu resources when loading that app project
 page.

 top - 11:10:03 up 3 days, 20:39,  3 users,  load average: 0.58, 0.50,
 0.56
 Tasks: 235 total,   1 running, 233 sleeping,   0 stopped,   1 zombie
 Cpu(s): 27.7%us,  6.0%sy,  0.0%ni, 66.1%id,  0.2%wa,  0.0%hi,  0.1%si,
 0.0%st
 Mem:   4039588k total,  3765996k used,   273592k free,   192028k buffers
 Swap:  3998716k total,   685312k used,  3313404k free,   831252k cached


   PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND

  3511 rocco 20   0 1266m 321m 2624 S  104  8.2  54:44.70 python

 I tried to restart web2py, but with same results.

 Any way to perform a debug? Any suggestions?

 Thanks in advance for your reply, Rocco

  --

 ---
 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/groups/opt_out.






-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 

--- 
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/groups/opt_out.




Re: [web2py] Not to open a can of worms ... about web2py.com

2013-03-15 Thread Angelo Compagnucci
The new web2py site is extremely beatiful, clean and professional.

Why make it darker and greener?!


2013/3/15 Massimo Di Pierro massimo.dipie...@gmail.com

 Somebody suggested web2py.com should look more like http://nodejs.org/
 It would not be difficult to do. Should it be done?

 Massimo

 --

 ---
 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/groups/opt_out.






-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 

--- 
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/groups/opt_out.




Re: [web2py] Interesting about JSON license...

2013-01-30 Thread Angelo Compagnucci
Please see in Debian the software Douglas Crockford has polluted with that
clause!

http://codesearch.debian.net/search?q=The+Software+shall+be+used+for+Good%2C+not+Evil

Very sad ...


2013/1/30 Bruno Rocha rochacbr...@gmail.com

 “The Software shall be used for Good, not Evil.”

 I like it! we should adopt it in web2py. The problem is to difference what
 is good from what is Evil so I think this license has no meaning.

  --

 ---
 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/groups/opt_out.






-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 

--- 
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/groups/opt_out.




[web2py] Update on multiple tables with one form

2013-01-29 Thread Angelo Compagnucci
Hi guys,

I'm looking for a clean way to make an update on mutiple tables with only
one form and cannot find anything clean/simple searching the mailing list.

Tables could be related (in parent-child relation) or not related at all.

I'm missing something or there is no easy way to do that?

Thanks in advance!

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Update on multiple tables with one form

2013-01-29 Thread Angelo Compagnucci
Hi Annet!

This is freaking awesome and it worked like a charm!

I found a way to add automatically variables to form.vars, hope this helps!

record = db(...).select().first()

for table in [db.table1, db.table2]:
for field in table.fields:
form.vars[field] = record[table][field]


2013/1/29 Annet anneve...@googlemail.com

 I solved a similar problem the following way:


 # retrieve records
 node=db(db.node.id==id).select(db.node.ALL).first()
 address=db(db.address.nodeID==id).select(db.address.ALL).first()
 telecom=db(db.telecom.nodeID==id).select(db.telecom.ALL).first()
 # build form
 form=SQLFORM.factory(db.node,db.address,db.telecom)
 # prepopulate the form
 form.vars.field1=node.field1
 ...
 form.vars.field5=address.field5
 ...
 form.vars.field9=telecom.field9
 # process form
 if form.process().accepted:
 node.update_record(**db.node._filter_fields(form.vars)
 address.update_record(**db.address._filter_fields(form.vars)
 telecom.update_record(**db.telecom._filter_fields(form.vars)


 I hope this helps you solve the problem.

 Kind regards,

 Annet

  --

 ---
 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/groups/opt_out.






-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Update on multiple tables with one form

2013-01-29 Thread Angelo Compagnucci
To Massimo,

I think this should be in the book after this
http://web2py.com/books/default/chapter/29/07#One-form-for-multiple-tables

Thanks!


2013/1/29 Angelo Compagnucci angelo.compagnu...@gmail.com

 Hi Annet!

 This is freaking awesome and it worked like a charm!

 I found a way to add automatically variables to form.vars, hope this helps!

 record = db(...).select().first()

 for table in [db.table1, db.table2]:
 for field in table.fields:
 form.vars[field] = record[table][field]


 2013/1/29 Annet anneve...@googlemail.com

 I solved a similar problem the following way:


 # retrieve records
 node=db(db.node.id==id).select(db.node.ALL).first()
 address=db(db.address.nodeID==id).select(db.address.ALL).first()
 telecom=db(db.telecom.nodeID==id).select(db.telecom.ALL).first()
 # build form
 form=SQLFORM.factory(db.node,db.address,db.telecom)
 # prepopulate the form
 form.vars.field1=node.field1
 ...
 form.vars.field5=address.field5
 ...
 form.vars.field9=telecom.field9
 # process form
 if form.process().accepted:
 node.update_record(**db.node._filter_fields(form.vars)
 address.update_record(**db.address._filter_fields(form.vars)
 telecom.update_record(**db.telecom._filter_fields(form.vars)


 I hope this helps you solve the problem.

 Kind regards,

 Annet

  --

 ---
 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/groups/opt_out.






 --
 Profile: http://it.linkedin.com/in/compagnucciangelo




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 

--- 
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/groups/opt_out.




Re: [web2py] Update on multiple tables with one form

2013-01-29 Thread Angelo Compagnucci
Thanks Antony,

I think the previous solution is the most simple and clean way to make
multiple updates on Web2py and worked wonderfully. Anyway, thank you for
your intrest!


2013/1/29 Anthony abasta...@gmail.com

 On Tuesday, January 29, 2013 4:40:04 AM UTC-5, AngeloC wrote:

 Hi Steve,

 Great suggestion, but the problem remains. How can I update a record that
 I cannot select?

 The SQLFORM.factory way cannot permits to select a record to prepopulate
 the forms, so you only can insert, but not update a record ...


 I think you should be able to construct a dict (or Storage object) to pass
 to SQLFORM.factory as a record. The keys of the dict should be the same as
 the names of the fields you pass in, and the dict should also include a
 dummy id key (its value doesn't matter, as it will be ignored in
 constructing the form if you set showid=False). Something like:

 record = dict(id=1, field1=value1, field2=value2, ...)
 form = SQLFORM.factory(Field('field1'), Field('field2'), ..., record=
 record, showid=False)

 I haven't tried it, but that might work.

 Anthony

 --

 ---
 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/groups/opt_out.






-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: web2py 2.0 DAL no longer usable for mysql stored procedures

2013-01-25 Thread Angelo Compagnucci
Hi Massimo,

I think this is a real problem.

In a web2py shell you can do:

rows = db.executesql(select * from charts)

but you cannot do:

rows = db.executesql(select * from charts; select * from charts;)

it raises the error above.

I think the problem is related to multiple resultsets. That example query
return 2 resultset, as well a stored procedure could return multiple
resultset. I think web2py mess something when a multiquery or a stored
procudere returns more than one resultset.


Mysql user guide says here (
http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html):

If you get Commands out of sync; you can't run this command now in your
client code, you are calling client functions in the wrong order.

This can happen, for example, if you are using
mysql_use_result()http://dev.mysql.com/doc/refman/5.0/en/mysql-use-result.html
and
try to execute a new query before you have called
mysql_free_result()http://dev.mysql.com/doc/refman/5.0/en/mysql-free-result.html.
It can also happen if you try to execute two queries that return data
without calling
mysql_use_result()http://dev.mysql.com/doc/refman/5.0/en/mysql-use-result.html
 or 
mysql_store_result()http://dev.mysql.com/doc/refman/5.0/en/mysql-store-result.html
in
between.



2012/9/28 Yarin ykess...@gmail.com

 Done: http://code.google.com/p/web2py/issues/detail?id=1037


 On Thursday, September 27, 2012 4:33:37 PM UTC-4, Massimo Di Pierro wrote:

 Is this issue still open? If so, can you open a ticket about it?

 Massimo

 On Monday, 24 September 2012 14:38:14 UTC-5, Yarin wrote:



 db.py:
 db.define_table('mytable',Fiel**d('myfield','string'))

 sproc:
 DELIMITER //
 CREATE PROCEDURE TestSproc()
   BEGIN
   SELECT COUNT(*) FROM mytable;
   END //
 DELIMITER;

 tests.py
 NOTE: Tests 1-3 will fail every time in wsgi/linux environments.
 From the web2py command line, they will work once, until another
 operation is called on the db, INCLUDING commit().

 In web2py 1, you can run these once successfully, but subsequent sql
 operations on the current connection return None results.
 

 def test_1():
  ''' RESULT: ProgrammingError: (2014, Commands out of sync; you cant
 run this command now) '''

  sql = '''CALL TestSproc();'''
  results = db.executesql(sql, as_dict=True)
  return str(results)

 def test_2():
  ''' RESULT: ProgrammingError: (2014, Commands out of sync; you cant
 run this command now) '''

  sql = CALL TestSproc();
  results = db.executesql(sql, as_dict=True)
  db.commit()
  return str(results)

 def test_3():
  ''' RESULT: ProgrammingError: (2014, Commands out of sync; you cant
 run this command now) '''

  sql = CALL TestSproc();
  db._adapter.execute(sql)
  results = db._adapter.cursor.fetchall()
  return str(results)

 def test_4():
  ''' RESULT: Works '''

  import contrib.pymysql as pymysql
  sql = CALL TestSproc();
  conn = pymysql.connect(host='127.0.0.**1', port=3306, user='root',passwd
 ='root', db='test')
  cur = conn.cursor(pymysql.cursors.Di**ctCursor)
  cur.execute(sql)
  results = cur.fetchall()
  cur.close()
  conn.close()
  return str(results)





 On Monday, September 24, 2012 1:10:14 PM UTC-4, Massimo Di Pierro wrote:

 can you show us some of your code. This may be a concurrency issues. I
 cannot thing anything we change that would affect the behavior.

 On Sunday, 23 September 2012 22:43:28 UTC-5, Yarin wrote:

 After upgrading to web2py 2.0, we can no longer use the DAL or mysql
 adapters to make MySQL stored procedure calls.

 In web2py 1.x I had 
 reportedhttps://groups.google.com/d/msg/web2py/VaGJjwE3eYQ/GPa3xRe-HVsJhow
  mysql stored procedures weren't working for us in certain
 circumstances- however we were able to circumvent those issues by simply
 creating a new DAL instance everytime we had to call a sproc. With the new
 DAL, that's no longer an option- indeed, any call to a stored procedure
 seems to fail in any attempt through the DAL or mysql adapter.

- Fails with both pymysql and mysqldb drivers
- Fails when calling commit() immediately after
- We did side-by-side comparisons with web2py 1.x on same server,
pointing to same db, and confirmed this fails only in 2.0
- You can make sproc calls using the DAL straight from the web2py
shell, but only if you don't call commit.


 Stack trace:


 Traceback (most recent call last):
   File /opt/web-apps/web2py/gluon/**main.py, line 580, in wsgibase

 BaseAdapter.close_all_**instances('rollback')
   File /opt/web-apps/web2py/gluon/**dal.py, line 511, in 
 close_all_instances

 getattr(instance, action)()
   File /opt/web-apps/web2py/gluon/**dal.py, line 1633, in rollback

 return self.connection.rollback()
 ProgrammingError: (2014, Commands out of sync; you can't run this 
 command now)



 Right now the only option we've arrive at is to make sproc calls
 directly through the pymysql driver API, one per connection.


  --







-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 





Re: [web2py] Re: Insert on multiple tables with SQLFORM.grid

2013-01-19 Thread Angelo Compagnucci
Thanks Anthoni,

Great idea! That works for sure!

Thanks!
Il giorno 17/gen/2013 19:43, Anthony abasta...@gmail.com ha scritto:

 The create action of the grid results in a URL that ends with args
 /new/tablename, so you can do:

 if request.args and request.args[-2] == 'new':
 tablename = request.args[-1]
 [custom create code]

 Anthony

 On Thursday, January 17, 2013 11:32:08 AM UTC-5, AngeloC wrote:

 Hi guys,

 I'm trying to insert something into related tables with SQLFORM.grid.

 I want the user can see only one form with mixed fields for the various
 tables. Tables are related, so I have to insert a record contemporary on
 multiple tables. However I want to stick to SQLFORM.grid for the maximum
 extent.

 As far I can understand, there is no way to make it with the
 stock SQLFORM.grid, so I should opt for SQLFORM.factory.

 Is there an easy way to intercept the create (insertion)
 of SQLFORM.grid and replace it with an SQLFORM.factory?

 Thank you!

 --
 Profile: 
 http://it.linkedin.com/in/**compagnucciangelohttp://it.linkedin.com/in/compagnucciangelo

  --





-- 





Re: [web2py] Re: Project: pydev extension for web2py in Eclipse

2013-01-17 Thread Angelo Compagnucci
Any news on this?


2013/1/13 Álvaro José Iradier airad...@gmail.com

 Hi, I get back to this thread again as I recently got a notification from
 the feature request on Sourceforge.I had it nearly forgotten, but I think
 it is still interesting and it looks like the author of Pydev is thinking
 about including the web2py support.

 You can see my original proposal and the Pydev author comments here on
 Sourceforge:


 http://sourceforge.net/tracker/?func=detailatid=577332aid=3294887group_id=85796

 I do not know if the same approach applies after the changes commented by
 Bruno, but I think it would be worth to try.

 Greets.


 On Monday, June 13, 2011 8:40:47 PM UTC+2, Álvaro José Iradier wrote:

 No, I wasn't aware... sorry, I can't follow the current web2py
 development at that detail. Could you point me to the information or
 make a small brief? It sounds like it could be quite useful.

 Greets.

 On 10 jun, 04:52, Bruno Rocha rochacbr...@gmail.com wrote:
  Are you aware about the changes included in the latest web2py version?
 
  I am talking specially about the new importer, the 'current' object and
 the
  models subfolders.
 
  Is that being considerated?
 
  On Thu, Jun 9, 2011 at 6:11 PM, Álvaro J. Iradier 
  airad...@gmail.comwrote:

 
   Talking to the pydev author in the pydev mailing list, he might
   consider including support for web2py if we manage to get it working
   fine, and we are quite there.
 

  --







-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 





[web2py] Insert on multiple tables with SQLFORM.grid

2013-01-17 Thread Angelo Compagnucci
Hi guys,

I'm trying to insert something into related tables with SQLFORM.grid.

I want the user can see only one form with mixed fields for the various
tables. Tables are related, so I have to insert a record contemporary on
multiple tables. However I want to stick to SQLFORM.grid for the maximum
extent.

As far I can understand, there is no way to make it with the
stock SQLFORM.grid, so I should opt for SQLFORM.factory.

Is there an easy way to intercept the create (insertion) of SQLFORM.grid
and replace it with an SQLFORM.factory?

Thank you!

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 





Re: [web2py] Bootstrap new and bootswatch_ie.css

2012-08-24 Thread Angelo Compagnucci
Hi Massimo,

I think I removed the file from the patches I sent you, but probably I
missed something. That file is absolutely useless right now and all it's
reference could be removed.

Angelo


2012/8/24 Massimo Di Pierro massimo.dipie...@gmail.com

 I have upgraded to Bootstrap 2.1.0 thanks to a patch by Alec Taylor.

 I have renamed css/bootswatch*.css as css/web2py_bootstrap*.css to avoid
 confusion.

 In the process I have discovered layout.html refereces a bootswatch_ie.css
 (now web2py_bootstrap_ie.css) and I do not have it.
 It is required for older version of IE.

 I think it comes from Angelo. Anybody has it? Can you send it to me? Can
 you check it still works with IE7 and IE8?

 --







-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 





[web2py] How to extend IMG to preprocess url

2012-08-21 Thread Angelo Compagnucci
Hi guys,

Any advice on howto extend IMG to preprocess url? I simply want to mangle
url before it passed to IMG and this should be done every time an IMG tag
is used.

Thanks!

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 





Re: [web2py] Re: How to extend IMG to preprocess url

2012-08-21 Thread Angelo Compagnucci
Wow!

I'll try ASAP, thank you!

2012/8/21 Anthony abasta...@gmail.com

 Maybe something like:

 class MYIMG(IMG):
 def __init__(self, *components, **attributes):
 if '_src' in attributes:
 attributes['_src'] = mangle(attributes['_src'])
 return super(MYIMG, self).__init__(*components, **attributes)

 Then you can do:

 MYIMG(_src=URL('static', 'someimage.jpg'))

 and the _src URL will be altered automatically.

 Anthony

 On Tuesday, August 21, 2012 11:36:18 AM UTC-4, AngeloC wrote:

 Hi guys,

 Any advice on howto extend IMG to preprocess url? I simply want to mangle
 url before it passed to IMG and this should be done every time an IMG tag
 is used.

 Thanks!

 --
 Profile: 
 http://it.linkedin.com/in/**compagnucciangelohttp://it.linkedin.com/in/compagnucciangelo

  --







-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 





Re: [web2py] Re: web2py 2.0 almost done

2012-08-11 Thread Angelo Compagnucci
Hi Massimo,

Mobile browser on mobile phones can work in mobile mode or in desktop
mode. If you are in desktop mode, without that line, you cannot see the
menu because it's faded away. And you cannot click, so the menu is faded
and not clickable!

In a desktop instead, when a windowed browser has a resolution less than
responsive threshold, the menu is yes visible, but it's resize the page at
each mouse hovering and makes the menu unusable.

So, if you are in a browser with a sufficient resolution, you can see the
standard dropdown, when you are on a mobile browser with a narrow
resolution but in desktop mode, you can see a flat menu. This restores the
default bootstrap behaviour for colllapsible dropdowns.

Hope this helps!

2012/8/10 Massimo Di Pierro massimo.dipie...@gmail.com

 Can you explain the consequences of this line in your patch?

 if (jQuery(document).width() = 980)


 On Friday, 10 August 2012 10:11:39 UTC-5, AngeloC wrote:

 Hi Massimo,

 I fixed compatibility with IE and reverted to a non mobile first
 approach. I reverted because bootstrap is not mobile first (so we add too
 little) and
  for the sake of compatibility with IE.

 Patch is attached to issue http://code.google.com/**
 p/web2py/issues/detail?id=896http://code.google.com/p/web2py/issues/detail?id=896which
  I cannot reopen.

 Hope this helps!

 Angelo

 2012/8/10 Angelo Compagnucci angelo.co...@gmail.com

 Hi Massimo,

 I'm writing it right now to fix ie issues! Please be patient until fixed!


 2012/8/9 Massimo Di Pierro massimo@gmail.com

 This may be ok but where do I get bootswatch_ie.css from?


 On Thursday, 9 August 2012 11:43:28 UTC-5, AngeloC wrote:

 Hi Massimo,

 I think I cannot complete the bootstrap/web2py css merging in time for
 2.0, it's really a lot of work and I'm a bit busy these days.

 Btw, i'm fixing the bug I introduced with issue 896 and I want to
 share a thought with you.

 Actually, there is no way to maintain a mobile first approach and make
 it working on IE other than add something like this to the scaffolding:

 !-- Makes bootswatch working on IE 7/8 --
 !--[if (lt IE 9)]
 link rel=stylesheet href=/responsivekit/static/**cs**
 s/bootswatch_ie.css
 ![endif]--

 This will make speedier the whole css on not IE browsers because we
 remove IE specific rules (smaller css), but has the downside to require an
 extra http get on IE.

 What do you think?


 2012/8/9 Alec Taylor alec.t...@gmail.com

 It would be good to have OAuth working for web2py 2

 Facebook and LinkedIn still have some issues

 LinkedIn: https://groups.google.com/**foru**m/#!topic/web2py/**
 SbnQEnXEcOghttps://groups.google.com/forum/#!topic/web2py/SbnQEnXEcOg

 Facebook: (will add bug report once I've gotten LinkedIn login to
 work)

 On Thu, Aug 9, 2012 at 11:25 PM, Massimo Di Pierro
 massimo@gmail.com wrote:
  Can you help us fix the CSS?
 
 
  On Thursday, 9 August 2012 00:29:58 UTC-5, Andrew wrote:
 
  Just a note on IE7 navbar behaviour:
 
  The Menu has taken a turn for the worse:
  Initially the Welcome App Sub Menus dissapeared in :  welcome css
 pathc,
  issue 896, thanks Angelo
  They then returned in fixed issue qith clicking on toplevel
 menus except
  all of the submenus are displayed when the menu first appears and
 they are
  all on top of each other.
 
  The login options are still blue, and the space between the navbar
 and
  Welcome isn't there.
  See screen shot.
 
 
  On Thursday, August 9, 2012 9:17:17 AM UTC+12, Massimo Di Pierro
 wrote:
 
  more issues have been addressed. In order to fix an issue I had to
  introduce a slight change of behavior and I am not sure what is
 the best way
  to handle it.
 
  If you login using a third party service (for example janrain
 using
  facebook) and the service sends info about you, if web2py has
 corresponding
  fields in auth_user, it stores them. If you edit your profile,
 logout,
  change your facebook profile, login again using janrain, should
 web2py keep
  the current local profile or update it? The bug report suggested
 that web2oy
  should always give preference to the local profile.
 
  I changed web2py accordingly. In practice this change will
 probably not
  affect anybody because none of the services sends any information
 stored by
  auth_user.
 
  Yet, please check it.
 
  Massimo
 
 
 
  On Monday, 6 August 2012 23:33:48 UTC-5, Massimo Di Pierro wrote:
 
  Web2py 2.0 is almost done.
  Please try the nightly build.
  Let us know if it breaks anything.
 
  massimo
 
  --
 
 
 

 --






 --
 Profile: 
 http://it.linkedin.com/in/**comp**agnucciangelohttp://it.linkedin.com/in/compagnucciangelo

  --







 --
 Profile: 
 http://it.linkedin.com/in/**compagnucciangelohttp://it.linkedin.com/in/compagnucciangelo




 --
 Profile: 
 http://it.linkedin.com/in/**compagnucciangelohttp://it.linkedin.com/in/compagnucciangelo

  --







-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 





Re: [web2py] Re: web2py 2.0 almost done

2012-08-10 Thread Angelo Compagnucci
Hi Massimo,

I fixed compatibility with IE and reverted to a non mobile first approach.
I reverted because bootstrap is not mobile first (so we add too little) and
 for the sake of compatibility with IE.

Patch is attached to issue
http://code.google.com/p/web2py/issues/detail?id=896 which I cannot reopen.

Hope this helps!

Angelo

2012/8/10 Angelo Compagnucci angelo.compagnu...@gmail.com

 Hi Massimo,

 I'm writing it right now to fix ie issues! Please be patient until fixed!


 2012/8/9 Massimo Di Pierro massimo.dipie...@gmail.com

 This may be ok but where do I get bootswatch_ie.css from?


 On Thursday, 9 August 2012 11:43:28 UTC-5, AngeloC wrote:

 Hi Massimo,

 I think I cannot complete the bootstrap/web2py css merging in time for
 2.0, it's really a lot of work and I'm a bit busy these days.

 Btw, i'm fixing the bug I introduced with issue 896 and I want to share
 a thought with you.

 Actually, there is no way to maintain a mobile first approach and make
 it working on IE other than add something like this to the scaffolding:

 !-- Makes bootswatch working on IE 7/8 --
 !--[if (lt IE 9)]
 link rel=stylesheet href=/responsivekit/static/**
 css/bootswatch_ie.css
 ![endif]--

 This will make speedier the whole css on not IE browsers because we
 remove IE specific rules (smaller css), but has the downside to require an
 extra http get on IE.

 What do you think?


 2012/8/9 Alec Taylor alec.t...@gmail.com

 It would be good to have OAuth working for web2py 2

 Facebook and LinkedIn still have some issues

 LinkedIn: https://groups.google.com/**forum/#!topic/web2py/**
 SbnQEnXEcOghttps://groups.google.com/forum/#!topic/web2py/SbnQEnXEcOg

 Facebook: (will add bug report once I've gotten LinkedIn login to work)

 On Thu, Aug 9, 2012 at 11:25 PM, Massimo Di Pierro
 massimo@gmail.com wrote:
  Can you help us fix the CSS?
 
 
  On Thursday, 9 August 2012 00:29:58 UTC-5, Andrew wrote:
 
  Just a note on IE7 navbar behaviour:
 
  The Menu has taken a turn for the worse:
  Initially the Welcome App Sub Menus dissapeared in :  welcome css
 pathc,
  issue 896, thanks Angelo
  They then returned in fixed issue qith clicking on toplevel menus
 except
  all of the submenus are displayed when the menu first appears and
 they are
  all on top of each other.
 
  The login options are still blue, and the space between the navbar
 and
  Welcome isn't there.
  See screen shot.
 
 
  On Thursday, August 9, 2012 9:17:17 AM UTC+12, Massimo Di Pierro
 wrote:
 
  more issues have been addressed. In order to fix an issue I had to
  introduce a slight change of behavior and I am not sure what is the
 best way
  to handle it.
 
  If you login using a third party service (for example janrain using
  facebook) and the service sends info about you, if web2py has
 corresponding
  fields in auth_user, it stores them. If you edit your profile,
 logout,
  change your facebook profile, login again using janrain, should
 web2py keep
  the current local profile or update it? The bug report suggested
 that web2oy
  should always give preference to the local profile.
 
  I changed web2py accordingly. In practice this change will probably
 not
  affect anybody because none of the services sends any information
 stored by
  auth_user.
 
  Yet, please check it.
 
  Massimo
 
 
 
  On Monday, 6 August 2012 23:33:48 UTC-5, Massimo Di Pierro wrote:
 
  Web2py 2.0 is almost done.
  Please try the nightly build.
  Let us know if it breaks anything.
 
  massimo
 
  --
 
 
 

 --






 --
 Profile: 
 http://it.linkedin.com/in/**compagnucciangelohttp://it.linkedin.com/in/compagnucciangelo

  --







 --
 Profile: http://it.linkedin.com/in/compagnucciangelo




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 





Re: [web2py] Re: web2py 2.0 almost done

2012-08-09 Thread Angelo Compagnucci
Hi Massimo,

I think I cannot complete the bootstrap/web2py css merging in time for 2.0,
it's really a lot of work and I'm a bit busy these days.

Btw, i'm fixing the bug I introduced with issue 896 and I want to share a
thought with you.

Actually, there is no way to maintain a mobile first approach and make it
working on IE other than add something like this to the scaffolding:

!-- Makes bootswatch working on IE 7/8 --
!--[if (lt IE 9)]
link rel=stylesheet href=/responsivekit/static/css/bootswatch_ie.css
![endif]--

This will make speedier the whole css on not IE browsers because we remove
IE specific rules (smaller css), but has the downside to require an extra
http get on IE.

What do you think?


2012/8/9 Alec Taylor alec.tayl...@gmail.com

 It would be good to have OAuth working for web2py 2

 Facebook and LinkedIn still have some issues

 LinkedIn: https://groups.google.com/forum/#!topic/web2py/SbnQEnXEcOg

 Facebook: (will add bug report once I've gotten LinkedIn login to work)

 On Thu, Aug 9, 2012 at 11:25 PM, Massimo Di Pierro
 massimo.dipie...@gmail.com wrote:
  Can you help us fix the CSS?
 
 
  On Thursday, 9 August 2012 00:29:58 UTC-5, Andrew wrote:
 
  Just a note on IE7 navbar behaviour:
 
  The Menu has taken a turn for the worse:
  Initially the Welcome App Sub Menus dissapeared in :  welcome css
 pathc,
  issue 896, thanks Angelo
  They then returned in fixed issue qith clicking on toplevel menus
 except
  all of the submenus are displayed when the menu first appears and they
 are
  all on top of each other.
 
  The login options are still blue, and the space between the navbar and
  Welcome isn't there.
  See screen shot.
 
 
  On Thursday, August 9, 2012 9:17:17 AM UTC+12, Massimo Di Pierro wrote:
 
  more issues have been addressed. In order to fix an issue I had to
  introduce a slight change of behavior and I am not sure what is the
 best way
  to handle it.
 
  If you login using a third party service (for example janrain using
  facebook) and the service sends info about you, if web2py has
 corresponding
  fields in auth_user, it stores them. If you edit your profile, logout,
  change your facebook profile, login again using janrain, should web2py
 keep
  the current local profile or update it? The bug report suggested that
 web2oy
  should always give preference to the local profile.
 
  I changed web2py accordingly. In practice this change will probably not
  affect anybody because none of the services sends any information
 stored by
  auth_user.
 
  Yet, please check it.
 
  Massimo
 
 
 
  On Monday, 6 August 2012 23:33:48 UTC-5, Massimo Di Pierro wrote:
 
  Web2py 2.0 is almost done.
  Please try the nightly build.
  Let us know if it breaks anything.
 
  massimo
 
  --
 
 
 

 --






-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 





Re: [web2py] Re: web2py 2.0 almost done

2012-08-09 Thread Angelo Compagnucci
Hi Massimo,

I'm writing it right now to fix ie issues! Please be patient until fixed!

2012/8/9 Massimo Di Pierro massimo.dipie...@gmail.com

 This may be ok but where do I get bootswatch_ie.css from?


 On Thursday, 9 August 2012 11:43:28 UTC-5, AngeloC wrote:

 Hi Massimo,

 I think I cannot complete the bootstrap/web2py css merging in time for
 2.0, it's really a lot of work and I'm a bit busy these days.

 Btw, i'm fixing the bug I introduced with issue 896 and I want to share a
 thought with you.

 Actually, there is no way to maintain a mobile first approach and make it
 working on IE other than add something like this to the scaffolding:

 !-- Makes bootswatch working on IE 7/8 --
 !--[if (lt IE 9)]
 link rel=stylesheet href=/responsivekit/static/**
 css/bootswatch_ie.css
 ![endif]--

 This will make speedier the whole css on not IE browsers because we
 remove IE specific rules (smaller css), but has the downside to require an
 extra http get on IE.

 What do you think?


 2012/8/9 Alec Taylor alec.t...@gmail.com

 It would be good to have OAuth working for web2py 2

 Facebook and LinkedIn still have some issues

 LinkedIn: 
 https://groups.google.com/**forum/#!topic/web2py/**SbnQEnXEcOghttps://groups.google.com/forum/#!topic/web2py/SbnQEnXEcOg

 Facebook: (will add bug report once I've gotten LinkedIn login to work)

 On Thu, Aug 9, 2012 at 11:25 PM, Massimo Di Pierro
 massimo@gmail.com wrote:
  Can you help us fix the CSS?
 
 
  On Thursday, 9 August 2012 00:29:58 UTC-5, Andrew wrote:
 
  Just a note on IE7 navbar behaviour:
 
  The Menu has taken a turn for the worse:
  Initially the Welcome App Sub Menus dissapeared in :  welcome css
 pathc,
  issue 896, thanks Angelo
  They then returned in fixed issue qith clicking on toplevel menus
 except
  all of the submenus are displayed when the menu first appears and
 they are
  all on top of each other.
 
  The login options are still blue, and the space between the navbar and
  Welcome isn't there.
  See screen shot.
 
 
  On Thursday, August 9, 2012 9:17:17 AM UTC+12, Massimo Di Pierro
 wrote:
 
  more issues have been addressed. In order to fix an issue I had to
  introduce a slight change of behavior and I am not sure what is the
 best way
  to handle it.
 
  If you login using a third party service (for example janrain using
  facebook) and the service sends info about you, if web2py has
 corresponding
  fields in auth_user, it stores them. If you edit your profile,
 logout,
  change your facebook profile, login again using janrain, should
 web2py keep
  the current local profile or update it? The bug report suggested
 that web2oy
  should always give preference to the local profile.
 
  I changed web2py accordingly. In practice this change will probably
 not
  affect anybody because none of the services sends any information
 stored by
  auth_user.
 
  Yet, please check it.
 
  Massimo
 
 
 
  On Monday, 6 August 2012 23:33:48 UTC-5, Massimo Di Pierro wrote:
 
  Web2py 2.0 is almost done.
  Please try the nightly build.
  Let us know if it breaks anything.
 
  massimo
 
  --
 
 
 

 --






 --
 Profile: 
 http://it.linkedin.com/in/**compagnucciangelohttp://it.linkedin.com/in/compagnucciangelo

  --







-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 





Re: [web2py] Re: Cookbook - No indentation ??

2012-03-17 Thread Angelo Compagnucci
Kindle and other ebook readers that doesn't support pdf are useless for
viewing technical documents because text is reflowable, always. So blanks
are removed and text is full aligned.

Please don't screw with packtpub, amazon or others, is a common problem
with all reflowable mobile formats.

I have an ebook reader that supports all mobile formats (BeBook One) and
pdf (non digital editions) is the only readable format for tech documents.
I read always on my bebook one!

Publishers never says that, because they will not sell technical ebooks
anymore!

2012/3/17 Bruce Wade bruce.w...@gmail.com

 The PDF is not perfect, but is OK. Somethings are indented that shouldn't
 be so you really have to understand the code to be able to figure it out.
 The best option is to download the source code to learn from.


 On Sat, Mar 17, 2012 at 7:24 AM, Marcello parro...@gmail.com wrote:

 Hello,

 I contacted Packt about this problem.
 They admitted a problem with Kindle format (MOBI).

 They were very nice and gave me access to ePub and PDF format.

 But I noticed that ePub has the same formatting problem as MOBI.

 The only format that is OK is PDF
 So.. if you want this book, know that the only one that is OK is PDF


 Thanks,

 Marcello



 On Thursday, March 15, 2012 8:11:34 PM UTC-3, Monte Milanuk wrote:

 On Thu, 15 Mar 2012 12:32:14 -0700, Marcello wrote:

  I bought mine from Amazon... don't know if I have access to that
 
  But my interest in the moment is not run code. I want to read the
  book
 
  And read the code without indentation is almost impossible...
 
  If my book is correct, it is almost useless.




 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Re: Responsivekit for web2py!

2012-01-15 Thread Angelo Compagnucci
Hi Alan!

If you want to test it with a pc simply resize the browser window, when the
windows is of a certain size, it triggers the responsive reflow of tables.
Images works same way, but you have to refresh the page to get the resized
image, I'll add this instructions to page!

Angelo

2012/1/15 Alan Etkin spame...@gmail.com

 Would it be possible to test it with a desktop pc? I visited the demo
 and found difficult to appreciate the features. Is image and table
 resizing being performed by the plugin?

 On 13 ene, 10:51, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
  Hello list,
 
  I want to share with you my new plugin (aiming to web2py inclusion!),
  responsivekit, you can find it on githubhttps://
 github.com/angeloc/web2py-responsivekit.
 
  Responsivekit implements responsive tables and responsive images using
 the
  best known techniques at the moment (I'm basing on Marcotte,
  SmashingMagazine and filamentgroups reccomendations). More will come!
 
  Comments are welcome.
 
  Cheers,
 
  Angelo
 
  --
  Profile:http://it.linkedin.com/in/compagnucciangelo




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Re: Responsivekit for web2py!

2012-01-15 Thread Angelo Compagnucci
Hi Alan,

If you use the plugin_responsivekit, simply remove conditional import (or
comment it) in plugin_responsivekit/layout.html :

!--[if !IE]!--
  script language=JavaScript
  var width_filter = '{{=current.plugins.responsivekit.screensize_filter}}'
  var controller   = '{{=URL(a=request.application,
c=current.plugins.responsivekit.screensize_controller ,
f=current.plugins.responsivekit.screensize_function)}}'
  /script
  link rel=stylesheet type=text/css
href={{=URL('static','plugin_responsivekit/responsivekit.css')}} /
  script
src={{=URL('static','plugin_responsivekit/responsivekit.js')}}/script
  !--![endif]--

Removing these lines, you disable loading of responsivekit components. I'll
try to add a globlal variable to enable/disable this!

I've updated the demo, showing more examples!

Thank you for your feedback!

2012/1/16 Alan Etkin spame...@gmail.com

 Thank you. I continued using the demo and could see the resizing
 effect. Really impressing. It would be interesting to have a way to
 activate/deactivate this feature transparently by default in the
 scaffolding application with a simple function call or a Settings
 attribute.

 On 15 ene, 14:32, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
  Hi Alan!
 
  If you want to test it with a pc simply resize the browser window, when
 the
  windows is of a certain size, it triggers the responsive reflow of
 tables.
  Images works same way, but you have to refresh the page to get the
 resized
  image, I'll add this instructions to page!
 
  Angelo
 
  2012/1/15 Alan Etkin spame...@gmail.com
 
 
 
   Would it be possible to test it with a desktop pc? I visited the demo
   and found difficult to appreciate the features. Is image and table
   resizing being performed by the plugin?
 
   On 13 ene, 10:51, Angelo Compagnucci angelo.compagnu...@gmail.com
   wrote:
Hello list,
 
I want to share with you my new plugin (aiming to web2py inclusion!),
responsivekit, you can find it on githubhttps://
   github.com/angeloc/web2py-responsivekit.
 
Responsivekit implements responsive tables and responsive images
 using
   the
best known techniques at the moment (I'm basing on Marcotte,
SmashingMagazine and filamentgroups reccomendations). More will come!
 
Comments are welcome.
 
Cheers,
 
Angelo
 
--
Profile:http://it.linkedin.com/in/compagnucciangelo
 
  --
  Profile:http://it.linkedin.com/in/compagnucciangelo




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


[web2py] Responsivekit for web2py!

2012-01-13 Thread Angelo Compagnucci
Hello list,

I want to share with you my new plugin (aiming to web2py inclusion!),
responsivekit, you can find it on github
https://github.com/angeloc/web2py-responsivekit.

Responsivekit implements responsive tables and responsive images using the
best known techniques at the moment (I'm basing on Marcotte,
SmashingMagazine and filamentgroups reccomendations). More will come!

Comments are welcome.

Cheers,

Angelo

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


[web2py] Re: Responsivekit for web2py!

2012-01-13 Thread Angelo Compagnucci
Hi list!

I'm reading Marcotte's book (Responsive Web Design) and I think we should
modify slightly our web2py.css. Tag img should be
img { border: 0; max-width: 100%;} so it can use the width of parent
instead to overflow if bigger than that and it automatically reflow when
size changes.

This is a patch:

web2py.css

25c25
 img { border: 0; }
---
 img { border: 0; max-width: 100%; }

2012/1/13 Angelo Compagnucci angelo.compagnu...@gmail.com

 Hello list,

 I want to share with you my new plugin (aiming to web2py inclusion!),
 responsivekit, you can find it on github
 https://github.com/angeloc/web2py-responsivekit.

 Responsivekit implements responsive tables and responsive images using the
 best known techniques at the moment (I'm basing on Marcotte,
 SmashingMagazine and filamentgroups reccomendations). More will come!

 Comments are welcome.

 Cheers,

 Angelo

 --
 Profile: http://it.linkedin.com/in/compagnucciangelo




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Qdb: a really simple client/server remote python debugger

2012-01-13 Thread Angelo Compagnucci
I'll try as soon as possible, nice work!

Thanks!

2012/1/13 Mariano Reingart reing...@gmail.com

 FYI

 I'm working on a enhancement to Pdb, wich could be used from a remote
 terminal to any server (and in the near future, with a nice visual
 IDE):

 http://code.google.com/p/rad2py/wiki/QdbRemotePythonDebugger

 Quick steps:

 1. Download qdb.py (put in web2py modules and in your local folder)

 2. Add the following line as a breakpoint:
 import qdb; qdb.set_trace()

 3. In a terminal, run
 python qdb.py

 Open your webpage, when the qdb.set_trace() line is reached, you'll
 see the debugger prompt in your terminal.

 To connect to a remote server, just change addres and password in the
 source file.

 Comments and contributions are welcome ;-)

 Best regards

 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] PyCharm for web2py development -- interest in a third-party plugin?

2012-01-13 Thread Angelo Compagnucci
There is really such an intrest?

I'm using eclipse+pydev everyday and overcomed the trickery to get code
completion working, it's really good ide. I think there is major need to
provide support for pydev than a closed source ide.

They are a company that sells a software, and if they don't want our money,
I think it's their problem. I'm really disappointed that a few users don't
get their wishes fullfilled, but it's a closed source software, and in a
closed source world you can contribute only to a certain degree.

Angelo

2012/1/13 monotasker scotti...@gmail.com

 I had an email exchange over the last couple of days with a developer at
 Jetbrains who works on PyCharm. The bad news is they've chosen not to work
 on web2py integration any time soon. The even worse news (from my
 perspective) is that they seem to have a very negative impression of the
 web2py community, and this was given as one factor in the decision not to
 make web2py a priority. Now, I think the last thing we need is a flame war
 against PyCharm. It sounds like they've had some legitimately bad
 interactions with a few of the people wanting web2py support (I have no
 idea who). So I think this is a moment to be on our best behaviour.

 The good news, though, is that the developer encouraged the development of
 a third-party plugin for web2py support. This isn't something I can take on
 alone right now, but is there any interest from others in forming a team to
 work on one?




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Re: html5 charting library

2012-01-12 Thread Angelo Compagnucci
I made something with:

http://www.jqplot.com/
Great library, You can feed datas in json, so it's very easy to interface
with a json service in web2py. Unfortunately it has a convoluted
documentation, you'll get some time to be acquainted to.


http://raphaeljs.com/
Exterminated graphic library, not too difficult to use, but more than
jqplot. I you want to chart something, it will be a matter of building a
table (you can use an SQLTABLE) and importing the library,
raphaeljs.comwill translate
tr and td to x and y axes.
You can make everithing with this library, so give it a try!

Cheers,

Angelo



2012/1/12 Massimo Di Pierro massimo.dipie...@gmail.com

 can you provide a shortlist? I'd be happy to give them a try.

 On Jan 12, 7:40 am, Kenneth kenneth.t.lundst...@gmail.com wrote:
  Hello,
 
  has anybody done any comparing of different html5 charting libraries?
 
  Something quite easy to use, good documentation.
 
  Kenneth




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


[web2py] Intercept file download

2012-01-11 Thread Angelo Compagnucci
Hi guys,

For a web application, I have to implement a sort of responsive design for
images. There are tons of solution online, but they requires to use some
sort of javascript and custom html to work (insert special tags or classes
in code). I don't like the approch because it make the code unmaintenable.

The idea I have in mind is something like this:

1) On page load, a jquery function calls a controller and communicates
infos about the device.
2) Controller stores those infos in session
3) I intercept images download and
3a) If there are session infos about device width and is_mobile, I resize
the image with PIL to the exact width server side and give the new url to
the response.
3b) If there aren't infos (browser doesn't support cookies) and is_mobile,
I resize the image to an arbitrary small size (ex: 480 px) and give the new
url to the response.
3c) If !is_mobile, I return the normal url

How can I intercept file download also the static ones?

Thank you!

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Intercept file download

2012-01-11 Thread Angelo Compagnucci
Thanks Bruno,

These not solve my problem! To use thumbor, I have to prepare links using a
special syntax, that is what I want to avoid. If I wanted to change links I
would have done using responsive design tecniques and my own webserver!

@Antony:
I know sencha and it adopts an approch like the one I proposed, they have a
proxy that intercepts requests to images and resize them basing on the
knowledge of the device they have by the useragent. The only caveat is that
you have to change all of your urls!

I think that we have a framework, we have user_agent_parser and we can
include responsive images in web2py!
If we can intercept GET to images, we can build something totally
integrated with web2py! And this is what I'm doing!
I'm thinking of a responsive design module for web2py that can be
configured (local processor power with PIL, online service like thumbor)
and when plugged in, it makes automatically responsive all of your images.

So, my question is, there is a way to intercept GET to static image files?

2012/1/11 Bruno Rocha rochacbr...@gmail.com



 On Wed, Jan 11, 2012 at 2:23 PM, Bruno Rocha rochacbr...@gmail.comwrote:

 https://github.com/globocom/thumbor


 and

 https://github.com/globocom/mugshot




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Intercept file download

2012-01-11 Thread Angelo Compagnucci
Thanks Anthony,

Ok, this way I have to play anyway with urls. I'll try another approach.
There is a way to rewrite the page after rendering, just before the page
will be sent to the browser?
This way we can analyze img urls, resize images accordingly, and rewrite
the new ones.

What do you tink?


 Assuming web2py is serving static files to begin with, I believe it does
 so very early in the process, before the session is read, etc. If you can
 add a flag to the URL (e.g., in the query string) only in cases where you
 need to offer the alternative (non-static) image, maybe you could handle
 that via the pattern-based rewrite system in routes.py (though that would
 prevent using the parameter-based system for other purposes).

 Anthony




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Intercept file download

2012-01-11 Thread Angelo Compagnucci
Yes, you are right, the approach is messy.

So the best way could be something like a module. The image URL is passed
as an argument, the module crunch the image and returns the correct URL.

So in code you have to write something like:

IMG(_src=responsive(URL('static','image.img')),_alt='test')


This way the programmer is aware of responsiveness and he could use the
feature where he wants!

The responsive module could be configure to use local cpu or a remote
service.

What do you think?

2012/1/11 Anthony abasta...@gmail.com

 On Wednesday, January 11, 2012 12:16:50 PM UTC-5, AngeloC wrote:

 Thanks Anthony,

 Ok, this way I have to play anyway with urls. I'll try another approach.
 There is a way to rewrite the page after rendering, just before the page
 will be sent to the browser?


 html = response.render()
 return replace_image_urls(html)

 or maybe WSGI middleware. But that approach seems messy (you have to parse
 all the html). And what about images linked from static files (e.g., CSS
 background images)?

 Anthony




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Python for Android (any takers to run web2py)

2012-01-10 Thread Angelo Compagnucci
I made some test and successfully packaged web2py!

There is only a caveat, that unfortunately makes useless python-for-android
right now:

If you want to use it without kivy module (an opengl es 2.0 ui toolkit),
then you might want a lighter java bootstrap, that we don't have right now.
Help is welcome :)

So it's not possible to package an application without an opengl es 2 gui
...

If I find more free time (very unlikely) I can try to build a custom
bootstrap to startup the web2py webserver gui (or something similar).

Angelo

2012/1/10 Nik Go nikolai...@gmail.com

 Offhand, I could think of a custom app for that itch you want to scratch ..


 On Tuesday, January 10, 2012, Plumo wrote:

 what is the use case for running a web framework on your Android phone?




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


[web2py] Responsive tables for web2py

2012-01-10 Thread Angelo Compagnucci
Hi guys,

I made a plugin to render as responsive all web2py tables. It uses a
combination of css media queries and javascript to accomplish the goal. You
can find it on my github:

https://github.com/angeloc/web2py-responsive-tables

It's far from perfect, I'm open to suggestions!

Sincerly,

Angelo

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Python for Android (any takers to run web2py)

2012-01-09 Thread Angelo Compagnucci
I'll try as soon as possible!

I've previously used sl4a + python and web2py works flawlessy, but it a bit
difficult to setup, it cannot be done by a newbie like installing an apk!

2012/1/9 Marco Mansilla thebigsho...@gmail.com

 El Mon, 9 Jan 2012 00:08:09 -0200
 Bruno Rocha rochacbr...@gmail.com escribió:

  Look this project
 
  https://github.com/kivy/python-for-android
 
  May be someone has time to spend trying to run web2py with this.
 
 

 here's a little more info, looks nice

 http://txzone.net/2012/01/introducing-python-for-android/




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Re: Python for Android (any takers to run web2py)

2012-01-09 Thread Angelo Compagnucci
From my understanding, it could be possible to make an apk complete with
python, libraries and web2py.

I'm setting up a dev env!

2012/1/9 Massimo Di Pierro massimo.dipie...@gmail.com

 would python-for-android make it possible to create and apk?

 On Jan 9, 2:23 am, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
  I'll try as soon as possible!
 
  I've previously used sl4a + python and web2py works flawlessy, but it a
 bit
  difficult to setup, it cannot be done by a newbie like installing an apk!
 
  2012/1/9 Marco Mansilla thebigsho...@gmail.com
 
   El Mon, 9 Jan 2012 00:08:09 -0200
   Bruno Rocha rochacbr...@gmail.com escribió:
 
Look this project
 
   https://github.com/kivy/python-for-android
 
May be someone has time to spend trying to run web2py with this.
 
   here's a little more info, looks nice
 
  http://txzone.net/2012/01/introducing-python-for-android/
 
  --
  Profile:http://it.linkedin.com/in/compagnucciangelo




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Packaging web2py + application

2012-01-05 Thread Angelo Compagnucci
I can suggest you http://code.google.com/p/pts-mini-gpl/wiki/StaticPython

It's a statically compiled version (and runtime) of python, you can drop it
in web2py folder and write a script that starts

./python web2py.py 

In this way you have not to fight with rpm packing (I made several packeges
for opensuse ...), you can yust zip your application. This bynary works
well on all linux x86 x86-68 archs and it's not influenced by the
distribution you are running.

Angelo

2012/1/5 Ross Peoples ross.peop...@gmail.com

 Hello everyone,

 I want to make an RPM package for my application that primarily targets
 CentOS. I am working with version 5, which only has Python 2.4. I would
 like to create an RPM that packages Python 2.7, web2py, and my application.
 Does anyone have any experience with doing anything like this? I'm a
 developer, not a packager, so this is all new to me.

 Any help would be greatly appreciated. Thanks,

 Ross




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Re: ssl certificate?

2011-12-23 Thread Angelo Compagnucci
I used it in production, it not differs from any other certification.
Startssl CA is included in all modern browsers and operating system, so the
certs they issues are valid ones.

2011/12/23 LightDot light...@gmail.com

 What do you mean by it's not insured? Do you refer to the sign up checks
 or to the lack of actual insurance provided by some insurance company?

 As I see it, the sign up process is not much different than with any other
 budget certificate issuer. The difference is only the price.

 Regards


 On Friday, December 23, 2011 5:49:39 AM UTC+1, guruyaya wrote:

 I've used it myself, but note this certificate is not insured in any
 way, and it allows a pretty weak protection, in the free edition. It
 also fails to work with wget (you can add some extra params to make it
 work with wget, but most people don't want this hussle).
 The quiestion is, what is this certificate for? The free edition was
 good eanogth to prevent errors, when being transfered to google, when
 I wanted to retrieve contacts for google. I guess it's good for the
 admin, or to allow secured logins. But I wouldn't use to for web
 services (as I cannot trust it to work with command line clients), and
 avoid it for web payments (it's not insured at all).
 I have no idea if the none free edition of startssl.

 On Dec 22, 6:04 pm, Angelo Compagnucci angelo.co...@gmail.com
 wrote:
  This on is free and it works well
 
  http://www.startssl.com/?app=1
 
  They make simple validation, the certificate is ready in minutes and
 the
  certificate is a fully featured one!
 
  I use it!
 
  2011/12/22 Massimo Di Pierro massimo@gmail.com
 
   Any advice on where to buy a chap ssl certificate?
 
   Please advice ONLY about services you have personally used already.
 
   Massimo
 
  --
  Profile:http://www.gild.com/**compagnucciangelohttp://www.gild.com/compagnucciangelo
  Register on 
  Gild:http://www.gild.com/**referral/compagnucciangelohttp://www.gild.com/referral/compagnucciangelo




-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] ssl certificate?

2011-12-22 Thread Angelo Compagnucci
This on is free and it works well

http://www.startssl.com/?app=1

They make simple validation, the certificate is ready in minutes and the
certificate is a fully featured one!

I use it!

2011/12/22 Massimo Di Pierro massimo.dipie...@gmail.com

 Any advice on where to buy a chap ssl certificate?

 Please advice ONLY about services you have personally used already.

 Massimo




-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: book 4th edition in PDF

2011-12-17 Thread Angelo Compagnucci
I bought it!

Wonderful!

2011/12/17 Alan Etkin spame...@gmail.com

  I did not understand that point. What did you mean?

 Ok, now i get it:

 Do not download if other customer has not reported back yet

 And the watermark has to be the text in the footer.




-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: CMS idea

2011-12-12 Thread Angelo Compagnucci
Wow!

It' really amazing! This is really innovative and never seen! We must build
something like an easy administrative interface around it!

Great Massimo!

2011/12/12 Massimo Di Pierro massimo.dipie...@gmail.com

 And here is the full source

 https://github.com/mdipierro/Plasmid

 On Dec 11, 11:14 pm, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:
  I made a better version and I made a video about it:
 
  http://vimeo.com/33513600
 
  Massimo
 
  On Dec 10, 10:55 am, Massimo Di Pierro massimo.dipie...@gmail.com
  wrote:
 
 
 
 
 
 
 
   notice that every edited page gets its own new url... with minor
   changes one could make it edit its own pages and display a list of
   pages edited by the same user:
 
   Example of workflow:
   1. point it to a page you like
   2. clone it
   3. edit it
   4. clone the clone
   5. edit it and add links to the other cloned page
   6. goto 4
 
   ...
 
   the editor could be replaced with a minimalist version of ckeditor so
   one gets some clientside html validation.
   one could add macros like $comments, $contactform, translated
   serverside.
 
   On Dec 10, 10:07 am, Massimo Di Pierro massimo.dipie...@gmail.com
   wrote:
 
Would be really nice if you could hack the jeditable in inject.js so
that when clicking on an image one could edit the src and when
clicking on a link one could edit the href as well as the content.
Although this could also be handled via some server-side re.sub.
 
On Dec 10, 2:12 am, Angelo Compagnucci angelo.compagnu...@gmail.com
 
wrote:
 
 Totally insane! I'm astonished!
 
 This could be really useful for a project I'm working on, it's
 really
 what I'm looking for!
 
 Thank you!
 
 2011/12/10 Massimo Di Pierro massimo.dipie...@gmail.com:
 
  I wrote this code which could be used to create a CMS.
 
  The app basically asks for the URL of any existing pubic page.
 It allows you to edit the text of that page in place (simply double click
 on it) and saves it locally as a modified copy of the original page. It
 gives you a unique URL for the spoofed site. Basically this can be used
 to take any page and turn it into a layout. The in-place edit is filtered
 server-side therefore we can imagine all kind of manipulations such as
 using a markup language, etc.
 
  It is setup as a working demo but it probably is illegal to run
 it on a public site as it is.
  Yet you can install it on your machine and play with it.
 
  There is lots of room for improvement.
 
  Can somebody help and modify it so that all html and css are
 also downloaded and moved into a static subfolder, instead of linked?
 
  Can somebody help and improve the popup textareas so that is
 looks better?
 
  Massimo
 
 --
 Profile:http://www.gild.com/compagnucciangelo
 Register on Gild:http://www.gild.com/referral/compagnucciangelo




-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] CMS idea

2011-12-10 Thread Angelo Compagnucci
Totally insane! I'm astonished!

This could be really useful for a project I'm working on, it's really
what I'm looking for!

Thank you!

2011/12/10 Massimo Di Pierro massimo.dipie...@gmail.com:
 I wrote this code which could be used to create a CMS.

 The app basically asks for the URL of any existing pubic page. It allows you 
 to edit the text of that page in place (simply double click on it) and saves 
 it locally as a modified copy of the original page. It gives you a unique URL 
 for the spoofed site. Basically this can be used to take any page and turn 
 it into a layout. The in-place edit is filtered server-side therefore we can 
 imagine all kind of manipulations such as using a markup language, etc.

 It is setup as a working demo but it probably is illegal to run it on a 
 public site as it is.
 Yet you can install it on your machine and play with it.

 There is lots of room for improvement.

 Can somebody help and modify it so that all html and css are also downloaded 
 and moved into a static subfolder, instead of linked?

 Can somebody help and improve the popup textareas so that is looks better?


 Massimo




-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: web2py book 4th Edition

2011-12-10 Thread Angelo Compagnucci
Massimo, I'll hack on this, but first I prefer to give a finishing
touch to mobile admin, there are still som rough edges!

2011/12/10 Massimo Di Pierro massimo.dipie...@gmail.com:
 I thought I posted this trying again...

 http://web2py.com/examples/static/web2py_manual_4th.cut.pdf

 The first 130 pages of the book in pdf

 On Dec 9, 11:30 am, Massimo Di Pierro mdipie...@cs.depaul.edu wrote:
 The book 4th edition (in print) is available here:

 http://www.lulu.com/product/paperback/web2py-book-4th-edition/18738286

 I will post it on the web site asap and in PDF.

 The book described web2py 1.99.3 and later.

 Massimo



-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


[web2py] StaticPython!

2011-12-07 Thread Angelo Compagnucci
If you want to make your web2py application completely portable on
Linux, Mac OS X and FreeBSD you can use StaticPython:

http://code.google.com/p/pts-mini-gpl/wiki/StaticPython

From the homepage:

StaticPython is a statically linked version of the Python 2.x
(currently 2.7.1) and 3.x (currently 3.2) and Stackless Python
interpreters and their standard modules for 32-bit (i686, i386, x86)
Linux, Mac OS X and FreeBSD systems. It is distributed as single,
statically linked 32-bit executable binaries, which contains the
Python scripting engine, the interactive interpreter with command
editing (readline), the Python debugger (pdb), most standard Python
modules (including pure Python modules and C extensions), coroutine
support using greenlet and multithreading support. The binary contains
both the pure Python modules and the C extensions, so no additional
.py or .so files are needed to run it. It also works in a chroot
environment. The binary uses uClibc, so it supports username lookups
and DNS lookups as well (without NSS). 

I tested it and it works like a charm!

-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: Splitting controllers?

2011-12-05 Thread Angelo Compagnucci
These slides are really intresting, an english version sould be a must!

2011/12/5 Alan Etkin spame...@gmail.com:
 I think that large python files turn difficult to read (specially if
 you are contributing to the code)

 Here are some recommendations for big sites/apps (in spanish) by
 Martín Mulone:

 http://www.slideshare.net/martinpm/web2py-pensando-en-grande-9448110

 On Dec 5, 4:57 am, Ryan DowlingSoka gavite...@gmail.com wrote:
 Hi there! I started creating a website for a game at my college with
 web2py last winter, and this winter I am cleaning up a lot of the
 things I did rushed, and making it something that others can use...

 IE: not so reliant on me creating one time use controllers, or going
 straight to the shell to fix things.

 With that in mind, my default controller has become what appears to be
 a bloated beast of a python file and I'm wondering if I am right that
 I need to do something about it, or if I should just clean it up where
 I can and keep it all together.

 A big part of me loves compartmentalized modules, with a couple of
 functions in each, and I feel like for what I am doing it seems weird
 that I am writing what i would consider utility functions in the
 controller that also does page logic.

 For example, in the game the site is for a database has to often be
 checked to see what team the user is on, this can change rapidly and
 is needed in lots of places, so I created a utility function called
 zombieTest() with an optional argument for an inputted id number.

 In my mind I want this to be in the 'modules' folder and imported in.
 In practice this raised a bit of problems for me. When I finally
 started doing just that i realized a couple of things: first off db's
 have to be passed in, so it just adds another layer to using the
 zombieTest. It seems like I would always be putting in zombieTest(db),
 and if I want to test the current user id zombieTest(db, auth)
 Or maybe always requiring auth.user.id to be passed in directly for
 the id number.
 And while I could do that it just seems like a step backwards

 ...

 So I come to the much more experienced people at this than myself, and
 ask:

 Is the default controller being around 100kb a real issue?
 Is it wrong to create utility like functions like the one above that
 aren't ever meant to support views in the controller?

 and if so-

 How do I keep similar functionality, but put them in the correct
 place, or seperate the controllers.

 and if not:

 When should I seperate the controllers- or should I only do that for
 parts of the site that are practically seperate for eachother?

 Thanks! I just realized that I might be making my life harder rather
 than easier so I thought I would ask before I go much farther.



-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: date widget broken in trunk?

2011-12-04 Thread Angelo Compagnucci
Yes it's fixed and the new skin is really slick!

Great Massimo!

2011/12/4 Massimo Di Pierro massimo.dipie...@gmail.com:
 I believe this is now fixed. Please check it.


 On Dec 3, 5:04 pm, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
 Yes, I can confirm there is a bug.

 With this model:

 db.define_table('testdb',Field('test','datetime', requires=IS_DATETIME()))

 I have this html using SQLFORM:

 [...] input class=string id=testdb_test name=test type=text
 value= / [..]

 class should be datetime, not string!

 2011/12/3 Carlos carlosgali...@gmail.com:









  Hi,

  Is DATE widget broken in trunk?.

  Previously when I had a 'date' type field (with no widget), it was
  automatically assigned the 'date' class with a date picker.

  Now, even if I explicitly assign a DATE widget
  (SQLFORM.widgets.date.widget), it generates an input with 'string' class 
  and
  no date picker.

  Can you please check into this?.

  Thanks,

     Carlos

 --
 Profile:http://www.gild.com/compagnucciangelo
 Register on Gild:http://www.gild.com/referral/compagnucciangelo



-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] date widget broken in trunk?

2011-12-03 Thread Angelo Compagnucci
Yes, I can confirm there is a bug.

With this model:

db.define_table('testdb',Field('test','datetime', requires=IS_DATETIME()))

I have this html using SQLFORM:

[...] input class=string id=testdb_test name=test type=text
value= / [..]

class should be datetime, not string!

2011/12/3 Carlos carlosgali...@gmail.com:
 Hi,

 Is DATE widget broken in trunk?.

 Previously when I had a 'date' type field (with no widget), it was
 automatically assigned the 'date' class with a date picker.

 Now, even if I explicitly assign a DATE widget
 (SQLFORM.widgets.date.widget), it generates an input with 'string' class and
 no date picker.

 Can you please check into this?.

 Thanks,

    Carlos




-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: trunk error

2011-11-30 Thread Angelo Compagnucci
There is an error on line 214 of gluon/contrib/user_agent_parser.py,

should be:

dist=['WindowsMobile'], flavor=None

2011/11/30 Bruno Rocha rochacbr...@gmail.com:
 I just removed the {{is_mobile=request.user_agent().is_mobile}} from the
 */layout views and admin controller

 it worked..


 On Wed, Nov 30, 2011 at 4:03 PM, Anthony abasta...@gmail.com wrote:

 Note, this is also causing 'admin' to fail. I submitted a ticket.


 On Wednesday, November 30, 2011 12:19:48 PM UTC-5, rochacbruno wrote:

 Just got the same with firefox on windows

 (dp1
 S'output'
 p2
 Stype 'exceptions.SyntaxError' invalid syntax (user_agent_parser.py,
 line 214)


 --

 Bruno Rocha
 [http://rochacbruno.com.br]




 --

 Bruno Rocha
 [http://rochacbruno.com.br]




-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: could use some help ... mobile admin

2011-11-29 Thread Angelo Compagnucci
I'm astonished,

I'm trying to use admin from my rly old htc g1 with android
and it's totally usable and responsive! Great!

I want mobile admin as soon as possible!

There is a way to know the current porting status? What files left to be edited?

I'll look myself and if I find the response by myself, i'll send you my patches!

Thank you!

2011/11/28 Massimo Di Pierro massimo.dipie...@gmail.com:
 No

 On Nov 28, 1:48 am, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
 Great!

 I'll work on it a soon as possible!

 Are you using the Auto-initialization of form elements ?

 Thanks!

 2011/11/28 Massimo Di Pierro massimo.dipie...@gmail.com:









  I could use some help. In trunk there is code for mobile admin.

  That means that if you visit admin from a mobile device it will use
  jquery.mobile. This is a work in progress and only some pages have
  been implemented but you can help. It is easy.

  In applications/admin/controllers/default.py there is this magic code:

     is_mobile=request.user_agent().is_mobile
     if is_mobile:
         response.view =
  response.view.replace('default/','default.mobile/')

  so if you use a mobile is_mobile==True and is will pick up views from
  views/default.mobile instead of views/default.

  I copied all views from views/default into views/default.mobile and I
  have fixed only index.html, site.html, edit.html about.html. The
  other *.html files need work, this is where you can help

  - replace {{extend 'layout.html'}} with {{extend 'default.mobile/
  layout.html}}.
  - remove any extra text that does not belong to a mobile
  - replace ul with ul  data-role=listview
  - replace all external links (i.e. not internal to admin) from a...
  to a rel=external...

  design.html is going to need some extra work.

  If you can help send me the modified files.

  Also let me know if you have comments or suggestions.

  Massimo

 --
 Profile:http://www.gild.com/compagnucciangelo
 Register on Gild:http://www.gild.com/referral/compagnucciangelo



-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: could use some help ... mobile admin

2011-11-29 Thread Angelo Compagnucci
I almost done the admin mobilization!

I have to get rid of an error on design.html, when done, I'll send you patches!

Thanks!

2011/11/29 Angelo Compagnucci angelo.compagnu...@gmail.com:
 I'm astonished,

 I'm trying to use admin from my rly old htc g1 with android
 and it's totally usable and responsive! Great!

 I want mobile admin as soon as possible!

 There is a way to know the current porting status? What files left to be 
 edited?

 I'll look myself and if I find the response by myself, i'll send you my 
 patches!

 Thank you!

 2011/11/28 Massimo Di Pierro massimo.dipie...@gmail.com:
 No

 On Nov 28, 1:48 am, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
 Great!

 I'll work on it a soon as possible!

 Are you using the Auto-initialization of form elements ?

 Thanks!

 2011/11/28 Massimo Di Pierro massimo.dipie...@gmail.com:









  I could use some help. In trunk there is code for mobile admin.

  That means that if you visit admin from a mobile device it will use
  jquery.mobile. This is a work in progress and only some pages have
  been implemented but you can help. It is easy.

  In applications/admin/controllers/default.py there is this magic code:

     is_mobile=request.user_agent().is_mobile
     if is_mobile:
         response.view =
  response.view.replace('default/','default.mobile/')

  so if you use a mobile is_mobile==True and is will pick up views from
  views/default.mobile instead of views/default.

  I copied all views from views/default into views/default.mobile and I
  have fixed only index.html, site.html, edit.html about.html. The
  other *.html files need work, this is where you can help

  - replace {{extend 'layout.html'}} with {{extend 'default.mobile/
  layout.html}}.
  - remove any extra text that does not belong to a mobile
  - replace ul with ul  data-role=listview
  - replace all external links (i.e. not internal to admin) from a...
  to a rel=external...

  design.html is going to need some extra work.

  If you can help send me the modified files.

  Also let me know if you have comments or suggestions.

  Massimo

 --
 Profile:http://www.gild.com/compagnucciangelo
 Register on Gild:http://www.gild.com/referral/compagnucciangelo



 --
 Profile: http://www.gild.com/compagnucciangelo
 Register on Gild: http://www.gild.com/referral/compagnucciangelo



-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: could use some help ... mobile admin

2011-11-29 Thread Angelo Compagnucci
Get the trunk!

If you want to use the admin app whitout setting aup https in a
private environment, you have to comment out these lines in
models/access.py:

#elif not request.is_local and not DEMO_MODE:
#raise HTTP(200, T('Admin is disabled because insecure channel'))

2011/11/30 Javier Quarite jquari...@gmail.com:


 On Tue, Nov 29, 2011 at 6:40 PM, Angelo Compagnucci
 angelo.compagnu...@gmail.com wrote:

 I almost done the admin mobilization!

 I have to get rid of an error on design.html, when done, I'll send you
 patches!

 Thanks!


 Is there a way to see an example? it sounds interesting and it could be a
 good reason to make my friends use web2py :D



-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] could use some help ... mobile admin

2011-11-27 Thread Angelo Compagnucci
Great!

I'll work on it a soon as possible!

Are you using the Auto-initialization of form elements ?

Thanks!

2011/11/28 Massimo Di Pierro massimo.dipie...@gmail.com:
 I could use some help. In trunk there is code for mobile admin.

 That means that if you visit admin from a mobile device it will use
 jquery.mobile. This is a work in progress and only some pages have
 been implemented but you can help. It is easy.

 In applications/admin/controllers/default.py there is this magic code:

    is_mobile=request.user_agent().is_mobile
    if is_mobile:
        response.view =
 response.view.replace('default/','default.mobile/')

 so if you use a mobile is_mobile==True and is will pick up views from
 views/default.mobile instead of views/default.

 I copied all views from views/default into views/default.mobile and I
 have fixed only index.html, site.html, edit.html about.html. The
 other *.html files need work, this is where you can help

 - replace {{extend 'layout.html'}} with {{extend 'default.mobile/
 layout.html}}.
 - remove any extra text that does not belong to a mobile
 - replace ul with ul  data-role=listview
 - replace all external links (i.e. not internal to admin) from a...
 to a rel=external...

 design.html is going to need some extra work.

 If you can help send me the modified files.

 Also let me know if you have comments or suggestions.

 Massimo




-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


[web2py] Web2py on pypy 1.7

2011-11-22 Thread Angelo Compagnucci
It give this error:

Traceback (most recent call last):
  File /home/angelo/DEV/web2py-dev/gluon/main.py, line 493, in wsgibase
serve_controller(request, response, session)
  File /home/angelo/DEV/web2py-dev/gluon/main.py, line 187, in
serve_controller
environment = build_environment(request, response, session)
  File /home/angelo/DEV/web2py-dev/gluon/compileapp.py, line 269, in
build_environment
__builtins__['__import__'] = __builtin__.__import__ ### WHY?
TypeError: 'module' object does not support item assignment

I'm digging on it!

-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] jquery mobile 1.0 released

2011-11-18 Thread Angelo Compagnucci
This should be absolutely in web2py!

2011/11/18 Massimo Di Pierro massimo.dipie...@gmail.com:
 http://jquerymobile.com/blog/2011/11/16/announcing-jquery-mobile-1-0/



-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: jquery mobile 1.0 released

2011-11-18 Thread Angelo Compagnucci
Well yes!

Thinking of a sortable list plugin, it should be in jquery for desktop
and automatically switch to jquery mobile if os is_mobile. A sortable
list works very diffrently whith mouse and gestures.

We should have a comprehensive set of pugins covering a wide range of
cases, and each one should be mobile friendly.

The welcome apps is mobilized very well right now, it could be used
for basic apps. But what the case if you want more?
I'm thinking of chart, sortable lists, and generally all the gesture
enabled widget that can be used on a phone.

Jquery mobile seems to not offer a comprehensive mobile widget
catalog, but these
http://jquerymobile.com/demos/1.0/docs/lists/lists-forms-inset.html
lonely makes the ui very attractive and functional on mobile os.

I'm glad to help writing code for this!

Angelo

2011/11/18 Massimo Di Pierro massimo.dipie...@gmail.com:
 How? We can upgrade plugin_mobile.

 Or are you thinking about something else?

 I would like to have a version of admin (or perhaps a better wizard)
 based on jquery mobile.

 On Nov 18, 4:26 am, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
 This should be absolutely in web2py!

 2011/11/18 Massimo Di Pierro massimo.dipie...@gmail.com:

 http://jquerymobile.com/blog/2011/11/16/announcing-jquery-mobile-1-0/

 --
 Profile:http://www.gild.com/compagnucciangelo
 Register on Gild:http://www.gild.com/referral/compagnucciangelo



-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: web2py with twitter bootstrap - very clean interface ...

2011-11-09 Thread Angelo Compagnucci
It totally rocks!

2011/11/9 David Watson davidthewat...@gmail.com:
 Sorry, I found it:

 http://groups.google.com/group/web2py-developers/browse_thread/thread/d9c3698044c4902f/8eb26098b55388d3?lnk=gstq=bootstrap#8eb26098b55388d3

 On Nov 9, 12:47 pm, David Watson davidthewat...@gmail.com wrote:
 On Sep 26, 5:43 pm, Bruno Rocha rochacbr...@gmail.com wrote:

  We are planning to include it in the next web2py version.

  I will share the actual w2p after a clean up.

 Hi, does anybody know if the twitter-bootstrap integration code is
 available for web2py yet? The one shown here:

 http://labs.blouweb.com/bootstrap/

 I was about to embark on some web2py work that requires twitter-
 bootstrap, but I wasn't sure if this was available yet.

 Thanks,
 David



-- 
Profile: http://www.gild.com/compagnucciangelo
Register on Gild: http://www.gild.com/referral/compagnucciangelo


Re: [web2py] Re: Mobile detector

2011-09-13 Thread Angelo Compagnucci
Hi Martin,

You are right, but the previous trunk version it worked.

Massimo, could you enlighten us?

Thanks!

2011/9/13 Martin Weissenboeck mweis...@gmail.com:
 Hi,

 I have tried to test the user_agent_parser. At the top of default.py there
 is

 from gluon.contrib import user_agent_parser

 @mobilize
 def m():
     ua = request.user_agent()
     if ua.is_mobile():
     return dict(a='MOBILE')
     else:
     return dict(a='FIX')

 And I got:


 Traceback (most recent call last):
   File /home/web2py-trunk/public_html/gluon/restricted.py, line 194, in
 restricted


 exec ccode in environment
   File
 /home/web2py-trunk/public_html/applications/welcome/controllers/default.py,
 line 14, in module


 @mobilize
 NameError: name 'mobilize' is not defined


 Version 1.99.0 (2011-09-13 04:16:50)

 I have checked it, in the source code there is:

 class mobilize(object):

 def __init__(self, func):
 self.func = func

 def __call__(self):
 from gluon import current
 if current.session._user_agent and
 current.session._user_agent.is_mobile:
 items = current.response.view.split('.')
 items.insert(-1,'mobile')
 current.response.view = '.'.join(items)
 return self.func()

 Without @mobilize the program detects my Android phone - no errors. Maybe
 there is only a small error, but I cannot find it.

 Regards, Martin



Re: [web2py] Re: .mobile.html disappeared

2011-09-13 Thread Angelo Compagnucci
Hi Martin,

The first time you download the source you can use:

hg clone https://code.google.com/p/web2py/ web2py-dev

Getting the latest version is really a matter of typing:

hg pull -u

into the web2py-dev folder!

2011/9/13 Martin Weissenboeck mweis...@gmail.com:
 Ok, I have to wait for the nightly built  :-)
 I think I should spend some time to learn how to work with the
 repository

 2011/9/13 Massimo Di Pierro massimo.dipie...@gmail.com

 I think I fixed it in trunk. Can you check?

 On Sep 13, 8:24 am, Martin Weissenboeck mweis...@gmail.com wrote:
  I have written a small test function def m() for the @mobilize
  decorator.
  Then I have created two views default/m.html and
  default/m.mobile.html.
  Both views are working correct, but the second one has disappeared from
  the
  view menu:



Re: [web2py] Re: What if i want 2 views for the same controller function?

2011-09-13 Thread Angelo Compagnucci
Yes, it is the method used by the @mobilize decorator!

2011/9/13 Rufus rufusvsm...@gmail.com:
 In fact, view reselect might be nicely handled in a decorator
 function!

 Just decorate those functions that require multiple views (like mobile
 versus normal)
 It could modify the view name for the correct view file.


Re: [web2py] Re: Mobile detector

2011-08-30 Thread Angelo Compagnucci
I think that the extension should match the content, it's more clear.

For a json object I'm expecting a .json, an xml should have an xml
extension and so on. So for the mobile view I think the best is to
have a .mobi extension, but this is IMHO.

Also using the .mobile.html could be viable, because a mobile view is
substantially an html file.

For me it's ok to have .mobile.html extension

2011/8/30 Massimo Di Pierro massimo.dipie...@gmail.com:
 Unless there is a strong objection I will modify the code in trunk to
 use index.mobile.html

 view = '.'.join(view.split().insert(-1,'mobile'))

 On Aug 30, 2:13 am, Bruno Rocha rochacbr...@gmail.com wrote:
 On Tue, Aug 30, 2011 at 2:05 AM, Anthony abasta...@gmail.com wrote:
  Good point. Couldn't you also do something like index.mobi.html or
  index.html.mobi? I don't think these view names would necessarily have to
  be exposed as URLs -- they just need to be used server side to render the
  page appropriately.

 It is only a semantic issue, because the pattern for any API is terminating
 with the extension format. .json, .xml, .csv . it is more elegant IMO than
 x.json.mobi


Re: [web2py] Re: Mobile detector

2011-08-29 Thread Angelo Compagnucci
Hi Martin,

In trunk the correct syntax should be:

from gluon.contrib import user_agent_parser
ua = user_agent_parser.detect(request.env.http_user_agent)
if ua.is_mobile: ...

Or better:

ua = request.user_agent()
if ua.is_mobile: ...

The mothod user_agent() search in session if the user_agent was
already parsed, so in the end it parses the user agent only first
time.

2011/8/29 Martin Weissenboeck mweis...@gmail.com:
 I tried:

 def mobile():
     from gluon.contrib import user_agent_parser
     ua = user_agent_parser.detect(request.env.http_user_agent)
     if ua.dist.is_mobile: 
 and i got:
 AttributeError: 'NoneType' object has no attribute 'is_mobile'
 Browsers: Opera 11.50, Safari 3.1.2
 (1) What is wrong?
 (2) There have been a lot of proposals how to change every view from .html
 to .m.html  if is_mobile is true.
 Now I am a little bit confused: what would be the best code following   if
 ua.dist.is_mobile...?
 Regards, Martin
 2011/8/28 Massimo Di Pierro massimo.dipie...@gmail.com

 I have no objection.What do others think?

 On Aug 28, 10:53 am, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
  HI Ross, Massimo,
 
  I wrote a small decorator to use the newly added is_mobile flag:
 
  class mobilize(object):
      def __init__(self, func):
          self.func = func
      def __call__(self):
          from gluon import current
          if current.session._user_agent:
              if current.session._user_agent.is_mobile:
                  current.response.view = \
                      current.response.view.split(.)[0] + .mobi
          return self.func()
 
  It should be included at the bottom of user_agent_parser.py.
 
  With this you can have automatically selected the view.html or the
  view.mobi depending on your browser is mobile or not, an example could
  be:
 
  @mobilize
  def index():
      
      example action using the mobilizer decorator it is
      rendered by views/default/index.html or
      views/default/index.mobi depending if your browser
      is mobile or not
      
      return dict(message=response.view)
 
  Could this be added in trunk?
 
  2011/8/27 Massimo Di Pierro massimo.dipie...@gmail.com:
 
 
 
 
 
 
 
   This is in trunk as of last night.
 
   On Aug 26, 12:13 pm, Ross Peoples ross.peop...@gmail.com wrote:
   I submitted this to Massimo for inclusion. Now we wait :)




Re: [web2py] Re: Mobile detector

2011-08-29 Thread Angelo Compagnucci
Hi Maritn,

In trunk you can now do:

#only at the top of you controller
from gluon.contrib import user_agent_parser

@mobilize
def index():
   
   example action using the mobilizer decorator it is
   rendered by views/default/index.html or
   views/default/index.mobi depending if your browser
   is mobile or not
   
   return dict(message=response.view)

With this decorator, the index page is rendered by index.html if you
are on a desktop browser and index.mobi if you are on a mobile
browser.
So to implement a sort of responsive design simply using the @mobilize
decorator and writing your mobile custom views.
The decorator is totally optional, so you can implement only the
mobile version of pages you care.

Angelo

2011/8/29 Martin Weissenboeck mweis...@gmail.com:
 Hi Angelo, it works now, thanks!
 Any ideas about the second question?
  There have been a lot of proposals how to change every view from .html  to
 .m.html  if is_mobile is true.
  Now I am a little bit confused: what would be the best code following   if
 ua.is_mobile...?

 2011/8/29 Angelo Compagnucci angelo.compagnu...@gmail.com

 Hi Martin,

 In trunk the correct syntax should be:

 from gluon.contrib import user_agent_parser
 ua = user_agent_parser.detect(request.env.http_user_agent)
 if ua.is_mobile: ...

 Or better:

 ua = request.user_agent()
 if ua.is_mobile: ...

 The mothod user_agent() search in session if the user_agent was
 already parsed, so in the end it parses the user agent only first
 time.

 2011/8/29 Martin Weissenboeck mweis...@gmail.com:
  I tried:
 
  def mobile():
      from gluon.contrib import user_agent_parser
      ua = user_agent_parser.detect(request.env.http_user_agent)
      if ua.dist.is_mobile: 
  and i got:
  AttributeError: 'NoneType' object has no attribute 'is_mobile'
  Browsers: Opera 11.50, Safari 3.1.2
  (1) What is wrong?
  (2) There have been a lot of proposals how to change every view from
  .html
  to .m.html  if is_mobile is true.
  Now I am a little bit confused: what would be the best code following
  if
  ua.dist.is_mobile...?
  Regards, Martin
  2011/8/28 Massimo Di Pierro massimo.dipie...@gmail.com
 
  I have no objection.What do others think?
 
  On Aug 28, 10:53 am, Angelo Compagnucci angelo.compagnu...@gmail.com
  wrote:
   HI Ross, Massimo,
  
   I wrote a small decorator to use the newly added is_mobile flag:
  
   class mobilize(object):
       def __init__(self, func):
           self.func = func
       def __call__(self):
           from gluon import current
           if current.session._user_agent:
               if current.session._user_agent.is_mobile:
                   current.response.view = \
                       current.response.view.split(.)[0] + .mobi
           return self.func()
  
   It should be included at the bottom of user_agent_parser.py.
  
   With this you can have automatically selected the view.html or the
   view.mobi depending on your browser is mobile or not, an example
   could
   be:
  
   @mobilize
   def index():
       
       example action using the mobilizer decorator it is
       rendered by views/default/index.html or
       views/default/index.mobi depending if your browser
       is mobile or not
       
       return dict(message=response.view)
  
   Could this be added in trunk?
  
   2011/8/27 Massimo Di Pierro massimo.dipie...@gmail.com:
  
  
  
  
  
  
  
This is in trunk as of last night.
  
On Aug 26, 12:13 pm, Ross Peoples ross.peop...@gmail.com wrote:
I submitted this to Massimo for inclusion. Now we wait :)
 
 




Re: [web2py] Re: Mobile detector

2011-08-28 Thread Angelo Compagnucci
HI Ross, Massimo,

I wrote a small decorator to use the newly added is_mobile flag:

class mobilize(object):
def __init__(self, func):
self.func = func
def __call__(self):
from gluon import current
if current.session._user_agent:
if current.session._user_agent.is_mobile:
current.response.view = \
current.response.view.split(.)[0] + .mobi
return self.func()

It should be included at the bottom of user_agent_parser.py.

With this you can have automatically selected the view.html or the
view.mobi depending on your browser is mobile or not, an example could
be:

@mobilize
def index():

example action using the mobilizer decorator it is
rendered by views/default/index.html or
views/default/index.mobi depending if your browser
is mobile or not

return dict(message=response.view)

Could this be added in trunk?

2011/8/27 Massimo Di Pierro massimo.dipie...@gmail.com:
 This is in trunk as of last night.

 On Aug 26, 12:13 pm, Ross Peoples ross.peop...@gmail.com wrote:
 I submitted this to Massimo for inclusion. Now we wait :)


Re: [web2py] Re: Mobile detector

2011-08-26 Thread Angelo Compagnucci
Hi Ross,

I have explained myself too convoluted!

You are right on is_mobile and polymorphism, I read too
approximatively the code.

You are right also on attch always the is_mobile True/False to the
result object, is more simple to test for true false than that if
exists or not.

I hope it will be included as soon as possible!

Thank you!

2011/8/24 Ross Peoples ross.peop...@gmail.com:
 Well, the reason is_mobile is in the base object is for polymorphism to
 work. If we later did do a WindowsMobile(Dist): class, we can easily set
 is_mobile = True in it, since Dist is a subclass of the DetectorBase. I just
 left is_mobile attached to the response even if it's not mobile because it
 makes it easier to test. Someone may test by trying if ua.is_mobile ==
 False. So if is_mobile doesn't exist, it equals None and the test will fail.
 The routine runs pretty quickly. The thing that takes the longest is string
 searching.


Re: [web2py] Re: Published my collection of plugins

2011-08-26 Thread Angelo Compagnucci
I think that some of this should be included in web2py!

Great work!

2011/8/26 Massimo Di Pierro massimo.dipie...@gmail.com:
 WOW. fantastic!

 massimo

 On Aug 26, 11:35 am, kenji4569 hos...@s-cubism.jp wrote:
 Hi, I've just published a collection of plugins which I'd created for
 some web2py products (mainly cms sites) in my job:

 The index page:http://dev.s-cubism.com/web2py_plugins

 The plugins are below:

 [Form Widgets]
  Horizontal Radio Widgethttp://dev.s-cubism.com/plugin_hradio_widget
  Multiple Select Widgethttp://dev.s-cubism.com/plugin_multiselect_widget
  Suggest Widgethttp://dev.s-cubism.com/plugin_suggest_widget
  Lazy Options Widgethttp://dev.s-cubism.com/plugin_lazy_options_widget
  Anytime Widgethttp://dev.s-cubism.com/plugin_anytime_widget
  Color Widgethttp://dev.s-cubism.com/plugin_color_widget
  elRTE WYSIWYG Widgethttp://dev.s-cubism.com/plugin_elrte_widget
  Uploadify Widgethttp://dev.s-cubism.com/plugin_uploadify_widget

 [Form Customize]
  Solid Formhttp://dev.s-cubism.com/plugin_solidform
  Not-Empty Markerhttp://dev.s-cubism.com/plugin_notemptymarker

 [Table Customize]
  Solid Tablehttp://dev.s-cubism.com/plugin_solidtable
  Pagenatorhttp://dev.s-cubism.com/plugin_paginator
  Table Scopehttp://dev.s-cubism.com/plugin_tablescope
  Table Checkboxhttp://dev.s-cubism.com/plugin_tablecheckbox
  Table Permuterhttp://dev.s-cubism.com/plugin_tablepermuter

 You can try demos, see souces, and download plugins (MIT Licence).
 I'll appreciate your feedback and advises (especially for design
 decisions).
 I'll keep trying to create useful plugins and to improve them!


Re: [web2py] Re: Mobile detector

2011-08-24 Thread Angelo Compagnucci
Hi Ross,

I thought deeply on the implication on using the dist object. There
are many points in favour:

1) Only dist object could be mobile ones from the code, Android -
Iphone - Ipad are all dist objects.
2) If you want to detect Windows Mobile in a near future, you'll
create a new dist object right? Then you can add the is_mobile flag
there.
3) I think that is_mobile flag should be in dist object, because a
Linux could have a dist like ubuntu whithout is_mobile or a dist like
android whit is_mobile = True.

I agree whit you that the is_mobile flag should be on root of the
result object and not on a leaf object as dist, we could copy the flag
if found at the end of detect phase.
Furthermore I think that is a waste copying everey time the is_mobile
flag to the root of result also when the useragent is not mobile.

I think that the detect method should be like this:

def detect(self, agent, result):
if agent and self.checkWords(agent):
result[self.info_type] = Storage(name=self.name)
is_mobile = getattr(self, 'is_mobile', False)
if version:
result[self.info_type].version = version
if is_mobile:
result.is_mobile = \
result[self.info_type].is_mobile = is_mobile
return True
return False

The getattr is really a speedy python operation and the if is_mobile
is evaluated to True only one time, the one it founds a dist whit
is_mobile = True.

What do you think?

2011/8/24 Ross Peoples ross.peop...@gmail.com:
 Forgot to attach, sorry




Re: [web2py] Re: Mobile detector

2011-08-24 Thread Angelo Compagnucci
This works like a charm!

def detect(self, agent, result):
if agent and self.checkWords(agent):
result[self.info_type] = Storage(name=self.name)
version = self.getVersion(agent)
if version:
result[self.info_type].version = version
if self.is_mobile:
result.is_mobile = \
result[self.info_type].is_mobile = self.is_mobile
return True
return False

2011/8/24 Angelo Compagnucci angelo.compagnu...@gmail.com:
 Hi Ross,

 I thought deeply on the implication on using the dist object. There
 are many points in favour:

 1) Only dist object could be mobile ones from the code, Android -
 Iphone - Ipad are all dist objects.
 2) If you want to detect Windows Mobile in a near future, you'll
 create a new dist object right? Then you can add the is_mobile flag
 there.
 3) I think that is_mobile flag should be in dist object, because a
 Linux could have a dist like ubuntu whithout is_mobile or a dist like
 android whit is_mobile = True.

 I agree whit you that the is_mobile flag should be on root of the
 result object and not on a leaf object as dist, we could copy the flag
 if found at the end of detect phase.
 Furthermore I think that is a waste copying everey time the is_mobile
 flag to the root of result also when the useragent is not mobile.

 I think that the detect method should be like this:

    def detect(self, agent, result):
        if agent and self.checkWords(agent):
            result[self.info_type] = Storage(name=self.name)
            is_mobile = getattr(self, 'is_mobile', False)
            if version:
                result[self.info_type].version = version
            if is_mobile:
                result.is_mobile = \
                result[self.info_type].is_mobile = is_mobile
            return True
        return False

 The getattr is really a speedy python operation and the if is_mobile
 is evaluated to True only one time, the one it founds a dist whit
 is_mobile = True.

 What do you think?

 2011/8/24 Ross Peoples ross.peop...@gmail.com:
 Forgot to attach, sorry





[web2py] Bug in user_agent_parser.py

2011-08-23 Thread Angelo Compagnucci
Hi list,

I'm using user_agent_parser.py from the latest stable version.

I have this user agent:

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0

I cannot understand why the code looks for the Opera user agent (I
have not read carefully the code) but it fails with this error:

  File 
C:\Users\Collaboratore\Documents\HotSpot\MANAGER\web2py\gluon\contrib\user_agent_parser.py,
line 134, in getVersion
return agent.split(self.look_for)[1][1:].split(' ')[0]
IndexError: list index out of range

Clearly the code has a problem:

class Opera(Browser):
look_for = Opera
def getVersion(self, agent):
return agent.split(self.look_for)[1][1:].split(' ')[0]

This agent.split(self.look_for)[1] raise an exception when look_for
returns nothing (as in my case).

I think it should be a sort of checking prior calling getVersion, or
call getVersion only when the useragent is really Opera!

I'll look forward into the code and I'll try to look for a solution.

Thank you!


[web2py] Re: Bug in user_agent_parser.py

2011-08-23 Thread Angelo Compagnucci
OK,

I think I found the problem.

It's located in these two functions.

def detect(self, agent, result):
if agent and self.checkWords(agent):
result[self.info_type] = Storage(name=self.name)
version = self.getVersion(agent)
if version:
result[self.info_type].version = version
return True
return False

def checkWords(self, agent):
for w in self.skip_if_found:
if w in agent:
return False
if self.look_for:
return True
return False


Detect should return true only if agent is not empty and
checkWords(agent) returns true.
The method checkWords(agent) shows a problem, the method return true
when the variable self.look_for exist, and not check if the words in
the useragent really match the ones into look_for variable.

It should be something like this:

 def checkWords(self, agent):
for w in self.skip_if_found:
if w in agent:
return False
if self.look_for in agent:   
  return True
return False

Whith this fix it works for me!

Bye!


2011/8/23 Angelo Compagnucci angelo.compagnu...@gmail.com:
 Hi list,

 I'm using user_agent_parser.py from the latest stable version.

 I have this user agent:

 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0

 I cannot understand why the code looks for the Opera user agent (I
 have not read carefully the code) but it fails with this error:

  File 
 C:\Users\Collaboratore\Documents\HotSpot\MANAGER\web2py\gluon\contrib\user_agent_parser.py,
 line 134, in getVersion
    return agent.split(self.look_for)[1][1:].split(' ')[0]
 IndexError: list index out of range

 Clearly the code has a problem:

 class Opera(Browser):
    look_for = Opera
    def getVersion(self, agent):
                return agent.split(self.look_for)[1][1:].split(' ')[0]

 This agent.split(self.look_for)[1] raise an exception when look_for
 returns nothing (as in my case).

 I think it should be a sort of checking prior calling getVersion, or
 call getVersion only when the useragent is really Opera!

 I'll look forward into the code and I'll try to look for a solution.

 Thank you!



Re: [web2py] Re: Mobile detector

2011-08-23 Thread Angelo Compagnucci
Hi Ross,

I'm looking into your user_agent_parser.py but I cannot find something
like the mobile detector.

I'll explain better. With user_agent_parser.py you can look for
browser version and os version, but there isn't an easy way to dectect
if a browser is mobile or not, or I'm missing something?

I think that a decorator for mobile versions or a global variable that
tells me a mobile browser wants mobile view is really necessary.

I think it could be a really great and appreciated addition to the framework!

If you have somthing in mind, please share with us, I can contribute
to code and help testing.

Thank you!

2011/8/18 Ross Peoples ross.peop...@gmail.com:
 We already have a user_agent_parser.py in contrib. Isn't that the same
 thing?
 Usage:
 import contrib.user_agent_parser
 user_agent_parser.simple_detect(request.env.http_user_agent)
 By the way, didn't you add something to the Google Issues page for the
 proposal saying you were getting an error from that? If so can you give me
 the user agent string that caused it? I asked for it on the issue, but I
 figured you didn't have notifications turned on and never got the message.


Re: [web2py] Re: Bug in user_agent_parser.py

2011-08-23 Thread Angelo Compagnucci
Thank you!

It works like a charm!

I'll keep you informed if I find anything!

Thank you!

2011/8/23 Ross Peoples ross.peop...@gmail.com:
 I just submitted a patch for inclusion into the trunk. It includes the
 change you mention, and includes a few other fixes, including a fix to the
 simple_detect() method that would throw a different set of IndexErrors.
 I have attached it here as well so that you can test while waiting for
 inclusion into the trunk. Let me know is this is working for you. Thanks.



Re: [web2py] Re: Mobile detector

2011-08-23 Thread Angelo Compagnucci
Hi Ross,

Thank you for the info, it's really a good suggestion.

I'll try to add a variable like is_mobile, becase all informations
about browser and versions are already present in your code.

I think however that the Bruno's approach is really awesome. It's
really simple using the decorator, and really conveniente to have a
globale switch for .mobile views.

I think the Bruno's code should be included because it doesn't
conflict with user_agent_parser.py and it really complements it from a
mobile perspective.

Thank you!

2011/8/23 Ross Peoples ross.peop...@gmail.com:
 We could always modify the simple_detect() method to include a third item in
 the returned tuple that is a string (i.e. 'desktop', ,'mobile', etc) based
 on the outcome of the detect. That shouldn't be too difficult to do if you
 want to give it a try.


Re: [web2py] Re: Mobile detector

2011-08-23 Thread Angelo Compagnucci
Hi Ross,

I produced a patch that adds the is_mobile boolean flag to a dist if
the useragent belongs to a mobile device.
Ptch is made on the last dev revision pulled from mercurial.
It's actually a simple patch that modifies no more than ten lines of
code, hope this helps!

Now you could make:

from gluon.contrib import user_agent_parser
ua = user_agent_parser.detect(request.env.http_user_agent)
if ua.dist.is_mobile:
   ...
else:
   ...

2011/8/23 Anthony abasta...@gmail.com:
 Also, note that you can access user_agent_parser.py by calling
 request.user_agent(). The nice thing about the latter is that it will store
 the result in the session (as session._user_agent), so it only needs to
 parse the user agent once per session.

 Anthony
 On Tuesday, August 23, 2011 1:30:36 PM UTC-4, AngeloC wrote:

 Hi Ross,

 I'm looking into your user_agent_parser.py but I cannot find something
 like the mobile detector.

 I'll explain better. With user_agent_parser.py you can look for
 browser version and os version, but there isn't an easy way to dectect
 if a browser is mobile or not, or I'm missing something?

 I think that a decorator for mobile versions or a global variable that
 tells me a mobile browser wants mobile view is really necessary.

 I think it could be a really great and appreciated addition to the
 framework!

 If you have somthing in mind, please share with us, I can contribute
 to code and help testing.

 Thank you!

 2011/8/18 Ross Peoples ross.p...@gmail.com:

  We already have a user_agent_parser.py in contrib. Isn't that the same
  thing?
  Usage:
  import contrib.user_agent_parser
  user_agent_parser.simple_detect(request.env.http_user_agent)
  By the way, didn't you add something to the Google Issues page for the
  proposal saying you were getting an error from that? If so can you give
  me
  the user agent string that caused it? I asked for it on the issue, but I
  figured you didn't have notifications turned on and never got the
  message.

# HG changeset patch
# User Angelo Compagnucci angelo.compagnu...@gmail.com
# Date 1314136920 -7200
# Node ID eb6774c91adac9a064e8d361f2cc3f1ea0dfe955
# Parent  2c1f4c7f4f8e7e286d561688a16b08d139d5ea62
Added is_mobile flag in each dist that is actually a mobile device.
If a device is a mobile one, the resulting Storage has the attribute is_mobile in dist set to True.

diff -r 2c1f4c7f4f8e -r eb6774c91ada gluon/contrib/user_agent_parser.py
--- a/gluon/contrib/user_agent_parser.py	Mon Aug 22 22:58:57 2011 -0500
+++ b/gluon/contrib/user_agent_parser.py	Wed Aug 24 00:02:00 2011 +0200
@@ -72,8 +72,11 @@
 if agent and self.checkWords(agent):
 result[self.info_type] = Storage(name=self.name)
 version = self.getVersion(agent)
+is_mobile = getattr(self, 'is_mobile', False)
 if version:
 result[self.info_type].version = version
+if is_mobile:
+result[self.info_type].is_mobile = is_mobile
 return True
 return False
 
@@ -81,7 +84,7 @@
 for w in self.skip_if_found:
 if w in agent:
 return False
-if self.look_for:
+if self.look_for in agent:
 return True
 return False
 
@@ -234,6 +237,7 @@
 
 class Android(Dist):
 look_for = 'Android'
+is_mobile = True
 
 def getVersion(self, agent):
 return agent.split('Android')[-1].split(';')[0].strip()
@@ -241,6 +245,7 @@
 
 class iPhone(Dist):
 look_for = 'iPhone'
+is_mobile = True
 
 def getVersion(self, agent):
 version_end_chars = ['like', ';', ')']
@@ -253,6 +258,7 @@
 
 class iPad(Dist):
 look_for = 'iPad'
+is_mobile = True
 
 def getVersion(self, agent):
 version_end_chars = ['like', ';', ')']


Re: [web2py] Fragmented packets when accessing from amicrocontroller

2011-08-18 Thread Angelo Compagnucci
Hi Michele,

I think tihis is a rocket problem. The size of the packet (only http
part) is about 400 bytes according to wireshark.
The micro http library in debug prints excactly the size of the http
part and with web2py the count is equal to the http headers without
the data part.

If I try to GET google, I obtain a packet that the micro reads well,
than it truncates the http to the maximum size it can handle, circa
950 bytes.
And it works in such a way for every site I try. I tested it with an
apache static page, the page is read well and if it doesn't fill the
buffer I can manipulate the content without troubles.

The rocket webserver is the one that doesn't work.

I don't know hot to explain bettere the problem, if it could help, I
can send wireshark pcaps.

Thank you!

2011/8/18 Michele Comitini michele.comit...@gmail.com:
 btw you can deploy web2py with many web servers without using rocket.
 you can use any server that supports one among wsgi, uwsgi, scgi, fcgi
 and other old stuff like mod_python or cgi, you can check
 if with one of those configurations you solve the problem.

 mic


 2011/8/18 Michele Comitini michele.comit...@gmail.com:
 Ciao Angelo,

 What size in bytes the packet has?

 Is MTU/MRU of your server correctly configured for that packet size?

 Consider that HTTP headers may well be big enough to break things in a
 small packet.

 ciao,
 mic

 2011/8/18 Angelo Compagnucci angelo.compagnu...@gmail.com:
 Hi list,

 I'm using web2py for a microcontroller project and I'm facing a really
 strange problem.

 This microcontroller (a modified arduino with an enc28j60) can accept
 only one tcp packet a time, because the packet fills the ram and so it
 freezes the micro.
 The pages it can process are to be small and fit in one packet. For a
 microcontroller project, a single packet is sufficient for most use
 cases.

 I have an http library that I tested towards an example hosted by the
 jqplot project (http://www.jqplot.com/tests/jsondata.txt) and it works
 well, I can read the data and I can manipulate the json object.

 I also observed with wireshark that only a single packet is issued in
 reply to my get. There is something like this:

 GET - ACK - HTTP 200 OK

 I procedeed further writing a small controller (the count one found on
 the book) to test the micro with web2py. Boom, it doesn't work!

 I can read only the header of the packet. Further investigation with
 wireshark lead me to think that the rocket webserver fragments the
 response in a way that I can get only the first packet (containing the
 header) and not the second one containg the data (as expected by the
 micro limitations).
 In wireshark I have something like this:

 GET - ACK - TCP segment of a reassembled PDU - HTTP 200 OK

 The packet TCP segment of a reassembled PDU which comes first,
 actually contains only the headers, instead the http 200 one contains
 the complete packet.

 To confirm this, I tested the micro with other webservers (apache,
 IIS, tomcat) and noone shows the undesired behaviour.

 Can you give me an hint?

 Thank you!





Re: [web2py] Re: Fragmented packets when accessing from amicrocontroller

2011-08-18 Thread Angelo Compagnucci
Hi Massimo,

I upgraded to the last trunk revision and the problem persist. I
conduced more test and I think the problem is located in rocket, in
wireshark it behaves differently from the other webservers.

Please let me know if I have to send you pcaps or other informations..

Thank you!

2011/8/18 Massimo Di Pierro massimo.dipie...@gmail.com:
 in trunk we upgraded to the latest rocket is the problem with the
 previous or the current version?

 On Aug 18, 7:39 am, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
 Hi Michele,

 I think tihis is a rocket problem. The size of the packet (only http
 part) is about 400 bytes according to wireshark.
 The micro http library in debug prints excactly the size of the http
 part and with web2py the count is equal to the http headers without
 the data part.

 If I try to GET google, I obtain a packet that the micro reads well,
 than it truncates the http to the maximum size it can handle, circa
 950 bytes.
 And it works in such a way for every site I try. I tested it with an
 apache static page, the page is read well and if it doesn't fill the
 buffer I can manipulate the content without troubles.

 The rocket webserver is the one that doesn't work.

 I don't know hot to explain bettere the problem, if it could help, I
 can send wireshark pcaps.

 Thank you!

 2011/8/18 Michele Comitini michele.comit...@gmail.com:







  btw you can deploy web2py with many web servers without using rocket.
  you can use any server that supports one among wsgi, uwsgi, scgi, fcgi
  and other old stuff like mod_python or cgi, you can check
  if with one of those configurations you solve the problem.

  mic

  2011/8/18 Michele Comitini michele.comit...@gmail.com:
  Ciao Angelo,

  What size in bytes the packet has?

  Is MTU/MRU of your server correctly configured for that packet size?

  Consider that HTTP headers may well be big enough to break things in a
  small packet.

  ciao,
  mic

  2011/8/18 Angelo Compagnucci angelo.compagnu...@gmail.com:
  Hi list,

  I'm using web2py for a microcontroller project and I'm facing a really
  strange problem.

  This microcontroller (a modified arduino with an enc28j60) can accept
  only one tcp packet a time, because the packet fills the ram and so it
  freezes the micro.
  The pages it can process are to be small and fit in one packet. For a
  microcontroller project, a single packet is sufficient for most use
  cases.

  I have an http library that I tested towards an example hosted by the
  jqplot project (http://www.jqplot.com/tests/jsondata.txt) and it works
  well, I can read the data and I can manipulate the json object.

  I also observed with wireshark that only a single packet is issued in
  reply to my get. There is something like this:

  GET - ACK - HTTP 200 OK

  I procedeed further writing a small controller (the count one found on
  the book) to test the micro with web2py. Boom, it doesn't work!

  I can read only the header of the packet. Further investigation with
  wireshark lead me to think that the rocket webserver fragments the
  response in a way that I can get only the first packet (containing the
  header) and not the second one containg the data (as expected by the
  micro limitations).
  In wireshark I have something like this:

  GET - ACK - TCP segment of a reassembled PDU - HTTP 200 OK

  The packet TCP segment of a reassembled PDU which comes first,
  actually contains only the headers, instead the http 200 one contains
  the complete packet.

  To confirm this, I tested the micro with other webservers (apache,
  IIS, tomcat) and noone shows the undesired behaviour.

  Can you give me an hint?

  Thank you!


Re: [web2py] [SOLVED] Call web2py from a microcontroller

2011-08-16 Thread Angelo Compagnucci
You are absolutely right!

I'm aware of the generic view issue, but I've completely forgotten!

Thank you very much for your help!

2011/8/16 Ross Peoples ross.peop...@gmail.com:
 I should probably clarify why this is happening. The line I mentioned
 checks to see if the client is running on the localhost (i.e. the web
 browser running on the same machine as the web2py server). If it is, then
 web2py is authorized to use a generic view to respond to the request if a
 view is not found. However, when accessing the web2py server from another
 machine, web2py will not automatically fallback to generic views because of
 security concerns. You have to authorize web2py to hand out generic views to
 non-localhost clients by modifying the line mentioned previously.
 Hope that helps.


[web2py] CRUD full permission on tables

2011-08-05 Thread Angelo Compagnucci
Hello,

To enforce full CRUD permissions on a table, I have to manually add
read, select, create, update, delete permissions to
auth_permission table or there is a way to assign all permission with
a single shot?

In the same way, if I want a user with super admin rights on all the
tables, I have to add permission for each table manually or there is a
more web2pythonic way??

Thank you!


Re: [web2py] Re: Adding date() and time() to Field object

2011-07-21 Thread Angelo Compagnucci
Thanks Massimo!

2011/7/21 Massimo Di Pierro massimo.dipie...@gmail.com:
 it  would be much easier to just provide a function row.field.asdate()
 or row.field.astime()

How this could be done? Give me an hint and I'll procede by myself!

Thank you!


Re: [web2py] Re: Adding date() and time() to Field object

2011-07-21 Thread Angelo Compagnucci
Sorry for being retarted!

I have this:

db.define_table('test', Field('comment','string'), Field('data','datetime'))

but the function:

def getcommentsbydate():
   rows = db(db.test).select(db.test.data.comment, db.test.data.date())
   return dict(rows=rows)

throws an exception complaining that the date() method does not exist.

How can I exctract the date without traverse the rows object? I dont
want to use a list comprehension or something else because with
thousands of records is painfull slow (I'm thinking of a radius
accounting table ...)!

I think there is nothing in the DAL that translates to a DATE() sql
function, am I wrong?

Thank you for your suggestion!


Re: [web2py] Re: Adding date() and time() to Field object

2011-07-21 Thread Angelo Compagnucci
Thanks Massimo!

So I must traverse the list at least one time. I dont know how much
time is spent in this operation, but I have a very large number of
records, so I'll test this solution.

Thank you!

2011/7/21 Massimo Di Pierro massimo.dipie...@gmail.com:
 No that does not work for the reasons discussed above but this does
 def getcommentsbydate():
     rows = db(db.test).select(db.test.data.comment, db.test.data)
    for row in rows: row.data = row.data.date()
     return dict(rows=rows)

 On Jul 21, 8:06 am, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
 Sorry for being retarted!

 I have this:

 db.define_table('test', Field('comment','string'), Field('data','datetime'))

 but the function:

 def getcommentsbydate():
    rows = db(db.test).select(db.test.data.comment, db.test.data.date())
    return dict(rows=rows)

 throws an exception complaining that the date() method does not exist.

 How can I exctract the date without traverse the rows object? I dont
 want to use a list comprehension or something else because with
 thousands of records is painfull slow (I'm thinking of a radius
 accounting table ...)!

 I think there is nothing in the DAL that translates to a DATE() sql
 function, am I wrong?

 Thank you for your suggestion!


Re: [web2py] Re: Adding date() and time() to Field object

2011-07-21 Thread Angelo Compagnucci
I'll try to explain better.

I have to exctract some statistics from a radius accounting table that
is generally a really big table.

After exctracting tha data, i pass it to jqplot.com via a json service
to be rendered.

For some graphics, I have to exctract a big amount of dates from
accounting timestamps, and I cannot make it every other way. I have to
exctract a list of dates + something else like counts avarages.

I made a test:

@service.json
def test():
from datetime import datetime
tstart = datetime.now()
rows = dbradius(dbradius.radacct).select(dbradius.radacct.AcctStartTime)
for row in rows: row.AcctStartTime = row.AcctStartTime.date()
tstop = datetime.now()
print tstop - tstart
return rows

@service.json
def test1():
from datetime import datetime
tstart = datetime.now()
rows = dbradius.executesql('''SELECT DATE(AcctStartTime) FROM radacct''')
tstop = datetime.now()
print tstop - tstart
return rows

In my test with 6 records, test1 function completes in around 30
secs. The second one in about 15. As you can see the only visible
difference is traversing the list insted of use sql to excract the
dates.
I think that the problem get worse with many more records. I think
it's wasteful use a for cycle to excrtact dates or time when an sql
construct could be better.

Anyway I think I'm stick with the sql version, thank you to all of you
for the help!

Angelo

2011/7/21 Massimo Di Pierro massimo.dipie...@gmail.com:
 You can just call row.data.date() instead of row.data when you need
 the value.


 On Jul 21, 10:49 am, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
 Thanks Massimo!

 So I must traverse the list at least one time. I dont know how much
 time is spent in this operation, but I have a very large number of
 records, so I'll test this solution.

 Thank you!

 2011/7/21 Massimo Di Pierro massimo.dipie...@gmail.com:







  No that does not work for the reasons discussed above but this does
  def getcommentsbydate():
      rows = db(db.test).select(db.test.data.comment, db.test.data)
     for row in rows: row.data = row.data.date()
      return dict(rows=rows)

  On Jul 21, 8:06 am, Angelo Compagnucci angelo.compagnu...@gmail.com
  wrote:
  Sorry for being retarted!

  I have this:

  db.define_table('test', Field('comment','string'), 
  Field('data','datetime'))

  but the function:

  def getcommentsbydate():
     rows = db(db.test).select(db.test.data.comment, db.test.data.date())
     return dict(rows=rows)

  throws an exception complaining that the date() method does not exist.

  How can I exctract the date without traverse the rows object? I dont
  want to use a list comprehension or something else because with
  thousands of records is painfull slow (I'm thinking of a radius
  accounting table ...)!

  I think there is nothing in the DAL that translates to a DATE() sql
  function, am I wrong?

  Thank you for your suggestion!


[web2py] Adding date() and time() to Field object

2011-07-20 Thread Angelo Compagnucci
Hello list members,

sometimes is useful to exctract the date or the time from a Filed
object without traversing the rows returned by a select statement.

I provide an examlpe:

db.define_table('test',Field('data','datetime'))

def getdates():
   rows = db(db.test).select(db.test.data.date())
   return dict(rows=rows)

def gettimes():
   rows = db(db.test).select(db.test.data.time())
   return dict(rows=rows)

This could be usefull in all the cases where yuo have to produce
statistics based on time and dates, think of how many access I had
per day? Or per month?.

An example:

hsname = 'testhotspot'
entry_date = dbradius.radacct.AcctStartTime.year()|
dbradius.radacct.AcctStartTime.month()|
dbradius.radacct.AcctStartTime.day()
rows = dbradius(dbradius.radacct.CalledStationId==hsname).select(
count,
dbradius.radacct.RadAcctStartTime.date,
groupby=entry_date)

Whitout the date method in Field object, I have to traverse the rows
object and produce another rows object with the datetimes swapped by
dates. It's not elegant and really time consuming when you have many
rows. Excracting date or time directly db side is really a fast
operation and it is supported by all major db. I verified this and I
think every database supported by DAL should have these options.

I apologize for being reopening this discussion (I previuosly made
another request on the ml) but Massimo was not here so He can read
this time!

I'm willing to implement this feature if anybody intrested.

I have already added the two methods (date and time) but what I obtain
is a string, not a date or a time object as I'm expecting. Can anyone
help me?

Thank you


Re: [web2py] Re: Get date from datetime with DAL

2011-07-16 Thread Angelo Compagnucci
 that dirty hack fails for the MSSQL adapter in 1.97.1:

Well yes, I called it a dirty hack!

I'm looking for a function to extract date and time from a datetime db
side and I think I found one for every database supported by the DAL,
I'm in the process of review my research.

I'm intrugued in the process to add new date() and time() functions to
Filed class.

 rr=db(db.test).select(db.test.data)
 print rr[0]
 Row {'data': datetime.datetime(2011, 7, 15, 14, 34, 18)}

 rr=db(db.test).select(db.test.data[:10])
 print rr[0]
 Row {'_extra': Row {'SUBSTR(test.data,1,(11 - 1))': u'2011-07-15'}}

Yes, I noticed that, a substring command returns a string, and not a
date object ... But for me it will suffice.

Thank you!


Re: [web2py] Re: Get date from datetime with DAL

2011-07-15 Thread Angelo Compagnucci
Hi Denes,

thank you for your time!

row.data.date() could be the solution to the problem, but it forces me
to traverse the table returned by the query and build another table
with dates instead of datetimes... Not the best solution in speed and
elegance!

I think that a query like the one I made it's really common. I have a
timestamp and I want to count the occurences of a determined event by
date exctracted by the timestamp. I think that excrating the date (or
the time) from a datetime it's really a speedy operation if
accomplished by the database, and should be supported by all major
databases ( I think really all databases!).

By the way I resolved with this quick and dirty hack:

rows = db(db.test).select(db.test.data[:10])

slicing the first 10 character is enough for me!

If anyoune intrested, I'll explore te possibility to add a .date() and
a .time() to FIeld object, or find a way to concatenate .year()
.month() .day()!

Thank you!

2011/7/13 DenesL denes1...@yahoo.ca:
 Hi Angelo,

 sorry, I missed the datetime in the title (duh!).

 The date function belongs to the datetime object so it would be
 available in the rows only, the field does not have it:

 for row in rows:
  print row.data.date()

 Note that the year month day hour minute second functions might not be
 available in all DBs since the SQL implementation varies.

 By the way, the MSSQL adapter has it wrong in 1.94.5, I have to check
 on the newer versions.
 Hmmm... that means I have never came across the need for those
 functions.

 If you are only working with SQLite then adding date() or time() would
 not be hard and they seem like sensible options. Maybe even add them
 to other adapters as well.

 Is the row.data.date() option enough for you?.

 Denes.


 On Jul 12, 5:39 pm, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
 Sorry for being pedantic!

 I made an empty application with only a table in the model defined as:

 db.define_table('test',Field('data','datetime'))

 and inserted some datetimes.

 then I made a method in the controller:

 def getdata():
     rows = db(db.test).select()
     return dict(rows=rows)

 and it works.

 It works also:

 def getdata():
     rows = db(db.test).select(db.test.data.year())
     return dict(rows=rows)

 but if I try:

 def getdata():
     rows = db(db.test).select(db.test.data.date())
     return dict(rows=rows)

 web2py throws an exception with the message:

 File /home/angelo/DEV/web2py/applications/welcome/controllers/default.py,
 line 13, in getdata
     rows = db(db.test.ALL).select(db.test.data.data())
 AttributeError: 'Field' object has no attribute 'date'

 So what's wrong?

 Thank you!

 2011/7/12 pbreit pbreitenb...@gmail.com:







  I believe datetime is a Python datetime.datetime object and gets validated
  by IS_DATETIME().
 http://docs.python.org/library/datetime.html#datetime.datetime
 http://web2py.com/book/default/chapter/07?search=IS_DATETIME


[web2py] Get date from datetime with DAL

2011-07-12 Thread Angelo Compagnucci
Ello everybody!

I'm stuck whith a really simple thing, but the simpler are the worst!

I wrote this query:

rows = dbradius(dbradius.radacct.CalledStationId==hsname).select(
 count,
 dbradius.radacct.AcctStartTime.year(),
 dbradius.radacct.AcctStartTime.month(),
 dbradius.radacct.AcctStartTime.day(),
 groupby=entry_date)

Query works well, but I want a signle field for the date part, not the
three fields (year, month, day) I obtain.

There is a simple way to accomplish this?

Thank you!


Re: [web2py] Re: Get date from datetime with DAL

2011-07-12 Thread Angelo Compagnucci
Thank you Denes,

What I'm trying to do is to select the date part from a datetime as
specified in the email subject, so the AcctStartTime field is a
datetime.

I'm navigating the epydoc documentation for dal.Field
http://www.web2py.com/examples/static/epydoc/web2py.gluon.dal.Field-class.html

and I cannot find reference for the date() method (only
year(),month(), day(), hour(), minutes(), seconds()) . Perhaps the
documentation is out of date.

I made several tries and in one of this I tryed also the date() method
in a query something like this:

rows = dbradius(dbradius.radacct.CalledStationId==hsname).select(
                              count,
                              dbradius.radacct.AcctStartTime.date(),
                              groupby=entry_date)

and it throws an exception. I can really make a mistake, so I'll try
your suggestion as soon as possible!

Thank you.

2011/7/12 DenesL denes1...@yahoo.ca:
 Hi Angelo,

 it depends on the type of field,

 date fields can be accessed directly,
 e.g. dbradius.radacct.AcctStartTime

 datetime fields need .date():
 dbradius.radacct.AcctStartTime.date()

 Denes.

 On Jul 12, 1:58 pm, Angelo Compagnucci angelo.compagnu...@gmail.com
 wrote:
 Ello everybody!

 I'm stuck whith a really simple thing, but the simpler are the worst!

 I wrote this query:

 rows = dbradius(dbradius.radacct.CalledStationId==hsname).select(
                              count,
                              dbradius.radacct.AcctStartTime.year(),
                              dbradius.radacct.AcctStartTime.month(),
                              dbradius.radacct.AcctStartTime.day(),
                              groupby=entry_date)

 Query works well, but I want a signle field for the date part, not the
 three fields (year, month, day) I obtain.

 There is a simple way to accomplish this?

 Thank you!


Re: [web2py] Re: Get date from datetime with DAL

2011-07-12 Thread Angelo Compagnucci
Sorry for being pedantic!

I made an empty application with only a table in the model defined as:

db.define_table('test',Field('data','datetime'))

and inserted some datetimes.

then I made a method in the controller:

def getdata():
rows = db(db.test).select()
return dict(rows=rows)

and it works.

It works also:

def getdata():
rows = db(db.test).select(db.test.data.year())
return dict(rows=rows)

but if I try:

def getdata():
rows = db(db.test).select(db.test.data.date())
return dict(rows=rows)

web2py throws an exception with the message:

File /home/angelo/DEV/web2py/applications/welcome/controllers/default.py,
line 13, in getdata
rows = db(db.test.ALL).select(db.test.data.data())
AttributeError: 'Field' object has no attribute 'date'

So what's wrong?

Thank you!

2011/7/12 pbreit pbreitenb...@gmail.com:
 I believe datetime is a Python datetime.datetime object and gets validated
 by IS_DATETIME().
 http://docs.python.org/library/datetime.html#datetime.datetime
 http://web2py.com/book/default/chapter/07?search=IS_DATETIME



[web2py:36256] Call web page in cron

2009-12-01 Thread Angelo Compagnucci
Hi List!

I have a question about cron!

In a controller, I use request.args[int] to get the current argument,
so I have a link in this form  application/controller/argument .

Can I call or execute this controller with argument? Or the controlle
could be called without arguments?

Is there a way to call a controlle with arguments?

Thanks in advance!

--

You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




  1   2   >