[web2py] Re: 2.9.11 / cache / WindowsError [Error 123]

2014-12-10 Thread Kiran Subbaraman
I went ahead and included Massimo's one-liner in the cache.py that Leonel provided: def fix_key_name(self,key): #def encode_invalid(m): #s = m.group() #import base64 #return base64.b16encode(s) #return self.invalid_cha

[web2py] Re: vps.net ubuntu script installation for web2py doesn't appear to work

2014-12-10 Thread Massimo Di Pierro
which script is this? I do not remember. There are a bunch of scripts in web2py/scripts/setup-web2py-*. I have to say in recent times I have used exclusively nginx which manages memory much better. On Monday, 25 August 2014 10:24:29 UTC-5, sasogeek wrote: > > I just watched the vimeo video made

[web2py] Re: Is it possible to append content to a block from multiple included files?

2014-12-10 Thread Massimo Di Pierro
If you include both file_1 and file_2 you should have two blocks (one each) with different names within the same script. I would also suggest that you include the part in the block. For example {{block script1}}{{end}} {{block script2}}{{end}} then file1 would do {{block script1}} ... do som

[web2py] Re: vps.net ubuntu script installation for web2py doesn't appear to work

2014-12-10 Thread Vin Yard
I am also getting this error after installing on Raspbian (Linux 3.12.28+ ) Issue persists on both Linux and Windows. Any help would be much appreciated. On Monday, August 25, 2014 5:24:29 PM UTC+2, sasogeek wrote: > > I just watched the vimeo video made by Massimo some time back and used it >

[web2py] Re: db.define_table password

2014-12-10 Thread Oliver
thank you so much On Wednesday, December 10, 2014 11:55:42 AM UTC-5, Massimo Di Pierro wrote: > > Field('password',type='password',requires=CRYPT()) > > On Wednesday, 10 December 2014 09:57:30 UTC-6, Oliver wrote: >> >> where can I read or learn more about defining tables? I'm trying to >> con

[web2py] Is it possible to append content to a block from multiple included files?

