[web2py] Re: optimising isempty()

2014-05-19 Thread Massimo Di Pierro
Yes. try... except... should not contain database queries because if the db 
raises an exception you cannot ignore it, you need to rollback.

On Monday, 19 May 2014 02:45:13 UTC-5, at...@xouom.com wrote:
>
> Hi
>
> I would like to propose the following edit to isempty() in gluon.dal as I 
> believe this would improve performance particularly for tables with 
> numerous fields:
>
>
> def isempty(self):
> try: 
> return not self.select('id', limitby=(0, 1),orderby_on_limitby
> =False) 
> except: 
> return not self.select(limit=(0, 1), orderby_on_limitby=False)
>
>
> Are there any drawbacks?
>
>
> Tan
>
>
>

-- 
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: pymongo is installed but I get this error: no driver available ('pymongo',)

2014-05-19 Thread Massimo Di Pierro
If you open a python shell can you do

>>> import pymongo

does it work? If python can find it web2py can find it, unless you have two 
python versions installed.


On Sunday, 18 May 2014 12:58:22 UTC-5, Cynthia Butler wrote:
>
> By the way I tried installing pymongo two ways: 
>
> 1) easy_install which put the pymongo .so files in my home/cindy/ folder 
> which I assumed web2py couldn't find (since web2py is in home/www-data/ ). 
> So I uninstalled that.
>
> 2) sudo pip   which put all the unzipped pymongo files in the 
> /usr/local/lib/python2.7/dist-packages/ folder with root:staff ownership 
> and everyone  "r" privileges.
>
> There is a /usr/local/lib/python2.7/site-packages/ folder but nothing is 
> in it. Should I move the pymongo files from the /dist-packages folder into 
> the /site-pckages folder?
>
> Would that help web2py to find pymongo?
>
> Thanks very much!
>
>
>
> On Saturday, May 17, 2014 7:43:51 PM UTC-6, Cynthia Butler wrote:
>>
>> I am trying to use MongoDB 2.6.1 and pymongo 2.7 with the DAL on my local 
>> ubuntu 14.04 machine.
>> I have followed instructions in Alan's slice but web2py is not able to find 
>> the pymongo driver.
>> It works ok from the python shell and the mongo shell also works. 
>> My guess is that I don't have something configured correctly or don't have 
>> the correct permissions/location.
>> I have spent 2 days researching/trying to fix but cannot figure it out and 
>> now the web2py internal python shell is broken.
>>
>> How do I get mongodb and pymongo working? (I'm a noobie). Thanks!
>>
>> [web2py 2.9.5-stable+timestamp.2014.03.16.02.35.39, (Running on nginx/1.6.0, 
>> Python 2.7.6)]
>>
>> Traceback (most recent call last):
>>   File "/home/www-data/web2py/gluon/restricted.py", line 220, in restricted
>> exec ccode in environment
>>   File "/home/www-data/web2py/applications/seagull/models/db.py" 
>> , line 16, in 
>> 
>> datab = DAL("mongodb://127.0.0.1:27017/test_database", 
>> check_reserved=["mongodb_nonreserved"], adapter_args={"safe":False})
>>   File "/home/www-data/web2py/gluon/dal.py", line 7867, in __init__
>> raise RuntimeError("Failure to connect, tried %d times:\n%s" % 
>> (attempts, tb))
>> RuntimeError: Failure to connect, tried 5 times:
>> Traceback (most recent call last):
>>   File "/home/www-data/web2py/gluon/dal.py", line 7845, in __init__
>> self._adapter = ADAPTERS[self._dbname](**kwargs)
>>   File "/home/www-data/web2py/gluon/dal.py", line 688, in __call__
>> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>>   File "/home/www-data/web2py/gluon/dal.py", line 5584, in __init__
>> if do_connect: self.find_driver(adapter_args)
>>   File "/home/www-data/web2py/gluon/dal.py", line 830, in find_driver
>> raise RuntimeError("no driver available %s" % str(self.drivers))
>> RuntimeError: no driver available ('pymongo',)
>>
>>

-- 
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: Is there an Easier way to store uploads in the DB (postgres) ?

2014-05-19 Thread Mandar Vaze / मंदार वझे
> On Mon, May 19, 2014 at 11:43 PM, Anthony  wrote:
>
>> Try:
>>
>> db._adapter.uploads_in_blob = True
>>
>> Then, when you do:
>>
>> db.define_table('mytable', Field('myfile', 'upload', uploadfield=True))
>>
>> you should get a blob field called db.mytable.myfile_blob with the
>> readable and writable attributes set to False.
>>
>
> Thanks. Let me try and report back.
>

Yes, this works.

Yet having to specify uploadfield=True seems a bit weird, considering we've
already defined the field type as "upload"
But I will take this work around any day :)

-Mandar

-- 
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] Unable to pass arguments to a LOAD for a modal dialog

2014-05-19 Thread Sarbjit
Hi,

I am using the plugin for modal dialog from 
"http://dev.s-cubism.com/plugin_dialog";. I am somehow not able to pass 
arguments to modal dialog box.

