[web2py] websocket_send() on db insert

2015-05-01 Thread 'sasogeek' via web2py-users
is there a way to execute some script anytime there's a db insert (either 
from a form or by manual insert query, or any db query for that matter)? 
and by script, i'd want to use websocket_send to send some messages anytime 
something goes in or out of the db with regards to some specific tables.

-- 
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: unknown error on production server! I need help fixing it asap ['NoneType' object is not callable]

2015-04-15 Thread 'sasogeek' via web2py-users
"A lighter alternative could be to add an _after_delete/_after_update 
callback to auth_table that would search and delete any sessions owned by 
the user"
isn't that what cascade does?

On Wednesday, 15 April 2015 16:12:01 UTC+1, Leonel Câmara wrote:
>
> I think we have to take the performance hit. Hopefully the database will 
> be smart enough to keep the records for the users in cache so the slowdown 
> won't be that big. Right now this is sort of a security issue:
>
> 1. Add @auth.requires_login() to the welcome index function.
> 2. Register and login, check that you can access index.
> 3. Remove the user created in 2 from the database.
> 4. Verify that you can still access login even though your user was 
> removed (possibly by the website administrator who doesn't want you to be 
> able to see the contents anymore)
>
> If you want you can replace step 3 with:
> 3. In appadmin set the registration_key to 'blocked' which supposedly 
> would block the user.
>
>
> A lighter alternative could be to add an _after_delete/_after_update 
> callback to auth_table that would search and delete any sessions owned by 
> the user which would be slow but would not happen very often, this of 
> course would only detect and fix this bug if you use the DAL to delete the 
> row and not some external database tool. 
>

-- 
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] Cron-like job

2015-04-13 Thread 'sasogeek' via web2py-users
I want to do something but I doubt cron is the right thing to attempt, I'm 
not even sure what I'm supposed to do except that it's going to be a 
scheduled task and it may or may not be solved by cron, I need some 
guidance.

I want to simulate a bank. users get to 'save' some (virtual) money in the 
'bank', and every hour (in real time, periodically from the time of 
'saving') they earn some percentage of their saved money.

for instance, every hour, 
balance = db(db.bank.account_id == 
auth.user.bank_account_id).select().first().balance
db(db.bank.account_id == 
auth.user.bank_account_id).update(balance=balance+(0.0001*balance))
or something like that.

how do i do 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.


[web2py] Re: Multiple file download

2015-04-11 Thread 'sasogeek' via web2py-users
I managed to get it working. I looked up the download method in the 
Response class and apparently it's looking for a table name and field in 
the file name. I added that structure [table.field.] to my zipped file name 
[table.field.zipfile_name.zip] and passed it to the download as an argument 
in URL() and now it works. it zips the file, saves it, then downloads it, 
Now the next thing I want to do is delete the saved zip file from inside my 
app once it has been downloaded.

On Saturday, 11 April 2015 19:43:47 UTC+1, sasogeek wrote:
>
> I zipped the files and saved it in a folder...but how do I download it 
> now? using the the download function doesn't work...
>
> On Saturday, 11 April 2015 13:21:03 UTC+1, Louis Amon wrote:
>>
>> I think you'd have to loop through a selection and use retrieve() (
>> http://pydal.readthedocs.org/en/latest/index.html?highlight=retrieve#pydal.objects.Field.retrieve
>> )
>>
>> If you need a one-click download then perhaps you could zip all the files 
>> using the zip  library 
>> (or gzip or whatever compression you want to use ^^)
>>
>> On Saturday, April 11, 2015 at 1:47:19 PM UTC+2, sasogeek wrote:
>>>
>>> Is there a way I could download all the files in a db or loop through a 
>>> db selection and download all associated files via maybe just a click on a 
>>> link?
>>>
>>

-- 
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 file download

2015-04-11 Thread 'sasogeek' via web2py-users
I zipped the files and saved it in a folder...but how do I download it now? 
using the the download function doesn't work...

On Saturday, 11 April 2015 13:21:03 UTC+1, Louis Amon wrote:
>
> I think you'd have to loop through a selection and use retrieve() (
> http://pydal.readthedocs.org/en/latest/index.html?highlight=retrieve#pydal.objects.Field.retrieve
> )
>
> If you need a one-click download then perhaps you could zip all the files 
> using the zip  library 
> (or gzip or whatever compression you want to use ^^)
>
> On Saturday, April 11, 2015 at 1:47:19 PM UTC+2, sasogeek wrote:
>>
>> Is there a way I could download all the files in a db or loop through a 
>> db selection and download all associated files via maybe just a click on a 
>> link?
>>
>

-- 
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 file download

2015-04-11 Thread 'sasogeek' via web2py-users
Is there a way I could download all the files in a db or loop through a db 
selection and download all associated files via maybe just a click on a 
link?

-- 
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: Using ajax to call a function that uses LOAD, not working

2015-04-11 Thread 'sasogeek' via web2py-users
Thanks a lot. Will definitely take your advice. I always tell myself I will 
do all that change when the app is complete and I don't have more code to 
write then I'll rearrange everything, especially with the 'style' bit cos 
i'm just in a hurry to code-on-the-fly and see immediate change, but I 
never actually get to that point to make the changes.

Seeing as I need help and it's rather difficult to get the help because 
other devs can't understand easily what I've already done, it's just best 
that I do the change now and might as well just do the right thing while 
I'm at it. Thanks.

