[web2py] append script with no extension

2014-12-24 Thread Manuele Pesenti
Hi!
Is there a way to include this url as a script using
response.files.append method (or something similar)?

script
src=http://maps.google.com/maps/api/js?v=3amp;sensor=false;/script

The problem seams to be that it got no extension so it's not recognized
from the include_files method of the response.

Thanks

Manuele

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

2014-12-24 Thread Tito Garrido
HI Massimo,

It is working on a virtual machine using Ubuntu.. this is the steps that I
have followed:

I have built the image and tagged as web2py1 using:

sudo docker build -t web2py1 .

So an image has been generated called web2py1.

To run in on an exposed port I have ran:

docker run -i -P -t web2py1

I got it running on a random port, like 49153 (it could be changed
using -p 80:80 instead of -P)

The only issue is accessing the admin... seems that the secure
connection is not open...
When I tried https://localhost:49153 it says Secure conection failed

Let me know if you need help with the tests... I will try to figure
out how to enable https.

Regards,

Tito


On Tue, Dec 9, 2014 at 4:20 AM, rif feric...@gmail.com wrote:

 Did you check the Container port redirection section from mac installation
 guide (https://docs.docker.com/installation/mac/)?

 If you run a container with an exposed port,

 $ docker run --rm -i -t -p 80:80 nginx

 then you should be able to access that Nginx server using the IP address
 reported by:

 $ boot2docker ip

 Typically, it is 192.168.59.103:2375, but VirtualBox's DHCP
 implementation might change this address in the future.

 marți, 9 decembrie 2014, 04:29:53 UTC+2, Massimo Di Pierro a scris:

 Could be a firewall. I am using a mac.

 On Sunday, 7 December 2014 10:02:22 UTC-6, rif wrote:

   I tested that before I wrote. Are you sure it's not some firewall or
 something? What OS did you use?

 duminică, 7 decembrie 2014, 17:59:43 UTC+2, Massimo Di Pierro a scris:

 Done that but no response. :-(

 On Saturday, 6 December 2014 11:37:04 UTC-6, rif wrote:

 As far as I can tell the only thing you have to do is to run the
 container like this:

 docker run -p 8080:80 web2py

 and you will be able to connect at http://localhost:8080

 Of course you can change the 8080 to any other port.

 -rif

 vineri, 5 decembrie 2014, 05:11:22 UTC+2, Massimo Di Pierro a scris:

 Has anybody here used docker with web2py? I have built a container
 (docker + web2py + nginx + uwsgi + supervisor) and everything seems to be
 fine (no errors) except that I cannot connect. I attached the docker 
 folder
 in case you can help debug.

 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.




-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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] how to use glyphicon

2014-12-24 Thread mcamel
Hi all,

I've realized web2py uses 'app/static/images/glyphicons-halflings.png' (and 
the white version) in a CSS way.

For example, the edit button on a grid is rendered to something like: 
span class=icon pen icon-pencil glyphicon glyphicon-arrow-pencil/span

I want to use those icons that way, so i'm begging to write things like: 
SPAN(_class=icon ok icon-ok glyphicon glyphicon-ok)

It seems to work also simply with:
SPAN(_class=icon-ok)

or the following if you have black background:
SPAN(_class=icon-white icon-ok)

What are the proper combinations of classes?. Should we write the large 
one, or evry class has its own purpose?.


Just in case it helps, i've wrote this to find quickly a certain icon:

def icons():
classes= ['glass','music','search','envelope','heart','star',
'star-empty','user','film','th-large','th','th-list','ok','remove','zoom-in'
,'zoom-out','off','signal','cog','trash','home','file','time','road',
'download-alt','download','upload','inbox','play-circle','repeat','refresh',
'list-alt','lock','flag','headphones','volume-off','volume-down','volume-up'
,'qrcode','barcode','tag','tags','book','bookmark','print','camera','font',
'bold','italic','text-height','text-width','align-left','align-center',
'align-right','align-justify','list','indent-left','indent-right',
'facetime-video','picture','pencil','map-marker','adjust','tint','edit',
'share','check','move','step-backward','fast-backward','backward','play',
'pause','stop','forward','fast-forward','step-forward','eject',
'chevron-left','chevron-right','plus-sign','minus-sign','remove-sign',
'ok-sign','question-sign','info-sign','screenshot','remove-circle',
'ok-circle','ban-circle','arrow-left','arrow-right','arrow-up','arrow-down',
'share-alt','resize-full','resize-small','plus','minus','asterisk',
'exclamation-sign','gift','leaf','fire','eye-open','eye-close',
'warning-sign','plane','calendar','random','comment','magnet','chevron-up',
'chevron-down','retweet','shopping-cart','folder-close','folder-open',
'resize-vertical','resize-horizontal','hdd','bullhorn','bell','certificate',
'thumbs-up','thumbs-down','hand-right','hand-left','hand-up','hand-down',
'circle-arrow-right','circle-arrow-left','circle-arrow-up',
'circle-arrow-down','globe','wrench','tasks','filter','briefcase',
'fullscreen']