*Controller :-*

def index():
dialog1 = DIALOG(LOAD(f='inner',ajax=True), 
title='Test',vars={'a':'testvar'},close_button='Close', renderstyle=True)
dialog =  A('Click me !!', _href='#', _onclick='%s;return false' % 
dialog1.show())
grid = {}
query = (db.Product.product_name==request.vars.product_id)
grid = SQLFORM.grid(query=query)
return dict(grid=grid,dialog=dialog)


def inner():
x = request.vars.a
return DIV(x)

*Views:*

{{if grid.view_form:}}
{{=grid.view_form.custom.begin}}
{{=grid}}
{{=dialog}}
{{=grid.view_form.custom.submit}}
{{=grid.view_form.custom.end}}
{{else:}}
{{=grid}}
{{pass}}

*Requirement :-*

I want to display specific data for particular row of grid (when opened in 
view mode) in the modal form. I found the plugin to show the modal dialog 
box. It works for static data but I am not able to pass any variable to the 
inner function (tried passing dummy variable). My end goal is to pass the 
"db.Product.Product_type" for that particular row to the modal dialog. 

Can someone please help me on how to achieve this.


-- 
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: Is there an Easier way to store uploads in the DB (postgres) ?

2014-05-19 Thread Mandar Vaze / मंदार वझे
On Mon, May 19, 2014 at 11:43 PM, Anthony  wrote:

> Try:
>
> db._adapter.uploads_in_blob = True
>
> Then, when you do:
>
> db.define_table('mytable', Field('myfile', 'upload', uploadfield=True))
>
> you should get a blob field called db.mytable.myfile_blob with the
> readable and writable attributes set to False.
>

Thanks. Let me try and report back.


> Also, feel free to submit a Google Code issue requesting a feature that
> allows this to be set database-wide via an argument to DAL().
>

Done. https://code.google.com/p/web2py/issues/detail?id=1935

-- 
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: Menu for anonymous and logged

2014-05-19 Thread Fabiano Almeida
Cool Anthony!

Thanks!!!

Fabiano.


2014-05-19 20:43 GMT-03:00 Anthony :

> Sure:
>
> if auth.user:
> [custom menu or append/insert into standard menu]
>
> if auth.has_membership('some_group'):
> [same idea here]
>
> Anthony
>
>
> On Monday, May 19, 2014 6:29:42 PM UTC-4, Fabiano Almeida wrote:
>>
>> Hi all!
>>
>> It's possible make differ menu for groups or logged users in
>> "models/menu.py" ? How?
>>
>> Thanks,
>>
>> Fabiano.
>>
>  --
> 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] web2py conference - online talks

2014-05-19 Thread joseph simpson
Yes, I had these types of problems also...

An offline solution would be great.

Have fun,

Joe


On Mon, May 19, 2014 at 4:43 PM, Ricardo Cárdenas <
ricardo.carde...@gmail.com> wrote:

> Kudos to everyone involved in the web2py conference!
>
> I'm having trouble watching the videos - maybe it's my connection, but
> often the video stops and the pointer resets to the beginning of the video.
> I'm having to refresh the browser and start over.
>
> I don't know if others are having these problems, but it would be great if
> an offline solution was available.
>
> thanks -Ricardo
>
>
> On Monday, May 5, 2014 10:09:05 PM UTC-5, Massimo Di Pierro wrote:
>>
>> I do not think so.
>>
>> On Monday, 5 May 2014 10:38:17 UTC-5, marco mansilla wrote:
>>>
>>> Is there any chance to download this videos to watch offline?, that
>>> would be awesome.
>>>
>>> Marco.
>>>
>>> > Please find below the links to the video of the first web2py
>>> > conference. Videos are not broken into talks.
>>> > There is no audio for the first 2minutes but no talk either, only
>>> > service announcements.
>>> >
>>> >
>>> > *Part #1 (from start to lunch break)*
>>> >
>>> > https://colflash.cdm.depaul.edu/colflashweb/
>>> COLFlashPlayer.aspx?ID=183272
>>> >
>>> > 10:00-10:10! Conference Opening
>>> >
>>> > 10:10-10:20! “What's New with the PSF” by Brian Curtin
>>> >
>>> > 10:20-11:00! “History of web2py” by Massimo Di Pierro
>>> >
>>> > 11:00-11:40! "Learn web2py the Really Hard Way" by Anthony Bastardi
>>> > 11:40-12:20! "Stereodose" by Mark Li
>>> >
>>> > 12:20-12:30! "Planet Host" by Jason Burosh
>>> >
>>> > *Part #2 (from tutorial to coffee break)*
>>> >
>>> > https://colflash.cdm.depaul.edu/colflashweb/
>>> COLFlashPlayer.aspx?ID=183273
>>> >
>>> > 13:00:13:40! "hands-on web2py tutorial" by Clifford Williams
>>> >
>>> > 13:40-14:20! "Angular and web2py" by Amber Doctor
>>> >
>>> > 14:20-14:40 ! "Stitching together the tree of life with web2py" by
>>> > Richard Ree 1
>>> >
>>> > 4:40-15:00! "ShipElf: Automated Fulfillment with Web2Py" by Peter
>>> > Szczepanski
>>> >
>>> > 15:00-15:20! "MyIRE - What is Open Source Science?" by Mark Graves
>>> >
>>> > 15:20-15:40! "Introduction to Mongodb" by Marco Chou
>>> >
>>> > *Part #3 (from coffee break to end)*
>>> >
>>> > https://colflash.cdm.depaul.edu/colflashweb/
>>> COLFlashPlayer.aspx?ID=183274
>>> >
>>> > 16:00-16:20! "Introduction to OpenShift" by Craig Brott
>>> >
>>> > 16:20-16:40! "Introduction to Hypermedia API" by Bryan Barnard
>>> >
>>> > 16:40-17:00! "web2py and the Semantic web" by Chris Baron
>>> >
>>> > 17:00-17-20! "Teaching an old dog new tricks" by Don O'Hara
>>> >
>>> > 17:20-17:30! Conference Closing
>>> >
>>>
>>  --
> 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.
>