On Friday, 10 April 2015 19:38:56 UTC+1, Derek wrote:
>
> I think you should look at your code a bit differently.
>
> For example, looking at your code, I have all this clutter, I can't tell 
> what it does because of all this visual noise. Not to mention that those 
> html and javascripts are probably not syntax hilighted in the editor (they 
> should be in their own files so you can have proper syntax hilighted). This 
> also helps with debugging efforts. 
>
> When you want to change for example to remove facebook support and replace 
> that with google plus... you should be able to immediately know where that 
> is. CSS Classes should be assigned in the views. You can load views and 
> render them in your controller if you want. Views handle all html and your 
> css should be in your static files somewhere. You should never have to put 
> a 'style' attribute on anything if they are part of the right class, or 
> nested properly. 
>
> On Thursday, April 9, 2015 at 7:25:24 PM UTC-7, sasogeek wrote:
>>
>> I guess I may still have an issue with understanding where to place the 
>> right code for whatever purpose, so long as the code I write makes sense 
>> and does what I want it to do, it all seems pretty fine with me... but I 
>> guess that's not good enough, things ought to be done the right way. I'm 
>> still learning.
>> Thanks for pointing it out though.
>>
>> On Wednesday, 8 April 2015 20:50:56 UTC+1, Derek wrote:
>>>
>>> I don't have an answer, just a comment on the style...
>>>
>>> This is what you should not do - you're mixing the model, view, and 
>>> controller into an inconceivable mess. 
>>>
>>> On Tuesday, April 7, 2015 at 7:11:58 AM UTC-7, sasogeek wrote:

 default.py

 @auth.requires_login()
 def load_home():
 loader = """$('#right-side').html(">>> class='fa fa-spinner fa-spin'>")"""
 websocket_send('http://127.0.0.1:', loader, 'mykey', 'home%s' 
 % auth.user.id)
 remove_class1 = "$('#bk').removeClass('active')"  #books
 remove_class2 = "$('#ls').removeClass('active')"  #lecture slides
 remove_class3 = "$('#pq').removeClass('active')"  #past questions
 remove_class4 = "$('#cs').removeClass('active')"  #courses
 remove_class5 = "$('#bl').removeClass('active')"  #blogs
 remove_class6 = "$('#nt').removeClass('active')"  #notes
 remove_class7 = "$('#fr').removeClass('active')"  #friends
 add_class = "$('#hm').addClass('active')" #home
 websocket_send('http://127.0.0.1:', remove_class1, 'mykey', 
 'home%s' % auth.user.id)
 websocket_send('http://127.0.0.1:', remove_class2, 'mykey', 
 'home%s' % auth.user.id)
 websocket_send('http://127.0.0.1:', remove_class3, 'mykey', 
 'home%s' % auth.user.id)
 websocket_send('http://127.0.0.1:', remove_class4, 'mykey', 
 'home%s' % auth.user.id)
 websocket_send('http://127.0.0.1:', remove_class5, 'mykey', 
 'home%s' % auth.user.id)
 websocket_send('http://127.0.0.1:', remove_class6, 'mykey', 
 'home%s' % auth.user.id)
 websocket_send('http://127.0.0.1:', remove_class7, 'mykey', 
 'home%s' % auth.user.id)
 websocket_send('http://127.0.0.1:', add_class, 'mykey', 
 'home%s' % auth.user.id)

 message = """>>> class='col-md-4' class='grid-body'>%sLorem ipsum dolor sit amet consectetur 
 adipisicing elit sed do eiusmod 823k>>> class='grid-body full'> 
 402k 
 97k >>> style='height:30px;' src='%s'  class='img-polaroid pull-left' alt='User 
 Profile'>Status>>> class='grid-body' 
 id='sf'>""" % (URL('download', 
 args=[auth.user.profile_picture]) if auth.user.profile_picture else 
 "../static/nb/html/assets/img/logo.png", auth.user.full_name, 
 URL('download', args=[auth.user.profile_picture]) if 
 auth.user.profile_picture else "../static/nb/html/assets/img/logo.png")
 
 message = message.strip().replace("'", '"')
 message = message.strip().replace("\n", "")
 message = message.strip().replace("\r", "")
 message = message.strip().replace("\t", "")
 message = 
 "$('#right-side').html($('%s').fadeIn('slow').slideDown('slow'))" % message
 websocket_send('http://127.0.0.1:', message, 'mykey', 'home%s' 
 % auth.user.id)

 form =

[web2py] Re: Using ajax to call a function that uses LOAD, not working

2015-04-08 Thread 'sasogeek' via web2py-users
I was doing it the wrong way i think, but i did a workaround. I used the A 
helper to place a button on the page and when it's clicked it replaces 
itself with the form at statusform.load with ajax=True, and it works just 
fine