icon   = icon %(c)s icon-%(c)s glyphicon glyphicon-%(c)s
icon_white = icon-white %(c)s icon-%(c)s glyphicon glyphicon-%(c)s

trs= [TR(TD(SPAN(_class=icon % locals(), _style=
'background-color:white'), 
SPAN(_class=icon_white % locals(), _style=
'background-color:black'), 
SPAN(' %(c)s' % locals(), _style=
'background-color:white'))) for c in classes]

return dict(html=TABLE(trs))

Regards! 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: append script with no extension

2014-12-24 Thread Leonel Câmara
Not really response.files is for local files. I just add that script tag to 
my layout.html.

-- 
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] append script with no extension

2014-12-24 Thread Massimiliano
Maybe using a block in the head of template?

On Wed, Dec 24, 2014 at 10:54 AM, Manuele Pesenti manuele.pese...@gmail.com
 wrote:

  Hi!
 Is there a way to include this url as a script using response.files.append
 method (or something similar)?

 script src=http://maps.google.com/maps/api/js?v=3amp;sensor=false;
 http://maps.google.com/maps/api/js?v=3amp;sensor=false/script

 The problem seams to be that it got no extension so it's not recognized
 from the include_files method of the response.

 Thanks

 Manuele

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




-- 
Massimiliano

-- 
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] Hello World!

2014-12-24 Thread Gyanendra Mishra
I just wanted to say hi to the community.
Hi!
The framework looks magical currently and I want to reduce that magic.I 
don't feel that I am in control of the framework.
I just started learning and building apps with web2py.I have some 
competitive programming experience and I have built a few apps using java.
I recently started building some scrapers.

-- 
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: reddit clone - foreign key constraint failed

2014-12-24 Thread Chris Simpson
Hi William,

Thanks for the information!

Regards,