-- 
Joe Simpson
*"All that is gold does not glitter,**Not all those who wander are lost;**The
old that is strong does not wither,*
*Deep roots are not reached by the frost."  J. R.R. Tolkien*

-- 
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] web2py conference - online talks

2014-05-19 Thread Ricardo Cárdenas
Kudos to everyone involved in the web2py conference!

I'm having trouble watching the videos - maybe it's my connection, but 
often the video stops and the pointer resets to the beginning of the video. 
I'm having to refresh the browser and start over.

I don't know if others are having these problems, but it would be great if 
an offline solution was available.

thanks -Ricardo


On Monday, May 5, 2014 10:09:05 PM UTC-5, Massimo Di Pierro wrote:
>
> I do not think so.
>
> On Monday, 5 May 2014 10:38:17 UTC-5, marco mansilla wrote:
>>
>> Is there any chance to download this videos to watch offline?, that 
>> would be awesome. 
>>
>> Marco. 
>>
>> > Please find below the links to the video of the first web2py 
>> > conference. Videos are not broken into talks. 
>> > There is no audio for the first 2minutes but no talk either, only 
>> > service announcements. 
>> > 
>> > 
>> > *Part #1 (from start to lunch break)* 
>> > 
>> > 
>> https://colflash.cdm.depaul.edu/colflashweb/COLFlashPlayer.aspx?ID=183272 
>> > 
>> > 10:00-10:10! Conference Opening 
>> > 
>> > 10:10-10:20! “What's New with the PSF” by Brian Curtin 
>> > 
>> > 10:20-11:00! “History of web2py” by Massimo Di Pierro 
>> > 
>> > 11:00-11:40! "Learn web2py the Really Hard Way" by Anthony Bastardi 
>> > 11:40-12:20! "Stereodose" by Mark Li 
>> > 
>> > 12:20-12:30! "Planet Host" by Jason Burosh 
>> > 
>> > *Part #2 (from tutorial to coffee break)* 
>> > 
>> > 
>> https://colflash.cdm.depaul.edu/colflashweb/COLFlashPlayer.aspx?ID=183273 
>> > 
>> > 13:00:13:40! "hands-on web2py tutorial" by Clifford Williams 
>> > 
>> > 13:40-14:20! "Angular and web2py" by Amber Doctor 
>> > 
>> > 14:20-14:40 ! "Stitching together the tree of life with web2py" by 
>> > Richard Ree 1 
>> > 
>> > 4:40-15:00! "ShipElf: Automated Fulfillment with Web2Py" by Peter 
>> > Szczepanski 
>> > 
>> > 15:00-15:20! "MyIRE - What is Open Source Science?" by Mark Graves 
>> > 
>> > 15:20-15:40! "Introduction to Mongodb" by Marco Chou 
>> > 
>> > *Part #3 (from coffee break to end)* 
>> > 
>> > 
>> https://colflash.cdm.depaul.edu/colflashweb/COLFlashPlayer.aspx?ID=183274 
>> > 
>> > 16:00-16:20! "Introduction to OpenShift" by Craig Brott 
>> > 
>> > 16:20-16:40! "Introduction to Hypermedia API" by Bryan Barnard 
>> > 
>> > 16:40-17:00! "web2py and the Semantic web" by Chris Baron 
>> > 
>> > 17:00-17-20! "Teaching an old dog new tricks" by Don O'Hara 
>> > 
>> > 17:20-17:30! Conference Closing 
>> > 
>>
>

-- 
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: Menu for anonymous and logged

2014-05-19 Thread Anthony
Sure:

if auth.user:
[custom menu or append/insert into standard menu]

if auth.has_membership('some_group'):
[same idea here]

Anthony

On Monday, May 19, 2014 6:29:42 PM UTC-4, Fabiano Almeida wrote:
>
> Hi all!
>
> It's possible make differ menu for groups or logged users in 
> "models/menu.py" ? How?
>
> Thanks,
>
> Fabiano.
>