On Tuesday, 7 April 2015 15:11:58 UTC+1, sasogeek wrote:
>
> default.py
>
> @auth.requires_login()
> def load_home():
> loader = """$('#right-side').html(" class='fa fa-spinner fa-spin'>")"""
> websocket_send('http://127.0.0.1:', loader, 'mykey', 'home%s' % 
> auth.user.id)
> remove_class1 = "$('#bk').removeClass('active')"  #books
> remove_class2 = "$('#ls').removeClass('active')"  #lecture slides
> remove_class3 = "$('#pq').removeClass('active')"  #past questions
> remove_class4 = "$('#cs').removeClass('active')"  #courses
> remove_class5 = "$('#bl').removeClass('active')"  #blogs
> remove_class6 = "$('#nt').removeClass('active')"  #notes
> remove_class7 = "$('#fr').removeClass('active')"  #friends
> add_class = "$('#hm').addClass('active')" #home
> websocket_send('http://127.0.0.1:', remove_class1, 'mykey', 
> 'home%s' % auth.user.id)
> websocket_send('http://127.0.0.1:', remove_class2, 'mykey', 
> 'home%s' % auth.user.id)
> websocket_send('http://127.0.0.1:', remove_class3, 'mykey', 
> 'home%s' % auth.user.id)
> websocket_send('http://127.0.0.1:', remove_class4, 'mykey', 
> 'home%s' % auth.user.id)
> websocket_send('http://127.0.0.1:', remove_class5, 'mykey', 
> 'home%s' % auth.user.id)
> websocket_send('http://127.0.0.1:', remove_class6, 'mykey', 
> 'home%s' % auth.user.id)
> websocket_send('http://127.0.0.1:', remove_class7, 'mykey', 
> 'home%s' % auth.user.id)
> websocket_send('http://127.0.0.1:', add_class, 'mykey', 'home%s' 
> % auth.user.id)
>
> message = """ class='col-md-4'> class='grid-body'>%sLorem ipsum dolor sit amet consectetur 
> adipisicing elit sed do eiusmod 823k class='grid-body full'> 
> 402k 
> 97k  style='height:30px;' src='%s'  class='img-polaroid pull-left' alt='User 
> Profile'>Status id='sf'>""" % (URL('download', 
> args=[auth.user.profile_picture]) if auth.user.profile_picture else 
> "../static/nb/html/assets/img/logo.png", auth.user.full_name, 
> URL('download', args=[auth.user.profile_picture]) if 
> auth.user.profile_picture else "../static/nb/html/assets/img/logo.png")
> 
> message = message.strip().replace("'", '"')
> message = message.strip().replace("\n", "")
> message = message.strip().replace("\r", "")
> message = message.strip().replace("\t", "")
> message = 
> "$('#right-side').html($('%s').fadeIn('slow').slideDown('slow'))" % message
> websocket_send('http://127.0.0.1:', message, 'mykey', 'home%s' % 
> auth.user.id)
>
> form = LOAD(c='default', f='statusform', ajax=True, content=XML(' style="font-size:24px;" class="fa fa-cog fa-spin">'))
> form = "$('#sf').html($('%s').fadeIn('slow').slideDown('slow'))" % form
> websocket_send('http://127.0.0.1:', form, 'mykey', 'home%s' % 
> auth.user.id)
>
> def statusform():
> status = crud.create(db.statuses)
> msg = status.element('textarea', _name="status")
> msg['_class'] = "form-control"
> msg['_style'] = "height: 40px; width:45vw; margin-bottom:5px;"
> user_id = status.element('input', _name='user_id')
> user_id['_type'] = 'hidden'
> user_id['_value'] = auth.user.id
> submit = status.element('input', _type="submit")
> submit['_class'] = "btn btn-primary pull-right"
> submit['_value'] = "Post"
> if status.process().accepted:
> userPic=db(db.auth_user.id
> ==request.post_vars.user_id).select().first().profile_picture
> now = prettydate(datetime.datetime.now())
> message1 = """ style="width:51.9vw;"> style="height:30px; width: 30px;" src="%s"  class="img-polaroid pull-left" 
> alt="User Profile">%s title="Collapse">%s class="grid-body">%s""" % (URL('download', 
> args=[userPic]) if userPic else "../static/nb/html/assets/img/logo.png", db(
> db.auth_user.id == request.post_vars.user_id).select().first().full_name, 
> now, request.post_vars.status)
>
> message1 = message1.strip().replace("\n", "")
> message1 = message1.strip().replace("\r", "")
> script1 = 
> """$('#statuses1').prepend($('%s').fadeIn('slow').slideDown('slow'))""" % 
> message1
> script2 = "$('#statuses1').show('slow')"
>
> message2 = """ style="width:95vw;"> style="height:30px; width: 30px;" src="%s"  class="img-polaroid pull-left" 
> alt="User Profile">%s title="Collapse">%s class="grid-body">%s""" % (URL('download', 
> args=[userPic]) if userPic else "../static/nb/html/assets/img/logo.png", db(
> db.auth_user.id == request.post_vars.user_id).select().first().full_name, 
> now, request.post_vars.status)
>
> message2 = message2.strip().replace("\n", "")
> message2 = message2.strip().replace("\r", "")
> script3 = 
> """$('#statuses2').prepend($('%s'

[web2py] Using ajax to call a function that uses LOAD, not working

2015-04-07 Thread 'sasogeek' via web2py-users
default.py

@auth.requires_login()
def load_home():
loader = """$('#right-side').html("")"""
websocket_send('http://127.0.0.1:', loader, 'mykey', 'home%s' % 
auth.user.id)
remove_class1 = "$('#bk').removeClass('active')"  #books
remove_class2 = "$('#ls').removeClass('active')"  #lecture slides
remove_class3 = "$('#pq').removeClass('active')"  #past questions
remove_class4 = "$('#cs').removeClass('active')"  #courses
remove_class5 = "$('#bl').removeClass('active')"  #blogs
remove_class6 = "$('#nt').removeClass('active')"  #notes
remove_class7 = "$('#fr').removeClass('active')"  #friends
add_class = "$('#hm').addClass('active')" #home
websocket_send('http://127.0.0.1:', remove_class1, 'mykey', 
'home%s' % auth.user.id)
websocket_send('http://127.0.0.1:', remove_class2, 'mykey', 
'home%s' % auth.user.id)
websocket_send('http://127.0.0.1:', remove_class3, 'mykey', 
'home%s' % auth.user.id)
websocket_send('http://127.0.0.1:', remove_class4, 'mykey', 
'home%s' % auth.user.id)
websocket_send('http://127.0.0.1:', remove_class5, 'mykey', 
'home%s' % auth.user.id)
websocket_send('http://127.0.0.1:', remove_class6, 'mykey', 
'home%s' % auth.user.id)
websocket_send('http://127.0.0.1:', remove_class7, 'mykey', 
'home%s' % auth.user.id)
websocket_send('http://127.0.0.1:', add_class, 'mykey', 'home%s' % 
auth.user.id)

message = """%sLorem ipsum dolor sit amet consectetur 
adipisicing elit sed do eiusmod 823k 
402k 
97k Status""" % (URL('download', 
args=[auth.user.profile_picture]) if auth.user.profile_picture else 
"../static/nb/html/assets/img/logo.png", auth.user.full_name, 
URL('download', args=[auth.user.profile_picture]) if 
auth.user.profile_picture else "../static/nb/html/assets/img/logo.png")

message = message.strip().replace("'", '"')
message = message.strip().replace("\n", "")
message = message.strip().replace("\r", "")
message = message.strip().replace("\t", "")
message = 
"$('#right-side').html($('%s').fadeIn('slow').slideDown('slow'))" % message
websocket_send('http://127.0.0.1:', message, 'mykey', 'home%s' % 
auth.user.id)

form = LOAD(c='default', f='statusform', ajax=True, content=XML(''))
form = "$('#sf').html($('%s').fadeIn('slow').slideDown('slow'))" % form
websocket_send('http://127.0.0.1:', form, 'mykey', 'home%s' % 
auth.user.id)

def statusform():
status = crud.create(db.statuses)
msg = status.element('textarea', _name="status")
msg['_class'] = "form-control"
msg['_style'] = "height: 40px; width:45vw; margin-bottom:5px;"
user_id = status.element('input', _name='user_id')
user_id['_type'] = 'hidden'
user_id['_value'] = auth.user.id
submit = status.element('input', _type="submit")
submit['_class'] = "btn btn-primary pull-right"
submit['_value'] = "Post"
if status.process().accepted:

userPic=db(db.auth_user.id==request.post_vars.user_id).select().first().profile_picture
now = prettydate(datetime.datetime.now())
message1 = """%s%s%s""" % (URL('download', 
args=[userPic]) if userPic else "../static/nb/html/assets/img/logo.png", 
db(db.auth_user.id == 
request.post_vars.user_id).select().first().full_name, now, 
request.post_vars.status)

message1 = message1.strip().replace("\n", "")
message1 = message1.strip().replace("\r", "")
script1 = 
"""$('#statuses1').prepend($('%s').fadeIn('slow').slideDown('slow'))""" % 
message1
script2 = "$('#statuses1').show('slow')"

message2 = """%s%s%s""" % (URL('download', 
args=[userPic]) if userPic else "../static/nb/html/assets/img/logo.png", 
db(db.auth_user.id == 
request.post_vars.user_id).select().first().full_name, now, 
request.post_vars.status)

message2 = message2.strip().replace("\n", "")
message2 = message2.strip().replace("\r", "")
script3 = 
"""$('#statuses2').prepend($('%s').fadeIn('slow').slideDown('slow'))""" % 
message2
script4 = "$('#statuses2').show('slow')"

websocket_send('http://127.0.0.1:', script1, 'mykey', 'mygroup')
websocket_send('http://127.0.0.1:', script2, 'mykey', 'mygroup')
websocket_send('http://127.0.0.1:', script3, 'mykey', 'mygroup')
websocket_send('http://127.0.0.1:', script4, 'mykey', 'mygroup')
return status



home.html



Home


...


...




I'm using ajax to call the function *load_home* and load_home is supposed 
to return a form using LOAD with ajax=True. The normal home function in the 
controller returns form using LOAD with ajax=True and that works just fine. 
But now I'm also using websocket_messaging.py to load parts of the page for 
navigation without whole page reloads, chats, etc. I'm trying to use the 
same mechanism to reload the home page when the "Home" link is clicked.

The problem here is that when I use ajax=False in the load_home function
form = LOAD(c='default

Re: [web2py] Developer network

2015-04-05 Thread 'sasogeek' via web2py-users
Hmmm, I guess I never saw github as that... never really explored it, just 
have an account there. Will take a look and see what I can learn from it.
Thanks

On Monday, 6 April 2015 06:07:21 UTC+1, Phyo Arkar wrote:
>
> Github? 
>
> On Mon, Apr 6, 2015 at 11:10 AM, 'sasogeek' via web2py-users 
> > wrote: 
> > Hello, 
> > I'm wondering if there's a social media platform for app developers? 
> > I want to build one as an open source project using web2py... any 
> thoughts, 
> > ideas, something to look on to start with? 
> > 
> > -- 
> > 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+un...@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] Developer network

2015-04-05 Thread 'sasogeek' via web2py-users
Hello,
I'm wondering if there's a social media platform for app developers?
I want to build one as an open source project using web2py... any thoughts, 
ideas, something to look on to start with?

-- 
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: unknown error on production server! I need help fixing it asap ['NoneType' object is not callable]

2015-04-05 Thread 'sasogeek' via web2py-users
Thanks Leonel
Somehow that worked! But I have no idea why it worked... seeing as you 
suggested it, can you explain to me please?
Thanks again though.

On Sunday, April 5, 2015 at 9:15:56 AM UTC+1, Leonel Câmara wrote:
>
> If you clear your browser cookies (you can try using a private browsing 
> window) does it work?
>

-- 
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] unknown error on production server! I need help fixing it asap ['NoneType' object is not callable]

2015-04-04 Thread 'sasogeek' via web2py-users
I have an app on a live server which part of my school uses. Somehow it 
spits out this error when I tried to login tonight.
Before it happened, I logged in to my vps.net account and went to the 
console page, I saw a button there "Ctrl+Alt+Del". I don't know what it is 
but as I do with most things, I decided to press it to see what happens, 
there was an alert if i was sure I wanted to click that button, I hit yes 
and then I notice the app won't load in the browser so I started the server 
again from a shell using putty. The app homepage came up right after the 
restart but that's when I encountered this problem... I tried to login but 
I get this error each time now. It's not pointing to my code so I'm a 
little bit lost as to where to start fixing it

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/main.py", line 475, in wsgibase
session._try_store_in_cookie_or_file(request, response)
  File "/home/www-data/web2py/gluon/globals.py", line 1126, in 
_try_store_in_cookie_or_file
return self._try_store_in_file(request, response)
  File "/home/www-data/web2py/gluon/globals.py", line 1133, in 
_try_store_in_file
or self._unchanged(response)):
  File "/home/www-data/web2py/gluon/globals.py", line 1078, in _unchanged
session_pickled = cPickle.dumps(self)
  File "/usr/lib/python2.7/copy_reg.py", line 84, in _reduce_ex
dict = getstate()
TypeError: 'NoneType' object is not callable

-- 
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 does one get their web2py sites on the poweredby page?

2014-08-28 Thread 'sasogeek' via web2py-users
If I made a web app with web2py, how do I get it listed on the poweredby 
page ?

-- 
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] vps.net ubuntu script installation for web2py doesn't appear to work

2014-08-25 Thread 'sasogeek' via web2py-users
I just watched the vimeo video made by Massimo some time back and used it 
as a guide to get web2py running on a node I just acquired at vps.net. Once 
everything was done, I tried to go to the ip but all I get is the default 
apache server page.

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.

How do I get it to work?

-- 
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: a selective select

2014-08-20 Thread 'sasogeek' via web2py-users
That works, thanks.

On Wednesday, 20 August 2014 15:30:26 UTC, Niphlod wrote:
>
> isn't IS_IN_DB enough when you specify a set ?, e.g. 
> IS_IN_DB(db(db.other_table.field == True), 'other_table.id', '%(name)s') ?
>
> On Wednesday, August 20, 2014 5:26:29 PM UTC+2, sasogeek wrote:
>>
>> I don't know if the title of the question makes any sense but here's what 
>> I want to achieve. In the model db.py, i can have a field that references 
>> another table via Field('fieldname', db.other_table), but this gives me a 
>> select html element in the views which has all the items in the 
>> other_table. if I want only some specific items in other_table where for 
>> instance other_table.field==True, can i do that directly from the db.py? if 
>> so, how? my workaround now is to do this directly in the views where for 
>> item in other_table_items, if item.field==True > }}>{{=item.name}}
>>
>

-- 
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: a selective select

2014-08-20 Thread 'sasogeek' via web2py-users
Actually I haven't thought about trying that. never occurred to me... but 
I'll do that now and give you feedback if it does what I want :)
It appears that would work though, thank you

On Wednesday, 20 August 2014 15:30:26 UTC, Niphlod wrote:
>
> isn't IS_IN_DB enough when you specify a set ?, e.g. 
> IS_IN_DB(db(db.other_table.field == True), 'other_table.id', '%(name)s') ?
>
> On Wednesday, August 20, 2014 5:26:29 PM UTC+2, sasogeek wrote:
>>
>> I don't know if the title of the question makes any sense but here's what 
>> I want to achieve. In the model db.py, i can have a field that references 
>> another table via Field('fieldname', db.other_table), but this gives me a 
>> select html element in the views which has all the items in the 
>> other_table. if I want only some specific items in other_table where for 
>> instance other_table.field==True, can i do that directly from the db.py? if 
>> so, how? my workaround now is to do this directly in the views where for 
>> item in other_table_items, if item.field==True > }}>{{=item.name}}
>>
>

-- 
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] a selective select

2014-08-20 Thread 'sasogeek' via web2py-users
I don't know if the title of the question makes any sense but here's what I 
want to achieve. In the model db.py, i can have a field that references 
another table via Field('fieldname', db.other_table), but this gives me a 
select html element in the views which has all the items in the 
other_table. if I want only some specific items in other_table where for 
instance other_table.field==True, can i do that directly from the db.py? if 
so, how? my workaround now is to do this directly in the views where for 
item in other_table_items, if item.field==True {{=item.name}}

-- 
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 restrict file type to pdf

2014-08-06 Thread 'sasogeek' via web2py-users
How can I restrict the uploaded file type to only pdf? I know that with 
images i could use the IS_IMAGE() validator, I don't know how to do same 
for pdf files though. 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] Python and Web2py course

2014-08-04 Thread 'sasogeek' via web2py-users
Next semester, I'll be a 3rd year student in my university. My plans for 
next semester include me organizing some sort of classes (and a web2py 
club) for students to learn web application development with web2py. Any 
ideas what I should be teaching or how I should go about it? I haven't done 
something like this before but I really want to teach people how to write 
web applications seeing as I get a huge load of requests everyday...

-- 
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] emailing a pdf view as an attachment

2014-08-03 Thread 'sasogeek' via web2py-users
I have a form, and i display the details entered in the form on .pdf views 
page. Is it possible to use web2py to email that generated pdf page to 
someone? what I want to achieve is to allow users to fill the form and then 
click a button to send the pdf containing the entered details without 
downloading the pdf and re-uploading it... it's about the best solution 
I've come up with so far but that's not what I want to achieve. It'll be 
too much hustle for users (even I wouldn't want to do that)

-- 
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: Bootstrap is really killing web2py

2014-07-26 Thread 'sasogeek' via web2py-users
So... I'm not really sure what this whole conversation is about, as to 
whether it's an issue of web2py coming with bs2 by default or some 
difficulty in implementing bs3. I use bs3 just fine in my web2py apps and 
really haven't had any issues..

On Friday, 18 July 2014 19:17:34 UTC, Moustafa Mahmoud wrote:
>
> I have been using web2py for 3 years know, and I was really impressed by 
> it, I defended it in every discussion, even implemented all my projects 
> using it and even convinced my Graduation Project Team to use it in our GP. 
> However, as my skill increased and I began looking more into customizing my 
> applications, I have hit a brick wall discovering how tightly bound web2py 
> is to bootstrap2, I wanted to use bootstrap 3 but was faced with tons of 
> problems. If I want to move to another front end framework then I 
> discovered that it would be easier to use another framework because of the 
> time and effort I would need to invest in modifying all parts of web2py 
> that are tightly bound  to bootstrap.
> This will result in making web2py a headache to me rather than my best 
> friend. I am writing this message because I am really sad that an amazing 
> framework like web2py is forcing me to consider an alternative because I do 
> really feel it is constraining me at this point.
> Any help or ideas about that ?
>

-- 
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: Alternative IDEs?

2014-07-15 Thread 'sasogeek' via web2py-users
I was wondering why I was getting that error too cos I don't use python25. 
Thanks for letting me know. I'm quite the noob at all this :)

On Tuesday, 15 July 2014 10:41:32 UTC, Niphlod wrote:
>
> your setup is seriously messed up (it happens, more likely on windows than 
> linux but it happens). you're starting python2.7 and getting an 
> exception from "c:\csvn\python25"  check your %PATH%  or learn to 
> use virtualenv ^_^'
>
> On Tuesday, July 15, 2014 7:19:57 AM UTC+2, sasogeek wrote:
>>
>> I keep getting this error when I try running the web2py.py script from 
>> PyCharm.
>> DLL load failed: %1 is not a valid Win32 application.
>>
>> I need help getting it to run. Here's the full traceback.
>> C:\Python27\python.exe 
>> E:/Users/Samuel/Downloads/web2py_src/web2py/web2py.py
>> No handlers could be found for logger "web2py"
>> Traceback (most recent call last):
>>   File "E:/Users/Samuel/Downloads/web2py_src/web2py/web2py.py", line 19, 
>> in 
>> import gluon.widget
>>   File "E:\Users\Samuel\Downloads\web2py_src\web2py\gluon\__init__.py", 
>> line 15, in 
>> from globals import current
>>   File "E:\Users\Samuel\Downloads\web2py_src\web2py\gluon\globals.py", 
>> line 18, in 
>> from gluon.streamer import streamer, stream_file_or_304_or_206, 
>> DEFAULT_CHUNK_SIZE
>>   File "E:\Users\Samuel\Downloads\web2py_src\web2py\gluon\streamer.py", 
>> line 15, in 
>> import rewrite
>>   File "E:\Users\Samuel\Downloads\web2py_src\web2py\gluon\rewrite.py", 
>> line 24, in 
>> import urllib
>>   File "C:\csvn\Python25\lib\urllib.py", line 26, in 
>> import socket
>>   File "C:\csvn\Python25\lib\socket.py", line 47, in 
>> import _socket
>> ImportError: DLL load failed: %1 is not a valid Win32 application.
>>
>>
>>
>> On Monday, 14 July 2014 14:05:15 UTC, Jim S wrote:
>>>
>>> PyCharm - paid version has web2py integration.
>>>
>>> -Jim
>>>
>>> On Monday, July 14, 2014 7:35:43 AM UTC-5, sasogeek wrote:

 Are there any alternative IDEs for web2py?
 I'm in search of an IDE for web2py that can help me find methods and 
 variables easily. for example autocomplete options to choose from after 
 using a dot operator? the default browser ide lacks quite a number of 
 things in making programming easy. Web2py in itself I believe makes 
 developing applications really really easy, but I believe writing the code 
 should be just as easy the development process itself... if you get what I 
 mean.

>>>

-- 
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: Alternative IDEs?

2014-07-14 Thread 'sasogeek' via web2py-users
I keep getting this error when I try running the web2py.py script from 
PyCharm.
DLL load failed: %1 is not a valid Win32 application.

I need help getting it to run. Here's the full traceback.
C:\Python27\python.exe E:/Users/Samuel/Downloads/web2py_src/web2py/web2py.py
No handlers could be found for logger "web2py"
Traceback (most recent call last):
  File "E:/Users/Samuel/Downloads/web2py_src/web2py/web2py.py", line 19, in 

import gluon.widget
  File "E:\Users\Samuel\Downloads\web2py_src\web2py\gluon\__init__.py", 
line 15, in 
from globals import current
  File "E:\Users\Samuel\Downloads\web2py_src\web2py\gluon\globals.py", line 
18, in 
from gluon.streamer import streamer, stream_file_or_304_or_206, 
DEFAULT_CHUNK_SIZE
  File "E:\Users\Samuel\Downloads\web2py_src\web2py\gluon\streamer.py", 
line 15, in 
import rewrite
  File "E:\Users\Samuel\Downloads\web2py_src\web2py\gluon\rewrite.py", line 
24, in 
import urllib
  File "C:\csvn\Python25\lib\urllib.py", line 26, in 
import socket
  File "C:\csvn\Python25\lib\socket.py", line 47, in 
import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.



On Monday, 14 July 2014 14:05:15 UTC, Jim S wrote:
>
> PyCharm - paid version has web2py integration.
>
> -Jim
>
> On Monday, July 14, 2014 7:35:43 AM UTC-5, sasogeek wrote:
>>
>> Are there any alternative IDEs for web2py?
>> I'm in search of an IDE for web2py that can help me find methods and 
>> variables easily. for example autocomplete options to choose from after 
>> using a dot operator? the default browser ide lacks quite a number of 
>> things in making programming easy. Web2py in itself I believe makes 
>> developing applications really really easy, but I believe writing the code 
>> should be just as easy the development process itself... if you get what I 
>> mean.
>>
>

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

2014-07-14 Thread 'sasogeek' via web2py-users
That's understandable, but it's just a thing that occurred to me. Maybe 
it's not that important, but you can give it some thought (or not). One of 
my random thoughts that could mean something or nothing :)

On Monday, 14 July 2014 15:39:57 UTC, Anthony wrote:
>
> On Monday, July 14, 2014 11:01:11 AM UTC-4, sasogeek wrote:
>>
>> I just think that since there's that concept of decorators and the fact 
>> that there's quite a number of them and functions they perform, it'd be 
>> good to have them all listed somewhere with (at the very least) their 
>> definitions and maybe some examples on how to use them. (instead of being 
>> scattered in different places in the documentation).
>>
>
> But why do decorators in particular need this treatment? They are just a 
> standard part of Python, like functions and classes. In what situation do 
> you need to reference a comprehensive list of decorators -- any more so 
> than a comprehensive list of functions or classes?
>
> Anthony
>

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

2014-07-14 Thread 'sasogeek' via web2py-users
I just think that since there's that concept of decorators and the fact 
that there's quite a number of them and functions they perform, it'd be 
good to have them all listed somewhere with (at the very least) their 
definitions and maybe some examples on how to use them. (instead of being 
scattered in different places in the documentation).

On Monday, 14 July 2014 13:42:35 UTC, Anthony wrote:
>
> I don't think there's a place that specifically lists just the decorators, 
> but the decorators are described in the documentation (e.g., the @auth 
> decorators in the Access Control chapter, the @cache decorators in the Core 
> chapter, etc.). Is there a reason you need a decorator-centric view of the 
> documenation?
>
> Anthony
>
> On Monday, July 14, 2014 8:28:42 AM UTC-4, sasogeek wrote:
>>
>> Is there a place in the documentation or somewhere on the web that lists 
>> all the annotations/decorators in web2py and explains how to use them? like 
>> @auth.requires_login, etc.
>>
>

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


[web2py] Re: Alternative IDEs?

2014-07-14 Thread 'sasogeek' via web2py-users
I just checked out PyCharm and it looks just like IntelliJ for java. Just 
what I had in mind! :)
Thanks Jim.

Samuel.

On Monday, 14 July 2014 14:05:15 UTC, Jim S wrote:
>
> PyCharm - paid version has web2py integration.
>
> -Jim
>
> On Monday, July 14, 2014 7:35:43 AM UTC-5, sasogeek wrote:
>>
>> Are there any alternative IDEs for web2py?
>> I'm in search of an IDE for web2py that can help me find methods and 
>> variables easily. for example autocomplete options to choose from after 
>> using a dot operator? the default browser ide lacks quite a number of 
>> things in making programming easy. Web2py in itself I believe makes 
>> developing applications really really easy, but I believe writing the code 
>> should be just as easy the development process itself... if you get what I 
>> mean.
>>
>

-- 
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] Alternative IDEs?

2014-07-14 Thread 'sasogeek' via web2py-users
Are there any alternative IDEs for web2py?
I'm in search of an IDE for web2py that can help me find methods and 
variables easily. for example autocomplete options to choose from after 
using a dot operator? the default browser ide lacks quite a number of 
things in making programming easy. Web2py in itself I believe makes 
developing applications really really easy, but I believe writing the code 
should be just as easy the development process itself... if you get what I 
mean.

-- 
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] Annotations

2014-07-14 Thread 'sasogeek' via web2py-users
Is there a place in the documentation or somewhere on the web that lists 
all the annotations/decorators in web2py and explains how to use them? like 
@auth.requires_login, etc.

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


[web2py] Table column/cell width not specified, unable to continue

2014-07-13 Thread 'sasogeek' via web2py-users
I'm trying to render a list of all first names in my auth_user table in a 
pdf but an error (the one in this question's title) slaps me in the face! 
Need some help figuring out how to resolve it.

Controller
def finish():
users = db().select(db.auth_user.ALL)
return dict(users=users)

View (finish.html)
{{for user in users:}}
{{=user.first_name}}
{{pass}}


View (finish.pdf)
{{
import os
from gluon.contrib.generics import pdf_from_html
filename = '%s/%s.html' % (request.default,request.finish)
if os.path.exists(os.path.join(request.folder,'views',filename)):
   html=response.render(filename)
else:
   html=BODY(BEAUTIFY(response._vars)).xml()
pass
=pdf_from_html(html)
}}


Error ticket
 Table column/cell width not specified, 
unable to continue
Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

Traceback (most recent call last):
  File "/home/mdipierro/make_web2py/web2py/gluon/restricted.py", line 212, in 
restricted
  File 
"E:\Users\Samuel\Downloads\web2py_win\web2py\applications\admissions\views\default/finish.pdf",
 line 9, in 
  File "/home/mdipierro/make_web2py/web2py/gluon/contrib/generics.py", line 72, 
in pdf_from_html
  File "/home/mdipierro/make_web2py/web2py/gluon/contrib/generics.py", line 63, 
in pyfpdf_from_html
  File "/home/mdipierro/make_web2py/web2py/gluon/contrib/fpdf/html.py", line 
397, in write_html
  File "HTMLParser.pyc", line 108, in feed
  File "HTMLParser.pyc", line 142, in goahead
  File "/home/mdipierro/make_web2py/web2py/gluon/contrib/fpdf/html.py", line 
74, in handle_data
RuntimeError: Table column/cell width not specified, unable to continue

-

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

import os
from gluon.contrib.generics import pdf_from_html
filename = '%s/%s.html' % (request 
.default,request 
.finish)
if os.path.exists(os.path.join(request 
.folder,'views',filename)):
html=response 
.render(filename)
else:
html=BODY (BEAUTIFY 
(response 
._vars)).xml()
pass
response 
.write(pdf_from_html(html))
response .write('\r\n', 
escape=False)



I need help fixing this error

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

2014-05-22 Thread 'sasogeek' via web2py-users
I've been looking around for python hosting websites that I can get my 
web2py deployed on but none of them is easy to work with. I'd rather prefer 
the ease to work on my application than having the headache of getting 
online, which really should be easy to do. I tried the solution given me in 
this 
thread 
for 
dreamhost deployment. it worked for sometime and then passenger just broke 
without me even doing anything. I got off the hosting service now and I'm 
searching for a new place. PythonAnywhere is good, but I can't get my 
application at a domain i want unless I have www in front of it by force... 
I learned web2py.com is hosted on PythonAnywhere, and I'd like to know how 
that works, having web2py.com working without necessarily having the www in 
front of it? or if there's a better solution

-- 
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 the web2py.js Ajax functionality broken?

2014-05-20 Thread 'sasogeek' via web2py-users
Found the problem staring at me, had to slap myself after finding it... 
Field('likes', 'integer', readable=False, writable=False, default=0),
deleted the readable and writable parameters since i was blocking 
read/write access... thanks for the responses though! Much appreciated :)


On Wednesday, 21 May 2014 00:32:50 UTC, sasogeek wrote:
>
> I just did a minimal ajax process and it doesn't work! the onkeyup demo in 
> the book works when i try though, but onclick just messes with me... i've a 
> few places in my application where onchange also triggers an ajax function 
> but i don't know, onclick just doesn't seem to work anywhere i try it. must 
> it be in a form? is it specific to only some elements? what am i missing... 
> :/
>
> On Tuesday, 20 May 2014 23:19:57 UTC, sasogeek wrote:
>>
>> I tried that... no luck. I think it's because there's multiple answers 
>> and all of them have the form input with name="aid", can't distinguish 
>> which request.vars.aid to send... different answers would have different 
>> amounts of likes... there's a for-loop statement above the form and each 
>> form has the same name... if i distinguish the name to be name="aid{{=
>> answer.id}}", how do I get the value in the controller? request.vars.aid?
>>
>> On Tuesday, 20 May 2014 13:40:44 UTC, Anthony wrote:
>>>
>>> ajax('like', ...)
>>>
>>> In the above, 'like' is a relative URL (i.e., it doesn't start with a 
>>> "/"), which means it will simply be appended to the URL of the current 
>>> page. Instead, use the web2py URL helper:
>>>
>>> ajax('{{=URL('default', 'like')}}', ...)
>>>
>>> Anthony
>>>
>>>
>>> On Tuesday, May 20, 2014 6:09:01 AM UTC-4, sasogeek wrote:

 I'm not sure if it's just me or it's the js file or it's the code I'm 
 writing but something is definitely wrong... here's what's not working.

 Model (db.py)
 Answer=db.define_table(
 'answers',
 Field('answer', 'text', requires=IS_NOT_EMPTY(), notnull=True,),
 Field('image', 'upload', 
 requires=IS_EMPTY_OR(IS_IMAGE(extensions=('bmp', 'gif', 'jpeg', 'png', 
 'jpg',
 Field('question_id', db.questions, readable=False),
 Field('userid', db.auth_user, readable=False),
 Field('likes', 'integer', readable=False, writable=False, 
 default=0),
 auth.signature
 )

 Controller (default.py)
 def like():
 answer = db(db.answers.id==request.vars.aid
 )
 new_likes = answer.select()[0].likes + 1
 answer.update_record(likes=new_likes)
 return new_likes

 View (index.html)
 
 {{=answer.likes}} likes 
 · 
 [like]


 When I click on like, it doesn't the value doesn't change! but I have 
 the web2py.js script in my scripts... what is wrong?

 PS. I'm using web2py version 2.5.1

>>>

-- 
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 the web2py.js Ajax functionality broken?

2014-05-20 Thread 'sasogeek' via web2py-users
I just did a minimal ajax process and it doesn't work! the onkeyup demo in 
the book works when i try though, but onclick just messes with me... i've a 
few places in my application where onchange also triggers an ajax function 
but idk, onclick just doesn't seem to work anywhere i try it. must it be in 
a form? is it specific to only some elements? what am i missing... :/

On Tuesday, 20 May 2014 23:19:57 UTC, sasogeek wrote:
>
> I tried that... no luck. I think it's because there's multiple answers and 
> all of them have the form input with name="aid", can't distinguish which 
> request.vars.aid to send... different answers would have different amounts 
> of likes... there's a for-loop statement above the form and each form has 
> the same name... if i distinguish the name to be name="aid{{=answer.id}}", 
> how do I get the value in the controller? request.vars.aid?
>
> On Tuesday, 20 May 2014 13:40:44 UTC, Anthony wrote:
>>
>> ajax('like', ...)
>>
>> In the above, 'like' is a relative URL (i.e., it doesn't start with a 
>> "/"), which means it will simply be appended to the URL of the current 
>> page. Instead, use the web2py URL helper:
>>
>> ajax('{{=URL('default', 'like')}}', ...)
>>
>> Anthony
>>
>>
>> On Tuesday, May 20, 2014 6:09:01 AM UTC-4, sasogeek wrote:
>>>
>>> I'm not sure if it's just me or it's the js file or it's the code I'm 
>>> writing but something is definitely wrong... here's what's not working.
>>>
>>> Model (db.py)
>>> Answer=db.define_table(
>>> 'answers',
>>> Field('answer', 'text', requires=IS_NOT_EMPTY(), notnull=True,),
>>> Field('image', 'upload', 
>>> requires=IS_EMPTY_OR(IS_IMAGE(extensions=('bmp', 'gif', 'jpeg', 'png', 
>>> 'jpg',
>>> Field('question_id', db.questions, readable=False),
>>> Field('userid', db.auth_user, readable=False),
>>> Field('likes', 'integer', readable=False, writable=False, default=0),
>>> auth.signature
>>> )
>>>
>>> Controller (default.py)
>>> def like():
>>> answer = db(db.answers.id==request.vars.aid 
>>> )
>>> new_likes = answer.select()[0].likes + 1
>>> answer.update_record(likes=new_likes)
>>> return new_likes
>>>
>>> View (index.html)
>>> 
>>> {{=answer.likes}} likes · 
>>> [like]
>>>
>>>
>>> When I click on like, it doesn't the value doesn't change! but I have 
>>> the web2py.js script in my scripts... what is wrong?
>>>
>>> PS. I'm using web2py version 2.5.1
>>>
>>

-- 
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 the web2py.js Ajax functionality broken?

2014-05-20 Thread 'sasogeek' via web2py-users
I tried that... no luck. I think it's because there's multiple answers and 
all of them have the form input with name="aid", can't distinguish which 
request.vars.aid to send... different answers would have different amounts 
of likes... there's a for-loop statement above the form and each form has 
the same name... if i distinguish the name to be name="aid{{=answer.id}}", 
how do I get the value in the controller? request.vars.aid?

On Tuesday, 20 May 2014 13:40:44 UTC, Anthony wrote:
>
> ajax('like', ...)
>
> In the above, 'like' is a relative URL (i.e., it doesn't start with a 
> "/"), which means it will simply be appended to the URL of the current 
> page. Instead, use the web2py URL helper:
>
> ajax('{{=URL('default', 'like')}}', ...)
>
> Anthony
>
>
> On Tuesday, May 20, 2014 6:09:01 AM UTC-4, sasogeek wrote:
>>
>> I'm not sure if it's just me or it's the js file or it's the code I'm 
>> writing but something is definitely wrong... here's what's not working.
>>
>> Model (db.py)
>> Answer=db.define_table(
>> 'answers',
>> Field('answer', 'text', requires=IS_NOT_EMPTY(), notnull=True,),
>> Field('image', 'upload', 
>> requires=IS_EMPTY_OR(IS_IMAGE(extensions=('bmp', 'gif', 'jpeg', 'png', 
>> 'jpg',
>> Field('question_id', db.questions, readable=False),
>> Field('userid', db.auth_user, readable=False),
>> Field('likes', 'integer', readable=False, writable=False, default=0),
>> auth.signature
>> )
>>
>> Controller (default.py)
>> def like():
>> answer = db(db.answers.id==request.vars.aid )
>> new_likes = answer.select()[0].likes + 1
>> answer.update_record(likes=new_likes)
>> return new_likes
>>
>> View (index.html)
>> 
>> {{=answer.likes}} likes · 
>> [like]
>>
>>
>> When I click on like, it doesn't the value doesn't change! but I have the 
>> web2py.js script in my scripts... what is wrong?
>>
>> PS. I'm using web2py version 2.5.1
>>
>

-- 
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 the web2py.js Ajax functionality broken?

2014-05-20 Thread 'sasogeek' via web2py-users
I'm not sure if it's just me or it's the js file or it's the code I'm 
writing but something is definitely wrong... here's what's not working.

Model (db.py)
Answer=db.define_table(
'answers',
Field('answer', 'text', requires=IS_NOT_EMPTY(), notnull=True,),
Field('image', 'upload', 
requires=IS_EMPTY_OR(IS_IMAGE(extensions=('bmp', 'gif', 'jpeg', 'png', 
'jpg',
Field('question_id', db.questions, readable=False),
Field('userid', db.auth_user, readable=False),
Field('likes', 'integer', readable=False, writable=False, default=0),
auth.signature
)

Controller (default.py)
def like():
answer = db(db.answers.id==request.vars.id)
new_likes = answer.select()[0].likes + 1
answer.update_record(likes=new_likes)
return new_likes

View (index.html)

{{=answer.likes}} likes · 
[like]


When I click on like, it doesn't the value doesn't change! but I have the 
web2py.js script in my scripts... what is wrong?

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


[web2py] Re: Custom login form error

2014-05-17 Thread 'sasogeek' via web2py-users
So do I return response.flash or I return session.flash? 

-- 
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] Custom login form error

2014-05-16 Thread 'sasogeek' via web2py-users
I have a custom login form that displays the error when the email is 
invalid (eg. like someone submits an email with a wrong email format, i.e, 
without @domain.com for example), but when an email that's not in the 
database is submitted, nothing happens, the page just reloads.

Also, if an email that's in the database is submitted with a wrong 
password, the page just reloads... it's not recorded in login.errors (my 
custom form.errors)
here's all the code relating to the login form. (I've tried both 
crud.settings.hideerror=True and crud.settings.hideerror=False, doesn't 
work) --Remember though that login.errors returns invalid email when the 
email format is wrong.

Model (db.py)
db = DAL('sqlite://storage.sqlite')
response.generic_patterns = ['*'] if request.is_local else []
auth = Auth(db, hmac_key=Auth.get_or_create_key())
crud = Crud(db)
crud.settings.hideerror=False
...
...
...
db.define_table(
auth.settings.table_user_name,
Field('full_name', length=128, default=''),
Field('email', length=128, default='', unique=True),
Field('password', 'password', length=512,
  readable=False, label='Password'),
Field('registration_key', length=512,
  writable=False, readable=False, default=''),
Field('reset_password_key', length=512,
  writable=False, readable=False, default=''),
Field('registration_id', length=512,
  writable=False, readable=False, default=''),
  format="%(full_name)s")

custom_auth_table = db[auth.settings.table_user_name] # get the 
custom_auth_table
custom_auth_table.full_name.requires = 
IS_NOT_EMPTY(error_message=auth.messages.is_empty)
custom_auth_table.password.requires =  [CRYPT()]
custom_auth_table.email.requires = [
  IS_EMAIL(error_message='Invalid Email'),
  IS_NOT_IN_DB(db, custom_auth_table.email)]


Controller (default.py)
def home():
login = auth.login(next="index")
register = auth.register(next="tos")
return dict(login=login, register=register)


View (default/home.html)
...

{{pass}}
...
...



{{=login.custom.begin}}

Email: {{=login.custom.widget.email}}


Password: {{=login.custom.widget.password}}


{{=login.custom.submit}}

{{=login.custom.end}}



...
...




×
 Error Logging In





{{if login.errors:}}
{{=login.errors}}
{{pass}}

   
   




...


How do I detect the incorrect password error and also the email not in 
database error? the ...email.requires=IS_NOT_IN_DB I believe allows my 
register form to work so that people can sign up. login also works 
perfectly if all the details are correct. I just need to fix this error 
issue. already searched similar topics but i'm not making any headway... 

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