2014-12-23 8:33 GMT+00:00 William Chen williamch...@gmail.com:

 Hi Chris, I had the same problem and found this thread when I was
 searching for a solution.

 The solution is to simply create 1 or more comments using app admin.

 If table B references table A, then you need populate to populate table A
 before you populate table B, else there will be an error. In our case, the
 table comm references to itself in this line:
 Field('parent_comm', 'reference comm')

 So we need to manually add new comments, before we populate the table
 comm.

 Hope this helps.


 On Wednesday, 28 May 2014 23:05:06 UTC+8, Chris Simpson wrote:


 Hi Uri,

 Did you ever find a solution to this?
 On Wednesday, May 14, 2014 12:01:29 PM UTC+2, Uri Tamir wrote:

 Hi all,
 I've been following Massimo's video tutorials
 http://vimeo.com/76047107 (which are *great!* thanks Massimo)

 when trying to build the reddit clone and populate it i get a ticket
 - class 'sqlite3.IntegrityError' foreign key constraint failed

 the database was populated with users and posts but not with comments. I
 tried to make sure my code is exactly as the code Massimo showed but /w no
 success.

 any suggestions?

 db.define_table('category',
 Field('name', requires = (IS_SLUG(), IS_LOWER(),
 IS_NOT_IN_DB(db, 'category.name'

 db.define_table('post',
 Field('category', 'reference category', readable=False,
 writable=False),
 Field('title', 'string', requires=IS_NOT_EMPTY()),
 Field('url', requires=IS_EMPTY_OR(IS_URL())),
 Field('body', 'text', requires=IS_NOT_EMPTY()),
 Field('votes', 'integer', default=0, readable=False,
 writable=False),
 auth.signature) # created_on, created_by, modified_on,
 modified_by, is_active

 db.define_table('post_vote',
 Field('post', 'reference post'),
 Field('score', 'integer', default=+1), # numerical
 representation of votes
 auth.signature)

 db.define_table('comm',
 Field('post', 'reference post'),
 Field('parent_comm', 'reference comm'),
 Field('votes', 'integer'),
 Field('body', 'text'),
 auth.signature)

 db.define_table('comm_vote',
 Field('comm', 'reference comm'),
 Field('score', 'integer', default=+1), # numerical
 representation of votes
 auth.signature)

 from gluon.contrib.populate import populate
 if db(db.auth_user).count()2:
 populate(db.auth_user, 100)
 db.commit()
 if db(db.post).count()2:
 populate(db.post, 500)
 db.commit()
 if db(db.comm).count()2:
 populate(db.comm, 1000)
 db.commit()


  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/9L1Ycuw7ZPo/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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] caching model data

2014-12-24 Thread harsha tanguturi
I would like to cache the model data i.e., caching the selects and update 
the cache whenever the data is updated. Putting simply a caching layer has 
to present before the database layer and any changes to the database should 
be reflected in cache too.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to use glyphicon

2014-12-24 Thread Massimo Di Pierro
:-)

On Wednesday, 24 December 2014 07:04:48 UTC-6, mcamel wrote:

 Hi all,

 I've realized web2py uses 'app/static/images/glyphicons-halflings.png' 
 (and the white version) in a CSS way.

 For example, the edit button on a grid is rendered to something like: 
 span class=icon pen icon-pencil glyphicon glyphicon-arrow-pencil
 /span

 I want to use those icons that way, so i'm begging to write things like: 
 SPAN(_class=icon ok icon-ok glyphicon glyphicon-ok)

 It seems to work also simply with:
 SPAN(_class=icon-ok)

 or the following if you have black background:
 SPAN(_class=icon-white icon-ok)

 What are the proper combinations of classes?. Should we write the large 
 one, or evry class has its own purpose?.


 Just in case it helps, i've wrote this to find quickly a certain icon:

 def icons():
 classes= ['glass','music','search','envelope','heart','star',
 'star-empty','user','film','th-large','th','th-list','ok','remove',
 'zoom-in','zoom-out','off','signal','cog','trash','home','file','time',
 'road','download-alt','download','upload','inbox','play-circle','repeat',
 'refresh','list-alt','lock','flag','headphones','volume-off','volume-down'
 ,'volume-up','qrcode','barcode','tag','tags','book','bookmark','print',
 'camera','font','bold','italic','text-height','text-width','align-left',
 'align-center','align-right','align-justify','list','indent-left',
 'indent-right','facetime-video','picture','pencil','map-marker','adjust',
 'tint','edit','share','check','move','step-backward','fast-backward',
 'backward','play','pause','stop','forward','fast-forward','step-forward',
 'eject','chevron-left','chevron-right','plus-sign','minus-sign',
 'remove-sign','ok-sign','question-sign','info-sign','screenshot',
 'remove-circle','ok-circle','ban-circle','arrow-left','arrow-right',
 'arrow-up','arrow-down','share-alt','resize-full','resize-small','plus',
 'minus','asterisk','exclamation-sign','gift','leaf','fire','eye-open',
 'eye-close','warning-sign','plane','calendar','random','comment','magnet',
 'chevron-up','chevron-down','retweet','shopping-cart','folder-close',
 'folder-open','resize-vertical','resize-horizontal','hdd','bullhorn',
 'bell','certificate','thumbs-up','thumbs-down','hand-right','hand-left',
 'hand-up','hand-down','circle-arrow-right','circle-arrow-left',
 'circle-arrow-up','circle-arrow-down','globe','wrench','tasks','filter',
 'briefcase','fullscreen']
 
 icon   = icon %(c)s icon-%(c)s glyphicon glyphicon-%(c)s
 icon_white = icon-white %(c)s icon-%(c)s glyphicon glyphicon-%(c)s
 
 trs= [TR(TD(SPAN(_class=icon % locals(), _style=
 'background-color:white'), 
 SPAN(_class=icon_white % locals(), _style=
 'background-color:black'), 
 SPAN(' %(c)s' % locals(), _style=
 'background-color:white'))) for c in classes]
 
 return dict(html=TABLE(trs))

 Regards! 


-- 
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: append script with no extension

2014-12-24 Thread Manuele Pesenti
Il 24/12/14 14:22, Leonel Câmara ha scritto:
 Not really response.files is for local files. I just add that script
 tag to my layout.html.
Thank you Leonel and Massimiliano,
that's what I've done... but I wanted to load this script only where needed.

No way to do it programmatically?

M.

-- 
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] happy holidays everybody

2014-12-24 Thread Massimo Di Pierro
I wish a happy holidays to everybody in this community.

As a Christmas present and mostly the work of Giovanni Barillari we have 
re-released the web2py DAL as a separate Python package under the BSD 
license:

https://pypi.python.org/pypi/pyDAL
https://github.com/web2py/pydal

Now you can more easily use the web2py DAL from any python app. Simply do

pip install pyDAL

 from pydal import DAL, Field
 db = DAL('sqlite://storage.db')
 db.define_table('thing',Field('name'))
 db.thing.insert(name=Chair')

you know the rest... ;-)

Massimo



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Hello World!

2014-12-24 Thread Massimo Di Pierro
Feel free to ask questions. It is magical but not as much as it may seem. 

On Wednesday, 24 December 2014 03:55:46 UTC-6, Gyanendra Mishra wrote:

 I just wanted to say hi to the community.
 Hi!
 The framework looks magical currently and I want to reduce that magic.I 
 don't feel that I am in control of the framework.
 I just started learning and building apps with web2py.I have some 
 competitive programming experience and I have built a few apps using java.
 I recently started building some scrapers.


-- 
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] adding html to SQLform.grid

2014-12-24 Thread Yebach
Hello

Is it possible to add html (span) to SQLFORM.grid. I have a color picker 
widget and it works ok but it colors the whole field. I would like to add a 
new html tag inside a table where color picker would be presentet. It is 
possible to do this inside web2py or do I have to write JS code.

Also in my view grid I would like to have a field where color would be 
presented. Again. Is it possible to add html inside web2py or is JS or 
JQuery code needed?