-- 
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: pymongo is installed but I get this error: no driver available ('pymongo',)

2014-05-19 Thread Cynthia Butler
By the way I tried installing pymongo two ways: 

1) easy_install which put the pymongo .so files in my home/cindy/ folder 
which I assumed web2py couldn't find (since web2py is in home/www-data/ ). 
So I uninstalled that.

2) sudo pip   which put all the unzipped pymongo files in the 
/usr/local/lib/python2.7/dist-packages/ folder with root:staff ownership 
and everyone  "r" privileges.

There is a /usr/local/lib/python2.7/site-packages/ folder but nothing is in 
it. Should I move the pymongo files from the /dist-packages folder into the 
/site-pckages folder?

Would that help web2py to find pymongo?

Thanks very much!



On Saturday, May 17, 2014 7:43:51 PM UTC-6, Cynthia Butler wrote:
>
> I am trying to use MongoDB 2.6.1 and pymongo 2.7 with the DAL on my local 
> ubuntu 14.04 machine.
> I have followed instructions in Alan's slice but web2py is not able to find 
> the pymongo driver.
> It works ok from the python shell and the mongo shell also works. 
> My guess is that I don't have something configured correctly or don't have 
> the correct permissions/location.
> I have spent 2 days researching/trying to fix but cannot figure it out and 
> now the web2py internal python shell is broken.
>
> How do I get mongodb and pymongo working? (I'm a noobie). Thanks!
>
> [web2py 2.9.5-stable+timestamp.2014.03.16.02.35.39, (Running on nginx/1.6.0, 
> Python 2.7.6)]
>
> Traceback (most recent call last):
>   File "/home/www-data/web2py/gluon/restricted.py", line 220, in restricted
> exec ccode in environment
>   File "/home/www-data/web2py/applications/seagull/models/db.py" 
> , line 16, in 
> 
> datab = DAL("mongodb://127.0.0.1:27017/test_database", 
> check_reserved=["mongodb_nonreserved"], adapter_args={"safe":False})
>   File "/home/www-data/web2py/gluon/dal.py", line 7867, in __init__
> raise RuntimeError("Failure to connect, tried %d times:\n%s" % (attempts, 
> tb))
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "/home/www-data/web2py/gluon/dal.py", line 7845, in __init__
> self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File "/home/www-data/web2py/gluon/dal.py", line 688, in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File "/home/www-data/web2py/gluon/dal.py", line 5584, in __init__
> if do_connect: self.find_driver(adapter_args)
>   File "/home/www-data/web2py/gluon/dal.py", line 830, in find_driver
> raise RuntimeError("no driver available %s" % str(self.drivers))
> RuntimeError: no driver available ('pymongo',)
>
>

-- 
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] optimising isempty()

2014-05-19 Thread atan
Hi

I would like to propose the following edit to isempty() in gluon.dal as I 
believe this would improve performance particularly for tables with 
numerous fields:


def isempty(self):
try: 
return not self.select('id', limitby=(0, 1), orderby_on_limitby=
False) 
except: 
return not self.select(limit=(0, 1), orderby_on_limitby=False)


Are there any drawbacks?


Tan


-- 
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] Accessing records

2014-05-19 Thread Tom Russell
Hi,

I have some records in my db that I need to access to get them and perform 
some calculations on.

My code to access the records is:

 rows = db(db.voltrin.id > 0).count()

 currentrow = rows - 4

for x in range(currentrow, rows):
record = db.voltrin(db.voltrin.id==x)
adv_list.append(float(record.adv_issues))
dec_list.append(float(record.dec_issues))
adv_vlist.append(float(record.adv_vol))
dec_vlist.append(float(record.dec_vol))

Is this the right way to access the record at a given id?

The data I seem to get with any of my lists does not match any of the data 
in the tables which is why I am unsure of the proper way to access the data 
for a record.

Thanks,

Tom

-- 
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] Menu for anonymous and logged

2014-05-19 Thread Fabiano Almeida
Hi all!

It's possible make differ menu for groups or logged users in 
"models/menu.py" ? How?

Thanks,

Fabiano.

-- 
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: pymongo is installed but I get this error: no driver available ('pymongo',)

2014-05-19 Thread Cynthia Butler
I restarted the nginx webserver and got the internal web2py python shell 
working again.
Still don't know how to get web2py to find pymongo. Any hints?