2014-12-10 Thread Lisandro
I'm wondering if it's possible to append content to a block from multiple included files This a resume of what I would like to do: layout.html {{include}} {{block jquery_code}} {{end}} index.html {{extend 'layout.html'}} This is a paragraph {{include 'file_

Re: [web2py] Re: Postgresql case sensitive field

2014-12-10 Thread Michele Comitini
The text is wrong and the example is right. USE THE EXAMPLE! db = DAL('postgres://...', ...,ignore_field_case=False, entity_quoting=True) 2014-12-09 15:57 GMT+01:00 Paolo Valleri : > try to set ignore_field_case and entity_quoting to True., see > http://web2py.com/books/default/chapter/29/0

[web2py] jquery ui dialog icon

2014-12-10 Thread José Eloy
Hello! I'm using jquery ui 1.11.2 in my web2py application. I put the jquery ui folder at /static/jquery-ui-1.11.2.custom, then I import the library and the css in the layout.html file using: When I use the dialog widget, the dialog shows well, but the X of the window is not shown. Is

[web2py] Verification email is not sent

2014-12-10 Thread Richard D
Hi, In my app standard email can be send using mail.send(to=['ric The registration email is not sent however. db.py: ## configure email mail = auth.settings.mailer mail.settings.server = 'logging' if request.is_local else 'mail.mampl.com:26' mail.settings.sender = 'u...@mampl.com' mail.

Re: [web2py] Can the web2py validators be used outside of forms?

2014-12-10 Thread Niphlod
BTW, for the specific case there's IS_LIST_OF_EMAILS :P On Wednesday, December 10, 2014 10:21:07 AM UTC+1, desta wrote: > > Thank you Manuele for the quick answer. Even though I read the > documentation I didn't understand that I could do that! Thank you for > pointing that out to me. It works g

[web2py] Re: change standard grid button text

2014-12-10 Thread Niphlod
except fiddling with translations, I don't think so. On Wednesday, December 10, 2014 11:05:30 AM UTC+1, Manuele wrote: > > Hi *, > is there a standard, or easy at least, way to change standard grid > button text? > > Thank you in advance > > Cheers > > Manuele > -- Resources: - http://

[web2py] Re: migrate and fake_migrate

2014-12-10 Thread Niphlod
BTW, what you are experiencing is totally predictable, but you're "barking at the wrong tree". now: migrate=True, fake_migrate=False db.define_table('mi_tabla', Field('f1', 'integer'), Field('f2', 'integer'), Field('f3', 'integer'), Field('f4', 'integer'), migrate='mi_t

[web2py] Re: json insertion error

2014-12-10 Thread Paolo Valleri
Hi, the postgres adapter has been updated since 2.9.4, in addition at least one patch involves json support, see here https://github.com/web2py/web2py/commit/c4a4ee27c42e4e3b2458981888d6db6400657006 I suggest updating web2py Paolo On Wednesday, December 10, 2014 5:52:46 PM UTC+1, Manuele wrot

[web2py] Re: My first web project

2014-12-10 Thread PN
User registration and authentication -- use the auth functionality that comes with web2py by default (see the chapter on Access Control). Create a group called 'Instructor' and if someone is a member of that they get additional functionality (like viewing other users' grades). Use the built-in

[web2py] Re: migrate and fake_migrate

2014-12-10 Thread Leonel Câmara
There's some confusion going on, to make sure everything is correct, follow these steps. 1. Put your models exactly has the database tables are. 2. Do a fake migrate. 3. Remove fake migrate and set migrate=True 4. Do the changes you need in your model. -- Resources: - http://web2py.com - http:

[web2py] Re: How to fix 'list' TypeError with many-to-many SQLFORM.factory and multiple=True?

2014-12-10 Thread Jan Beilicke
Problem solved. My sample approach might help anybody with a similar problem. It might lack some additional checks and optimizations. Please add remarks to improve/simplify the code. I left the model as is and added a separately populated drop-down to the controller and an IS_IN_SET validator i

[web2py] Re: MongoDB and Web2py in Windows

2014-12-10 Thread Massimo Di Pierro
Exactely. The binary version is not supposed to work. It comes with its own version of python therefore it does not see any module that you may have installed. If you want to use modules like pymongo you must install Python, install pymongo, AND run web2py source so it uses your own python versi

[web2py] Re: db.define_table password

2014-12-10 Thread Massimo Di Pierro
Field('password',type='password',requires=CRYPT()) Anyway... implementing authentication logic is very hard. It took us years to get it right (and did we get this right?). I suggest you simply use auth = Auth(db) auth.define_tables() def index(): return dict(form=auth()) and you use and extend

[web2py] Re: db.define_table password

2014-12-10 Thread Massimo Di Pierro
Field('password',type='password',requires=CRYPT()) On Wednesday, 10 December 2014 09:57:30 UTC-6, Oliver wrote: > > where can I read or learn more about defining tables? I'm trying to > convert my password to more encrypted method in web2py. what is the best > way to encrypt password in web2py?

[web2py] Re: How to reuse a form in webpy

2014-12-10 Thread Massimo Di Pierro
The problem in the second code is that f1 = form().process() so f1 is a procesed form but then you call f1.process() again. Also f1 is not returned which means it is not displayed. If it is not displayed it is not processed, and if not processed it is not accepted. This should work: def myform

[web2py] json insertion error

2014-12-10 Thread Manuele Pesenti
Hi *, I get this error just in the production server not in the development one when I try to insert a record to a database table with a json column/field. Traceback (most recent call last): File "/var/www/.../web2py/gluon/restricted.py", line 217, in restricted exec ccode in environment F

[web2py] Re: migrate and fake_migrate

2014-12-10 Thread Jose
if you see the end of sql.log file. On each request try to delete the field. [What I understand is that the definition of the table is stored in /databases/mi_tabla.table] timestamp: 2014-12-10T12:38:51.732946 ALTER TABLE mi_tabla DROP COLUMN f2; timestamp: 2014-12-10T13:25:21.465148 ALTER TABLE

[web2py] Re: AttributeError: 'Table' object has no attribute 'q_type'

2014-12-10 Thread Michael Howard
db.define_table('surveys', Field('title', 'string'), Field('description', 'string'), Field('author', default = get_email())) db.surveys.id.readable = False db.surveys.title.requires = IS_NOT_EMPTY() db.surveys.description.requires = IS_NOT_EMPTY()

Re: [web2py] Get a Web2py cloud instance in less than 30 seconds

2014-12-10 Thread Enrique Conci
Yes, just make sure to access the admin section on https. Enrique On Tuesday, December 9, 2014 7:30:54 PM UTC-3, Pystar wrote: > > my bad. > > On Tuesday, December 9, 2014 11:28:38 PM UTC+1, Niphlod wrote: >> >> checking isn't needed. if you want to access admin is either through >> https or http

[web2py] db.define_table password

2014-12-10 Thread Oliver
where can I read or learn more about defining tables? I'm trying to convert my password to more encrypted method in web2py. what is the best way to encrypt password in web2py? I appreciate you help. my test user table db.define_table('users', Field('first_name', 'text'),

[web2py] Re: How to fix 'list' TypeError with many-to-many SQLFORM.factory and multiple=True?

2014-12-10 Thread Jan Beilicke
Hi, thanks for your remark. I try to avoid the simple option using list:reference as mentioned above in favor of normalization. :) Am Dienstag, 9. Dezember 2014 21:19:28 UTC+1 schrieb Limedrop: > > Hi there, > > The issue you have is that you are mixing a fully normalized solution and > the web

[web2py] Re: MongoDB and Web2py in Windows

2014-12-10 Thread Oliver
I tried binary version. It did not work. Im trying to subscribe to CouchDB or MongoDB online and test it instead running my db local machine. thanks for the help. On Friday, November 28, 2014 6:51:15 PM UTC-5, Massimo Di Pierro wrote: > > Are you using the source version of the binary versio

[web2py] Re: SQLFORM - best method for hide fields and set default values

2014-12-10 Thread Pavel
Set ignore_rw=True may be the way to go. Really thanks for your suggestion, now I see it in the book. -- 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

[web2py] How to reuse a form in webpy

2014-12-10 Thread tahnoon pasha
Hi I'm trying to reuse a form to de-clutter my code. The idea was to create a form class using a SQLFORM.factory with all the validation rules set up and then use it for each view in the module. class form (): ''' USAGE: thisform = form(([clients],defaultc),([portfolios],defaultp),) ''

[web2py] Re: migrate and fake_migrate

2014-12-10 Thread Jose
El miércoles, 10 de diciembre de 2014 13:11:27 UTC-3, Leonel Câmara escribió: > > In this instance you don't want to fake_migrate you actually want to have > migrate=True. Fake migrate is for when the tables defined in the models > already reflect the tables that are really in the database and

[web2py] Re: migrate and fake_migrate

2014-12-10 Thread Leonel Câmara
In this instance you don't want to fake_migrate you actually want to have migrate=True. Fake migrate is for when the tables defined in the models already reflect the tables that are really in the database and you just want to generate the table files. -- Resources: - http://web2py.com - http:/

[web2py] Bitnami vote

2014-12-10 Thread Andrew Buchan
Hi, For those of you who don't know Bitnami, it is ridiculously easy way to deploy all sorts of apps on the cloud. Miles easier than Heroku in my opinion (which is an opinion). Bitnami works with "stacks" which are preconfigured environments and bundled software that you download, run as a vm,

[web2py] Re: Appadmin delete problem

2014-12-10 Thread Anthony
Have you defined any _after_delete functions for the table in question? On Wednesday, December 10, 2014 4:02:58 AM UTC-5, Robin Manoli wrote: > > Hey, > this happens when I try to delete a row from appadmin, or an sqlform: > > Traceback (most recent call last): > File "/web2py/gluon/restricted.p

[web2py] Cheap trick to achieve intellisense/autocompletion

2014-12-10 Thread Andrew Buchan
Hi all, I've found a way to get code completion on global objects such as request, response and db (with all your table definitions and fields!) in IDEs which provide code completion. I've been using this for a while now and have to say it really does speed up my web2py development, so thought

[web2py] Re: How to fix 'list' TypeError with many-to-many SQLFORM.factory and multiple=True?

2014-12-10 Thread Jan Beilicke
I want to note that I will have a couple of additional fields in the intersection table beside the relations, i.e. in the example model components might have certain properties depending on the package: db.define_table('component_package_association', Field('component_id'

[web2py] change standard grid button text

2014-12-10 Thread Manuele Pesenti
Hi *, is there a standard, or easy at least, way to change standard grid button text? Thank you in advance 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/lis

[web2py] Re: SQLFORM - best method for hide fields and set default values

2014-12-10 Thread tim . nyborg
That's the method I use, more or less, as it seems the simplest and most reliable to set defaults. Would it be easier if those fields were writable = False and readable = False in the model, and the other form used ignore_rw=True? You might also put db.registrations.registered_user.default = au

Re: [web2py] Can the web2py validators be used outside of forms?

2014-12-10 Thread desta
Thank you Manuele for the quick answer. Even though I read the documentation I didn't understand that I could do that! Thank you for pointing that out to me. It works great. Thanks again. On Wednesday, December 10, 2014 10:51:22 AM UTC+2, Manuele wrote: > > Off course you can! > > http://web2p

[web2py] Appadmin delete problem

2014-12-10 Thread Robin Manoli
Hey, this happens when I try to delete a row from appadmin, or an sqlform: Traceback (most recent call last): File "/web2py/gluon/restricted.py", line 224, in restricted exec ccode in environment File "/web2py/applications/myapp/controllers/appadmin.py", line 671, in File "/web2py/gluo

Re: [web2py] Can the web2py validators be used outside of forms?

2014-12-10 Thread Manuele Pesenti
Off course you can! http://web2py.com/books/default/chapter/29/07/forms-and-validators#Validators Check out the examples reported in doc for un derstanding the standard behaviour of validators, such as: |>>> IS_MATCH('a')('ba') ('ba', ) # no pass >>> IS_MATCH('a',strict=False)('ab') ('a', None)

[web2py] Re: Dreamhost Passenger setup not working

2014-12-10 Thread Larry Weinberg
On dreamhost I did the following after enabling passenger: I placed all web2py files in root folder of website (not the public folder) e.g. my.subdomain.com/ I copied handlers/wsgihandler.py to passenger_wsgi.py I edited passenger_wsgi.py: Added: import sys import os INTERP =

[web2py] Can the web2py validators be used outside of forms?

2014-12-10 Thread desta
Hi, web2py features some really useful validators. Is it possible to use them outside of forms? For example, lets assume a string that contains comma separated emails as inputted from the user. After splitting the string to extract individual emails, can I use the IS_EMAIL validator to validate