thank you

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: adding html to SQLform.grid

2014-12-24 Thread mcamel
Hi,

You can do DOM parsing at web2y level with something like:

grid = SQLFORM.grid(...)
table = grid.element(table) # or grid[1][0]
table.insert(0, TR(LABEL('label1:'), INPUT(_name='_myname', _type=
'text', )))

0 for the first, -1 for the last...

More at 
http://www.web2py.com/books/default/chapter/29/05/the-views#Server-side-DOM-and-parsing

Regards.


El miércoles, 24 de diciembre de 2014 14:57:12 UTC+1, Yebach escribió:

 Hello

 Is it possible to add html (span) to SQLFORM.grid. I have a color picker 
 widget and it works ok but it colors the whole field. I would like to add a 
 new html tag inside a table where color picker would be presentet. It is 
 possible to do this inside web2py or do I have to write JS code.

 Also in my view grid I would like to have a field where color would be 
 presented. Again. Is it possible to add html inside web2py or is JS or 
 JQuery code needed?

 thank you



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: datetime smart query

2014-12-24 Thread mcamel
Iso format like:
day_and_time = 2000-01-01 00:00:00

Must be ISO and UTC regardless you are using (and seeing) localized format 
and/or timezone (at least just now). Related question: 
https://groups.google.com/forum/?fromgroups=#!topic/web2py/fDP4mrIFdXg

Regards.


El martes, 20 de mayo de 2014 00:08:32 UTC+2, Manuele escribió:

 Hi, 
 can somebody help me to build up smart queries that involve datetime 
 fields? 
 How format I have to use for the datetime I want use as comparison value? 

 than you very mutch 
 cheers 

 Manuele 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Daily task on production: scheduler or cron?

2014-12-24 Thread Lisandro
Thank you very much Tim, excelent info. I will use web2py's Scheduler, 
because it will be easy to write some code and let the user change the 
configuration from the webapp. 

However, I have one last concern about system resources on production.
As I'm going to use this in production, my webapp will be installed 
multiple times (that is, multiple virtual hosts, each one running an 
instance of web2py). Therefor, accordingly to the documentation, I will 
have to run the scheduler as a linux service 
(http://web2py.com/books/default/chapter/29/13/deployment-recipes#Start-the-scheduler-as-a-Linux-service--upstart-).
 
In my case, I will be running a service for each instance of web2py 
running, but as I said, each scheduler will correspond to the sending of a 
daily newsletter, that is, each scheduler will execute only one task per 
day. Therefor my doubt: ¿does the scheduler consume much resources being 
idle waiting for tasks to be queued?

In the other hand, after reading web2py's scheduler documentation, I found 
out that, if I want to schedule a task that runs every day at a certain 
time, I would have to queue the task in this way:

scheduler.queue_task(
send_newsletter, # the function that sends the newsletter
start_time=first_execution,  # first_execution would be, for example, 
tomorrow at 8am
period=86400,# one day, expressed in seconds
repeats = 0  # unlimited repeats
)

Is that ok? If I do it this way, should I increase the heartbeat to 60 
seconds or more? That is, taking into account that the scheduler will only 
have to run one task per day.


El martes, 23 de diciembre de 2014 17:07:28 UTC-3, Tim Richardson escribió:

 I use the scheduler for activities that run daily to some that run every 
 15 minutes. 
 It doesn't do day-of-the-week yet so you would need to check for that in 
 your daily code. I for example have an app which sends SMS every hour, but 
 the task checks that it is in office hours before doing any work. 
 The scheduler is a good tool, and once you've learnt it, you have a 
 cross-platform tool at your disposal. It's easy to manipulate in web2py 
 since there is an API (which basically updates records; this will make it 
 easy to meet your requirement that the user chooses when to start the 
 task). It has a simple logging approach (output is saved in tables) and it 
 scales to multiple workers easily.

 I think the references to cron must die refer to a web2py deprecated 
 feature unfortunately named cron; don't confuse it with the system cron 
 built in your server OS. 
 Therefore you may decide to use cron. In which case...
 You can run web2py scripts in the context of your application using the 
 web2py command line 
 python web2py -S {app} -R {path_prefix}/mymodule.py 
 (see documentation in the book; the -S option needs to be used as well). 

 You could for example put your code in a module, and have code in the 
 global context (if __name__ == __main__ ...) which will be run when you 
 execute the command line. 








 On Wednesday, 24 December 2014 01:18:09 UTC+11, Lisandro wrote:

 I've been reading about web2py's cron and sheduler ([1] and [2])
 Also, I've read a post where Massimo says Please use the scheduler, not 
 cron. Cron must die. [3]

 Now I'm creating a web2py app and I want the user to be able to configure 
 a daily background task. The task consist in sending a newsletter to 
 subscribers. The task doesn't take too much time to complete (because the 
 app doesn't use smpt; it connects to an API so the sending is handled by an 
 external service). So the task only makes some query to the database, 
 connect to the API, give the order to send, and disconnect.
 The thing is: I want the user to be able to configure the time that the 
 newsletter is sent. For example, the user may configure the sending of the 
 newsletter from monday to friday at 8am, but not saturdays o sundays. 

 In this scenario, I first thought that cron would be the way to go. 
 However I read that Massimo's comment (cron must die) so I don't know 
 what to use. 
 I find that scheduler is very complete and robust, but I don't know if 
 it's the best option for this case, considering that the task runs in very 
 little time and only once a day. I'm worried about resource consumption, 
 because the same app is installed multiple times on production, serving 
 multiple websites, so there would be multiple workers running on background 
 (maybe idle workers, however they would take some memory space I guess).

 Any tip or comments? Does anyone dealed with something similar? I want to 
 remark the idea that the user must be able to change configuration about 
 the scheduled task.
 Thanks in advance!

 [1]  
 http://web2py.com/books/default/chapter/29/04/the-core#Running-tasks-in-the-background
 [2]  
 http://web2py.com/books/default/chapter/29/13/deployment-recipes#Start-the-scheduler-as-a-Linux-service--upstart-
 [3]  
 