On Saturday, May 17, 2014 7:43:51 PM UTC-6, Cynthia Butler wrote:
>
> I am trying to use MongoDB 2.6.1 and pymongo 2.7 with the DAL on my local 
> ubuntu 14.04 machine.
> I have followed instructions in Alan's slice but web2py is not able to find 
> the pymongo driver.
> It works ok from the python shell and the mongo shell also works. 
> My guess is that I don't have something configured correctly or don't have 
> the correct permissions/location.
> I have spent 2 days researching/trying to fix but cannot figure it out and 
> now the web2py internal python shell is broken.
>
> How do I get mongodb and pymongo working? (I'm a noobie). Thanks!
>
> [web2py 2.9.5-stable+timestamp.2014.03.16.02.35.39, (Running on nginx/1.6.0, 
> Python 2.7.6)]
>
> Traceback (most recent call last):
>   File "/home/www-data/web2py/gluon/restricted.py", line 220, in restricted
> exec ccode in environment
>   File "/home/www-data/web2py/applications/seagull/models/db.py" 
> , line 16, in 
> 
> datab = DAL("mongodb://127.0.0.1:27017/test_database", 
> check_reserved=["mongodb_nonreserved"], adapter_args={"safe":False})
>   File "/home/www-data/web2py/gluon/dal.py", line 7867, in __init__
> raise RuntimeError("Failure to connect, tried %d times:\n%s" % (attempts, 
> tb))
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "/home/www-data/web2py/gluon/dal.py", line 7845, in __init__
> self._adapter = ADAPTERS[self._dbname](**kwargs)
>   File "/home/www-data/web2py/gluon/dal.py", line 688, in __call__
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File "/home/www-data/web2py/gluon/dal.py", line 5584, in __init__
> if do_connect: self.find_driver(adapter_args)
>   File "/home/www-data/web2py/gluon/dal.py", line 830, in find_driver
> raise RuntimeError("no driver available %s" % str(self.drivers))
> RuntimeError: no driver available ('pymongo',)
>
>

-- 
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] Including custom javascript in web2py

2014-05-19 Thread niki
hi, I have been trying to understand how i can include static JavaScript 
files on my view layout.html
I want to embed an editor on web2py.
I have an html code which works out fine on its own: However i would like 
this code to work in web2py as well. I have tried using 
'response.files.append(URL('static','editor.js'))' but it will not work

Please can you direct me on how to handle this. Thanks. Here is the html 
code that works.

'
  
http://www.wiris.net/demo/editor/editor";>

var editor;
window.onload = function () {
  editor = com.wiris.jsEditor.JsEditor.newInstance({'language': 'en'});
editor.insertInto(document.getElementById('editorContainer'));
}

  
  

  
'

-- 
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] Web2py grid pagination class set

2014-05-19 Thread Stefan van den Eertwegh
Hi al,

I have a grid in web2py and want a pagination class define to use the 
bootstrap pagination styling.
The parameters pagination_class and paginator_class doesnt work.

Does anyone know how this works?

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] datetime smart query

2014-05-19 Thread Manuele Pesenti
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: Application Licensing

2014-05-19 Thread 'sasogeek' via web2py-users
I found this 
resource
 that 
gives a nice list of benefits of going Open Source which is great! But I'm 
also a little concerned about monetization. I'm a student and I've spent a 
lot of time with this project, I also think of value for the time I've put 
in. (But yes now I'm seriously staring at Open Source in the face! :) )

On Monday, 19 May 2014 21:07:10 UTC, sasogeek wrote:
>
> I haven't considered OS, not that I'm against it. But hypothetically 
> speaking since I'm still in considerations,what are the benefits of going 
> open source?
>
> On Monday, 19 May 2014 19:20:37 UTC, Niphlod wrote:
>>
>> consider that also any third party library (either python or js, css, 
>> etc) could have its own license model.
>> Also, you should choose beforehand if you want to release it as an open 
>> source project or not. 
>>
>> On Monday, May 19, 2014 2:09:32 PM UTC+2, sasogeek wrote:
>>>
>>> That actually is my question. I don't know which license I like because 
>>> I don't know which licenses I can get for what I want to begin with. I'm 
>>> new to licenses, but with the little knowledge I have about softwares and 
>>> applications, I know I need one. Not sure what my options are, and 
>>> especially with the fact that I want to have a renewable one that's 
>>> purchasable periodically, I'd like to know specifically what my options 
>>> are, any suggestions would help.
>>>
>>> This actually may be the wrong place to ask but I figured since it has 
>>> to do with web2py, maybe I'd get some help here... Thanks
>>>
>>> On Monday, 19 May 2014 11:48:03 UTC, Anthony wrote:


 You can license your app however you'd like.

 Anthony

 On Monday, May 19, 2014 6:53:05 AM UTC-4, sasogeek wrote:
>
> How do I license a web2py application for commercial use? I'd like to 
> have a license that's renewable every 6 months. From a few similar 
> questions I've read, I've gathered that web2py does allow commercial 
> distribution but must be stated in the documentation that the application 
> uses web2py... besides that though, what licenses can I get my 
> application 
> for how I want to be released? Procedures, etc. I need all the 
> information 
> I can get on this topic... I'm new to it. Thanks
>


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


[web2py] Re: Application Licensing

2014-05-19 Thread 'sasogeek' via web2py-users
I haven't considered OS, not that I'm against it. But hypothetically 
speaking since I'm still in considerations,what are the benefits of going 
open source?

On Monday, 19 May 2014 19:20:37 UTC, Niphlod wrote:
>
> consider that also any third party library (either python or js, css, etc) 
> could have its own license model.
> Also, you should choose beforehand if you want to release it as an open 
> source project or not. 
>
> On Monday, May 19, 2014 2:09:32 PM UTC+2, sasogeek wrote:
>>
>> That actually is my question. I don't know which license I like because I 
>> don't know which licenses I can get for what I want to begin with. I'm new 
>> to licenses, but with the little knowledge I have about softwares and 
>> applications, I know I need one. Not sure what my options are, and 
>> especially with the fact that I want to have a renewable one that's 
>> purchasable periodically, I'd like to know specifically what my options 
>> are, any suggestions would help.
>>
>> This actually may be the wrong place to ask but I figured since it has to 
>> do with web2py, maybe I'd get some help here... Thanks
>>
>> On Monday, 19 May 2014 11:48:03 UTC, Anthony wrote:
>>>
>>>
>>> You can license your app however you'd like.
>>>
>>> Anthony
>>>
>>> On Monday, May 19, 2014 6:53:05 AM UTC-4, sasogeek wrote:

 How do I license a web2py application for commercial use? I'd like to 
 have a license that's renewable every 6 months. From a few similar 
 questions I've read, I've gathered that web2py does allow commercial 
 distribution but must be stated in the documentation that the application 
 uses web2py... besides that though, what licenses can I get my application 
 for how I want to be released? Procedures, etc. I need all the information 
 I can get on this topic... I'm new to it. Thanks

>>>

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


[web2py] Re: Application Licensing

2014-05-19 Thread Niphlod
consider that also any third party library (either python or js, css, etc) 
could have its own license model.
Also, you should choose beforehand if you want to release it as an open 
source project or not. 

On Monday, May 19, 2014 2:09:32 PM UTC+2, sasogeek wrote:
>
> That actually is my question. I don't know which license I like because I 
> don't know which licenses I can get for what I want to begin with. I'm new 
> to licenses, but with the little knowledge I have about softwares and 
> applications, I know I need one. Not sure what my options are, and 
> especially with the fact that I want to have a renewable one that's 
> purchasable periodically, I'd like to know specifically what my options 
> are, any suggestions would help.
>
> This actually may be the wrong place to ask but I figured since it has to 
> do with web2py, maybe I'd get some help here... Thanks
>
> On Monday, 19 May 2014 11:48:03 UTC, Anthony wrote:
>>
>>
>> You can license your app however you'd like.
>>
>> Anthony
>>
>> On Monday, May 19, 2014 6:53:05 AM UTC-4, sasogeek wrote:
>>>
>>> How do I license a web2py application for commercial use? I'd like to 
>>> have a license that's renewable every 6 months. From a few similar 
>>> questions I've read, I've gathered that web2py does allow commercial 
>>> distribution but must be stated in the documentation that the application 
>>> uses web2py... besides that though, what licenses can I get my application 
>>> for how I want to be released? Procedures, etc. I need all the information 
>>> I can get on this topic... I'm new to it. Thanks
>>>
>>

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


[web2py] Re: Important New Year News: PyCon 2014 Tutorial

2014-05-19 Thread Ykä Marjanen
Here's the link to the video from pyvideo.org:

http://pyvideo.org/video/2558/0-to-0000-with-web2py

I think it's a good introductory video for newbies to get some insights, 
but I think Massimo's videos are better for actually learning the framework 
:)

Ykä

On Saturday, January 4, 2014 6:03:52 AM UTC+2, Massimo Di Pierro wrote:
>
> There will be a web2py tutorial at PyCon 2014.
>
> https://us.pycon.org/2014/schedule/presentation/133/
>
> Congratulations to Clifford Williams for proposing the tutorial and 
> passing the selection process.
>
>

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


[web2py] Re: Is there an Easier way to store uploads in the DB (postgres) ?

2014-05-19 Thread Anthony
Try:

db._adapter.uploads_in_blob = True

Then, when you do:

db.define_table('mytable', Field('myfile', 'upload', uploadfield=True))

you should get a blob field called db.mytable.myfile_blob with the readable 
and writable attributes set to False.

Also, feel free to submit a Google Code issue requesting a feature that 
allows this to be set database-wide via an argument to DAL().

Anthony

On Monday, May 19, 2014 1:37:11 PM UTC-4, Mandar Vaze wrote:
>
> Currently I am using "uploadfield" option of "Field"/table definition to 
> ensure that uploads are stored in DB and not on the filesystem.
>
> While this works, this seems tedious because :
>
> 1. I have multiple tables with upload fields. If I forget defining 
> "uploadfield" even one of them (or if someone forgets in future, when they 
> add a new table) then I will end up having some uploads in the DB, and some 
> on the filesystem
> 2. I need to explicitly "hide" the blob field, otherwise it shows up in 
> the SQLFORM.grid
>
> *Is there a cleaner option ?*
>
> I tried defining "db" in models/db.py as follows :
>
> db = DAL('postgres://user:pass@localhost/mydb', pool_size=5,check_reserved
> =['all'], adapter_args={'uploads_in_blob': True})
>
> But it does not seem to work
>
> I dug a little, but was unable to find how and where adapter_args were 
> used. It seems it is finally passed to self.find_driver - but at least for 
> psycopg2 driver
>
> -Mandar
>
>
>

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