[web2py] Upgrade issues with 2.9.11

2014-12-24 Thread DJ
Hello,

I wanted to share an issue that has come up after upgrading to 2.9.11 on 
CentOS.6.6/Apache.

a) First the existing applications broke after the upgrade
b) Admin interface would not load up properly (no icons and unable to login)

In the served html pages, an additional folder _2.9.11 is added which does 
not exist: link href=/admin/static/_2.9.11/css/bootstrap.min.css . Is 
this coming from some rewrite directives? Your inputs would be much 
appreciated. 

Thanks,
Sebastian



The wsgi.web2py.conf file settings are as follows -

WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py

Location /
  Order deny,allow
  Allow from all
  WSGIProcessGroup web2py
/Location

   Directory /opt/web-apps/web2py
 AllowOverride None
 Order Allow,Deny
 Deny from all
 Files wsgihandler.py
   Allow from all
 /Files
   /Directory

AliasMatch ^/([^/]+)/static/(.*) 
/opt/web-apps/web2py/applications/$1/static/$2



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: happy holidays everybody

2014-12-24 Thread DJ
Congrats Massimo and happy holidays!

On Wednesday, December 24, 2014 8:48:18 AM UTC-5, Massimo Di Pierro wrote:

 I wish a happy holidays to everybody in this community.

 As a Christmas present and mostly the work of Giovanni Barillari we have 
 re-released the web2py DAL as a separate Python package under the BSD 
 license:

 https://pypi.python.org/pypi/pyDAL
 https://github.com/web2py/pydal

 Now you can more easily use the web2py DAL from any python app. Simply do

 pip install pyDAL

  from pydal import DAL, Field
  db = DAL('sqlite://storage.db')
  db.define_table('thing',Field('name'))
  db.thing.insert(name=Chair')

 you know the rest... ;-)

 Massimo





-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: happy holidays everybody

2014-12-24 Thread Jim S
Massimo

Seems to be an issue trying to install using pip install.  

Getting the following trying to install:

Downloading/unpacking pyDAL
  Could not find any downloads that satisfy the requirement pyDAL
Cleaning up...
No distributions at all found for pyDAL


-Jim


On Wednesday, December 24, 2014 7:48:18 AM UTC-6, Massimo Di Pierro wrote:

 I wish a happy holidays to everybody in this community.

 As a Christmas present and mostly the work of Giovanni Barillari we have 
 re-released the web2py DAL as a separate Python package under the BSD 
 license:

 https://pypi.python.org/pypi/pyDAL
 https://github.com/web2py/pydal

 Now you can more easily use the web2py DAL from any python app. Simply do

 pip install pyDAL

  from pydal import DAL, Field
  db = DAL('sqlite://storage.db')
  db.define_table('thing',Field('name'))
  db.thing.insert(name=Chair')

 you know the rest... ;-)

 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.


Re: [web2py] Re: happy holidays everybody

2014-12-24 Thread 'FERNANDO VILLARROEL' via web2py-users
pyDAL +10

I wish you merry christmas and happy new year Massimo and everybody of this 
community.
Fernando 

 On Wednesday, December 24, 2014 12:48 PM, DJ sebastianjaya...@gmail.com 
wrote:
   

 Congrats Massimo and happy holidays!

On Wednesday, December 24, 2014 8:48:18 AM UTC-5, Massimo Di Pierro wrote:
I wish a happy holidays to everybody in this community.
As a Christmas present and mostly the work of Giovanni Barillari we have 
re-released the web2py DAL as a separate Python package under the BSD license:
https://pypi.python.org/pypi/ pyDAL
https://github.com/web2py/ pydal

Now you can more easily use the web2py DAL from any python app. Simply do
pip install pyDAL from pydal import DAL, Field
 db = DAL('sqlite://storage.db')
 db.define_table('thing',Field( 'name'))
 db.thing.insert(name=Chair')you know the rest... ;-)
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.




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: happy holidays everybody

2014-12-24 Thread Leonel Câmara
 Happy holidays everyone!

Great job on the DAL!

-- 
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: happy holidays everybody

2014-12-24 Thread Tito Garrido
*Happy holidays! Awesome gift!*

On Wed, Dec 24, 2014 at 2:39 PM, Leonel Câmara leonelcam...@gmail.com
wrote:

  Happy holidays everyone!

 Great job on the DAL!

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




-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Upgrade issues with 2.9.11

2014-12-24 Thread Niphlod
since 2.1.0 (almost an year ago) we have static asset management (you can 
read about it here 
http://web2py.com/books/default/chapter/29/04/the-core?search=static_version#Static-asset-management)
 
. you need to alter your 

AliasMatch ^/([^/]+)/static/(.*) 
/opt/web-apps/web2py/applications/$1/static/$2

directive to

AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
/opt/web-apps/web2py/applications/$1/static/$2


On Wednesday, December 24, 2014 4:43:35 PM UTC+1, DJ wrote:

 Hello,

 I wanted to share an issue that has come up after upgrading to 2.9.11 on 
 CentOS.6.6/Apache.

 a) First the existing applications broke after the upgrade
 b) Admin interface would not load up properly (no icons and unable to 
 login)

 In the served html pages, an additional folder _2.9.11 is added which does 
 not exist: link href=/admin/static/_2.9.11/css/bootstrap.min.css . Is 
 this coming from some rewrite directives? Your inputs would be much 
 appreciated. 

 Thanks,
 Sebastian

 

 The wsgi.web2py.conf file settings are as follows -

 WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py

 Location /
   Order deny,allow
   Allow from all
   WSGIProcessGroup web2py
 /Location

Directory /opt/web-apps/web2py
  AllowOverride None
  Order Allow,Deny
  Deny from all
  Files wsgihandler.py
Allow from all
  /Files
/Directory

 AliasMatch ^/([^/]+)/static/(.*) 
 /opt/web-apps/web2py/applications/$1/static/$2





-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Daily task on production: scheduler or cron?

2014-12-24 Thread Niphlod
a)
Some people never consider this as a possibility, but if you have 3 apps, 
e.g. app1, app2 and app3, you can run one scheduler for all applications. 
The default mode is built to process by default tasks coming from the 
same app that queues them, but the switch is still there: 
application_name... The only thing to make sure would be to queue tasks 
with the explicit application_name='.', e.g. 
mysched.queue_task(thefunction, , application_name='app1') . In that 
way you can even queue a task defined in app2 from app1. If instead your 
defined tasks in app1 are queued only within app1, the explicit 
application_name is not needed.
 
Of course, the database used by the scheduler would have to be the same, 
and once it's the same, no matter what appname you pass to the -K 
parameter...it will process any task queued in there (i.e. from ALL apps) 
without issues.

b)
If you don't care about leaving the possibility up to the users to receive 
those notification at ultra-fine-grained times, e.g. 2:37AM, but only e.g. 
at 00:00, 00:30, 01:00 (every half hour) and so on, you can avoid having 
the scheduler always active you can istantiate it with

mysched = Scheduler(dbsched, max_empty_runs=10)

and start the scheduler with

web2py.py -K app1

every half hour.

A worker will then fired up, will process all queued tasks and then it be 
terminated automatically after 10 empty loops, i.e. 10 rounds where no 
new tasks are found. 
I use a lot this pattern for e.g., a high number of tasks that needs to 
be processed before arriving at the office, at 6:00am. 
The usecase is pretty much leave all the raw data coming in during the 
day, aggregate and do some report on it at fixed intervals. in my 
case, I know that during the day tasks gets queued, but I only need to run 
them (aggregation and reporting) by 7:00am on the next morning, so I just 
start the scheduler at 6:00am, let it process all the backlog and then die 
gracefully when there's no work to do.  

c) 
to have the task execute on the exact same time every day, you're 
encouraged to pass also the prevent_drift parameter set to True. This is 
explained in the book... quote:

*Default behavior: The time period is not calculated between the END of the 
first round and the START of the next, but from the START time of the first 
round to the START time of the next cycle). This can cause accumulating 
'drift' in the start time of a job. After v 2.8.2, a new parameter 
prevent_drift was added, defaulting to False. If set to True when queing a 
task, the start_time parameter will take precedence over the period, 
preventing drift*




-- 
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: append script with no extension

2014-12-24 Thread Niphlod



 No way to do it programmatically? 

 unless you code something of your own, from that url (or any other without 
extension) web2py can't figure out what type of script to generate. 

on a totally (un)related note, this seems to work fine 
http://maps.google.com/maps/api/js?v=3sensor=falsesomething=hahaha.js ;-P 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: caching model data

2014-12-24 Thread Niphlod
so, what's the issue you're facing ?