[web2py] Is there an Easier way to store uploads in the DB (postgres) ?

2014-05-19 Thread Mandar Vaze
Currently I am using "uploadfield" option of "Field"/table definition to 
ensure that uploads are stored in DB and not on the filesystem.

While this works, this seems tedious because :

1. I have multiple tables with upload fields. If I forget defining 
"uploadfield" even one of them (or if someone forgets in future, when they 
add a new table) then I will end up having some uploads in the DB, and some 
on the filesystem
2. I need to explicitly "hide" the blob field, otherwise it shows up in the 
SQLFORM.grid

*Is there a cleaner option ?*

I tried defining "db" in models/db.py as follows :

db = DAL('postgres://user:pass@localhost/mydb', pool_size=5, check_reserved
=['all'], adapter_args={'uploads_in_blob': True})

But it does not seem to work

I dug a little, but was unable to find how and where adapter_args were 
used. It seems it is finally passed to self.find_driver - but at least for 
psycopg2 driver

-Mandar


-- 
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: question about video

2014-05-19 Thread villas
Not sure whether this is the problem,  but a quick run through HTML Tidy 
highlighted a few issues with the markup.  Maybe correct those first.

"Warning", "2","Untitled","Untitled","16","29","0"," discarding 
newline in URI reference"
"Warning", "1","Untitled","Untitled","8","25","0","adjacent hyphens within 
comment"
"Warning", "5","Untitled","Untitled","11","13","0","missing "
"Warning", "6","Untitled","Untitled","9","9","0","missing "
"Warning", "3","Untitled","Untitled","32","41","0","missing "
"Warning", "4","Untitled","Untitled","54","41","0","missing "


On Saturday, 17 May 2014 16:14:16 UTC+1, eric cuver wrote:
>
> thank you.
>
> i have another question.
>
> I have this code in an index.html file but when I compile under web2py whole 
> section does not appear on the webpage
>
>
> 
> 
> 
> 
> 
>  
> 
> 
> 
> 
> 
> 
> 
> 
> To travel is to live
> 
> 
> You Don't Need 
> Magic to Disappear. All you need is a destination.
> 
> 
> 
>  href="#">Show on the map 
> More 
> info 
>  
> 
> 
> 
> 
>  
> 
> 
> 
>  src="{{=URL('static','images/sliderbg.jpg')}}" alt=""/>
> 
>  
> 
> To travel is to live
> 
> 
> You Don't Need 
> Magic to Disappear. All you need is a destination.
> 
> 
> 
>  href="#">Show on the map 
> More 
> info 
>  
> 
> 
> 
> 
> 
> 
> 
>
> Le vendredi 9 mai 2014 23:53:19 UTC+2, Massimo Di Pierro a écrit :
>>
>> The only thing that you need that does not ship with web2py is a way to 
>> record their video and upload to your side.
>>
>> Some options include:
>> - http://www.webrtc.org/
>> - http://www.screencast-o-matic.com/
>>
>> Massimo
>>
>> On Thursday, 8 May 2014 13:59:19 UTC-5, eric cuver wrote:
>>>
>>> Hi, 
>>> I'm beginning to web2py, 
>>>
>>> I would like to create a site that allows people to register on the site 
>>> to be able to record their webcam and put the video 
>>> on the account and customizes video will be viewed 
>>> by people who have the right. how do you function module or with web2py 
>>> I happen to create this site 
>>> thank you in advance and excuse my english I'm french
>>>
>>

-- 
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: multiple views same controller

2014-05-19 Thread Anthony
In a model file, maybe something like:

response.view = '%s/%s' % (request.env.http_host.rpartition('.')[-1],response
.view)

Which should yield paths like com/default/index.html, 
de/default/index.html, etc.

Anthony

On Monday, May 19, 2014 8:27:57 AM UTC-4, ctrlSoft wrote:
>
> Hi, what is the best  way to make multiple views for the same controller.
> i have an application with multiple domains .com .de .it co.uk
> for every domain the controllers, models is the same but in views i have 
> to make some changes it's different for every domain
> for static files i used routes, but for views is a little hard to handle 
> this
> i want to have smth like:
> views/
> de/default/
> com/default/
> it/default
> or 
>
> views/default/com/...
> views/default/de/...
> views/default/it/
>
> is there a way execept response.view in every function?
>
>

-- 
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] multiple views same controller

2014-05-19 Thread ctrlSoft
Hi, what is the best  way to make multiple views for the same controller.
i have an application with multiple domains .com .de .it co.uk
for every domain the controllers, models is the same but in views i have to 
make some changes it's different for every domain
for static files i used routes, but for views is a little hard to handle 
this
i want to have smth like:
views/
de/default/
com/default/
it/default
or 

views/default/com/...
views/default/de/...
views/default/it/

is there a way execept response.view in every function?

-- 
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: Application Licensing

2014-05-19 Thread 'sasogeek' via web2py-users
That actually is my question. I don't know which license I like. I'm new to 
licenses, but with the little knowledge I have about softwares and 
applications, I know I need one. Not sure what my options are, and 
especially with the fact that I want to have a renewable one that's 
purchasable periodically, I'd like to know specifically what my options 
are, any suggestions would help.

This actually may be the wrong place to ask but I figured since it has to 
do with web2py, maybe I'd get some help here... Thanks

On Monday, 19 May 2014 11:48:03 UTC, Anthony wrote:
>
>
> You can license your app however you'd like.
>
> Anthony
>
> On Monday, May 19, 2014 6:53:05 AM UTC-4, sasogeek wrote:
>>
>> How do I license a web2py application for commercial use? I'd like to 
>> have a license that's renewable every 6 months. From a few similar 
>> questions I've read, I've gathered that web2py does allow commercial 
>> distribution but must be stated in the documentation that the application 
>> uses web2py... besides that though, what licenses can I get my application 
>> for how I want to be released? Procedures, etc. I need all the information 
>> I can get on this topic... I'm new to it. Thanks
>>
>

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


[web2py] Re: Application Licensing

2014-05-19 Thread Anthony
As the book states:

release your applications which use official web2py libraries under any 
> license you wish
>

You can license your app however you'd like.

Anthony

On Monday, May 19, 2014 6:53:05 AM UTC-4, sasogeek wrote:
>
> How do I license a web2py application for commercial use? I'd like to have 
> a license that's renewable every 6 months. From a few similar questions 
> I've read, I've gathered that web2py does allow commercial distribution but 
> must be stated in the documentation that the application uses web2py... 
> besides that though, what licenses can I get my application for how I want 
> to be released? Procedures, etc. I need all the information I can get on 
> this topic... I'm new to it. Thanks
>

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


[web2py] Re: chinging text of the "submit" button and creating a button without a form

2014-05-19 Thread Multiplery
And is there a way to make a button which leads to a page by click, similar 
to this:

form=FORM('Your name:',  
  INPUT(_type='submit'))
form.add_button('click me', URL('index'))



Am Sonntag, 18. Mai 2014 13:07:16 UTC+2 schrieb Multiplery:
>
> Hey, 
> i have two questions. 
>
> 1. when i have this code, is it possible to change the text of the submit 
> button already in the controller or only in the view?
>
> form = FORM('Your name:',
>   INPUT(_name='name', requires=IS_NOT_EMPTY()),
>   INPUT(_type='submit'))
>
>
>
> 2. Is it possible to create a button without a form in the controller? or 
> is this also something that needs to be done in the view?
>
> Thanks for you help!
>
>

-- 
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: creating a row3 where the rows are in row1 but not in row2

2014-05-19 Thread Lucas Schreiber
Thank you very much, Anthony. Your code almost works, it needed just a 
minor correction:

owned_licenses = dba(dba.owned_license.owner_id == owner_id)._select(dba.
owned_license.license_id, distinct=True)
unowned_licenses = dba(~dba.license.license_id.belongs(owned_licenses)).
select()

Then it works fine. Thanks 

Am Sonntag, 18. Mai 2014 15:34:28 UTC+2 schrieb Lucas Schreiber:

> Hey,
> i have another Problem. Imagine you have two rows created as follow:
>
> models:
>
>
> dba.define_table('owned_license',
> Field('owner_id', 'integer'),
> Field('license_id', 'integer'))
>
>
> dba.define_table('license',
> Field('license_name', 'integer'),
> Field('license_id', 'integer'))
>
>
> Controller:
>
> owned_license_db = dba(dba.owned_license.owner_id== owner_id).select(dba.
> owned_license.ALL)
> license_db = dba().select(dba.license.ALL)
>
>
> Inserts in the db (for example):
>
> dba.license.insert(license_id= 1, license_name= 'test1')
> dba.license.insert(license_id= 2, license_name= 'test2')
> dba.license.insert(license_id= 3, license_name= 'test3')
> dba.license.insert(license_id= 4, license_name= 'test4')
> dba.license.insert(license_id= 5, license_name= 'test5')
>
>
> dba.owned_license.insert(owner_id = 1, license_id= 2)
> dba.owned_license.insert(owner_id = 1, license_id= 3)
> dba.owned_license.insert(owner_id = 1, license_id= 4)
> dba.owned_license.insert(owner_id = 2, license_id= 1)
> dba.owned_license.insert(owner_id = 2, license_id= 3)
>
>
>
>
> in this example, if i have owner_id =1, i want a row with every row from 
> license_db not in owned_license_db, so, in this example, 1 and 5.
>
> How can this be done?
>
> Thanks for every help :)
>

-- 
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] Application Licensing

2014-05-19 Thread 'sasogeek' via web2py-users
How do I license a web2py application for commercial use? I'd like to have 
a license that's renewable every 6 months. From a few similar questions 
I've read, I've gathered that web2py does allow commercial distribution but 
must be stated in the documentation that the application uses web2py... 
besides that though, what licenses can I get my application for how I want 
to be released? Procedures, etc. I need all the information I can get on 
this topic... I'm new to it. Thanks

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