On Wednesday, December 24, 2014 12:29:24 PM UTC+1, harsha tanguturi wrote:

 I would like to cache the model data i.e., caching the selects and update 
 the cache whenever the data is updated. Putting simply a caching layer has 
 to present before the database layer and any changes to the database should 
 be reflected in cache too.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: unescaped HTML code in wiki page

2014-12-24 Thread Niphlod


 How can avoid this? What I'm missing from the documentation? 


the render parameter ?! 

-- 
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: Domain model and web2py DAL

2014-12-24 Thread Alan Evangelista


On Tuesday, December 23, 2014 1:16:52 PM UTC-2, Alan Evangelista wrote:


 It might be easier if you provide a concrete example of what you are 
 trying to achieve (perhaps using the syntax of an existing ORM or using 
 pseudo-code) and explain how the DAL falls short.


 Using SQLAlchemy as data mapper below.


Just noticed there are some small flaws in the implementation code I posted 
(eg some variables names in object and mapper do not match) because I cut 
and paste and adapted this, sorry. Anyway, I think it is quite possible to 
now understand what I meant before.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: happy holidays everybody

2014-12-24 Thread Richard D
To all web2py users and developers,

Merry X-mas and a happy New Year.

Richard D

On Wednesday, December 24, 2014 2:48:18 PM UTC+1, Massimo Di Pierro wrote:

 I wish a happy holidays to everybody in this community.

 As a Christmas present and mostly the work of Giovanni Barillari we have 
 re-released the web2py DAL as a separate Python package under the BSD 
 license:

 https://pypi.python.org/pypi/pyDAL
 https://github.com/web2py/pydal

 Now you can more easily use the web2py DAL from any python app. Simply do

 pip install pyDAL

  from pydal import DAL, Field
  db = DAL('sqlite://storage.db')
  db.define_table('thing',Field('name'))
  db.thing.insert(name=Chair')

 you know the rest... ;-)

 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.


Re: [web2py] Re: unescaped HTML code in wiki page

2014-12-24 Thread Manuele Pesenti
Il 24/12/14 19:13, Niphlod ha scritto:

 How can avoid this? What I'm missing from the documentation?


 the render parameter ?!
the render parameter is fixed to HTML but I've tryed 'html' with the
same result...

This is my controller:

def wiki(): return auth.wiki(render=HTML)

and this is the view:

{{extend 'layout.html'}}
{{=content}}

thanks

M.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Upgrade issues with 2.9.11

2014-12-24 Thread DJ
Thank you so much for that quick answer. This is why I love the web2py 
community!!

On Wednesday, December 24, 2014 12:41:51 PM UTC-5, Niphlod wrote:

 since 2.1.0 (almost an year ago) we have static asset management (you can 
 read about it here 
 http://web2py.com/books/default/chapter/29/04/the-core?search=static_version#Static-asset-management)
  
 . you need to alter your 

 AliasMatch ^/([^/]+)/static/(.*) 
 /opt/web-apps/web2py/applications/$1/static/$2

 directive to

 AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
 /opt/web-apps/web2py/applications/$1/static/$2


 On Wednesday, December 24, 2014 4:43:35 PM UTC+1, DJ wrote:

 Hello,

 I wanted to share an issue that has come up after upgrading to 2.9.11 on 
 CentOS.6.6/Apache.

 a) First the existing applications broke after the upgrade
 b) Admin interface would not load up properly (no icons and unable to 
 login)

 In the served html pages, an additional folder _2.9.11 is added which 
 does not exist: link href=/admin/static/_2.9.11/css/bootstrap.min.css . 
 Is this coming from some rewrite directives? Your inputs would be much 
 appreciated. 

 Thanks,
 Sebastian

 

 The wsgi.web2py.conf file settings are as follows -

 WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py

 Location /
   Order deny,allow
   Allow from all
   WSGIProcessGroup web2py
 /Location

Directory /opt/web-apps/web2py
  AllowOverride None
  Order Allow,Deny
  Deny from all
  Files wsgihandler.py
Allow from all
  /Files
/Directory

 AliasMatch ^/([^/]+)/static/(.*) 
 /opt/web-apps/web2py/applications/$1/static/$2





-- 
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: happy holidays everybody

2014-12-24 Thread Michele Comitini
+1
Merry X-mas and a DAL dominated 2015!

2014-12-24 20:45 GMT+01:00 Richard D richard.dijks...@planet.nl:

 To all web2py users and developers,

 Merry X-mas and a happy New Year.

 Richard D


 On Wednesday, December 24, 2014 2:48:18 PM UTC+1, Massimo Di Pierro wrote:

 I wish a happy holidays to everybody in this community.

 As a Christmas present and mostly the work of Giovanni Barillari we have
 re-released the web2py DAL as a separate Python package under the BSD
 license:

 https://pypi.python.org/pypi/pyDAL
 https://github.com/web2py/pydal

 Now you can more easily use the web2py DAL from any python app. Simply do

 pip install pyDAL

  from pydal import DAL, Field
  db = DAL('sqlite://storage.db')
  db.define_table('thing',Field('name'))
  db.thing.insert(name=Chair')

 you know the rest... ;-)

 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.


-- 
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: Domain model and web2py DAL

2014-12-24 Thread Michele Comitini
In DAL it can be done like one single command:
db.define_table('my_items',
 Field('name', 'string', length=100),
 Field('description', 'string', length=400),
 Field('priority', 'integer'),
 Field('creator_id', 'reference user'),
 Field('dept_id', 'reference department'),
)

Persistence layer, being a common pattern, is already included with a sane
implementation, in the true spirit of python.
You can find the gory details (cascade, unique, not null and so on) in the
web2py book.

2014-12-24 20:08 GMT+01:00 Alan Evangelista alan.vi...@gmail.com:



 On Tuesday, December 23, 2014 1:16:52 PM UTC-2, Alan Evangelista wrote:


 It might be easier if you provide a concrete example of what you are
 trying to achieve (perhaps using the syntax of an existing ORM or using
 pseudo-code) and explain how the DAL falls short.


 Using SQLAlchemy as data mapper below.


 Just noticed there are some small flaws in the implementation code I
 posted (eg some variables names in object and mapper do not match) because
 I cut and paste and adapted this, sorry. Anyway, I think it is quite
 possible to now understand what I meant before.

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


-- 
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: sublime text 3

2014-12-24 Thread al ex
I use Sublime Text 3 and installed

Pakage Manager, SublimeLinter and Pylint as indicated in

http://www.sublimelinter.com/en/latest/installation.html

Then, in Sublime Text | Preferences | Package Settings | SublimeLinter |
Settings - User

I have set linters / pylint / paths as follows

{
user: {
...

linters: {
pylint: {
...

paths: [
/path/to/web2py,
/path/to/web2py/applications/app/modules
],

...
}
...


At the beginning of my .py files I add something like:

# -*- coding: utf-8 -*-

if 0:
from gluon import response, T, ...


And this makes the syntax checker find the modules he needs for the class
and methods definitions.

Hope this helps.

On Wed, Jul 9, 2014 at 7:26 PM, eric cuver amihaconsult...@gmail.com
wrote:

 i add folder gluon in package directory et user directory with
 include  if 0: from gluon import * but doesnt work

 Le mercredi 9 juillet 2014 18:24:28 UTC+2, JorgeH a écrit :

 Thanks for the tip

 And yet...

 Could you post a fool-proof example?

 Thanks

 On Wednesday, July 9, 2014 10:31:36 AM UTC-5, Massimo Di Pierro wrote:

 I do know sublime text. I am assuming there is a way to tell it where to
 look for python modules for autocomplete.

 On Wednesday, 9 July 2014 10:06:25 UTC-5, JorgeH wrote:

 You mean in the OS dir path??

 On Wednesday, July 9, 2014 7:13:46 AM UTC-5, Massimo Di Pierro wrote:

 If your problem is the lack of autocompletion try add gluon to path
 and include if 0: from gluon import * on your files. Everything else
 should work out of the box.

 On Wednesday, 9 July 2014 04:29:49 UTC-5, eric cuver wrote:

 hello,

 how can we do to configure sublime text 3 to work 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.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: happy holidays everybody

2014-12-24 Thread samuel bonill
The links on https://pypi.python.org/pypi/pyDAL are brokens


El miércoles, 24 de diciembre de 2014 08:48:18 UTC-5, Massimo Di Pierro 
escribió:

 I wish a happy holidays to everybody in this community.

 As a Christmas present and mostly the work of Giovanni Barillari we have 
 re-released the web2py DAL as a separate Python package under the BSD 
 license:

 https://pypi.python.org/pypi/pyDAL
 https://github.com/web2py/pydal

 Now you can more easily use the web2py DAL from any python app. Simply do

 pip install pyDAL

  from pydal import DAL, Field
  db = DAL('sqlite://storage.db')
  db.define_table('thing',Field('name'))
  db.thing.insert(name=Chair')

 you know the rest... ;-)

 Massimo





-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: happy holidays everybody

2014-12-24 Thread Vladimir Makarov
I wish you merry Christmas and happy New Year Massimo and everybody of this 
community.
Web2py changed my mind and now all my projects are lovengly built with 
web2py!
Thank you...


On Wednesday, December 24, 2014 4:48:18 PM UTC+3, Massimo Di Pierro wrote:

 I wish a happy holidays to everybody in this community.

 As a Christmas present and mostly the work of Giovanni Barillari we have 
 re-released the web2py DAL as a separate Python package under the BSD 
 license:

 https://pypi.python.org/pypi/pyDAL
 https://github.com/web2py/pydal

 Now you can more easily use the web2py DAL from any python app. Simply do

 pip install pyDAL

  from pydal import DAL, Field
  db = DAL('sqlite://storage.db')
  db.define_table('thing',Field('name'))
  db.thing.insert(name=Chair')

 you know the rest... ;-)

 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.