a good job working
on windows*, any other framework has too many problems to run on windows.
So web2py is helping to build the future of Python!
--
*Bruno Rocha - @rochacbruno*
http://github.com/rochacbruno
http://rochacbruno.com.br
http://pythonhub.com
--
Resources:
- http://web2py.com
- http
and medical treatments, I tried but I really
have no time now to develop this.
If anybody can take this, please email me ans I give you access to the
development version of the code on pythonanywhere.
Thanks.
[]'s
---
Bruno Rocha
http://github.com/rochacbruno
http://rochacbruno.com.br
http
post form?
I am in a rush between work and medical treatments, I tried but I really
have no time now to develop this.
If anybody can take this, please email me ans I give you access to the
development version of the code on pythonanywhere.
Thanks.
[]'s
---
Bruno Rocha
http://github.com
I also would like to see Celery, Solr, Elastic Search and other fantastic
tools working with web2py!
I think this is an important issue and I am sure it is completely easy and
possible to make it.
I personally do not like to use the built-in scheduler, so I am using
python-rq (Redis Queue) for
Your decorator is wrong
this
def check_mod_set_active(callee):
if session.active_mod == None:
session.flash = 'No active module selected.'
redirect(URL('mod', 'index'))
else:
return callee
shoud be
def check_mod_set_active(callee):
def wrapper():
if
Hello world from scratch
download web2py and unzip it.
create a new app folder web2py/applications/*hello*
create a model file web2py/applications/hello/*models/model.py
*
# coding: utf-8
from gluon.tools import Auth
db = DAL(sqlite://hello.db)
auth = Auth(db)
auth.define_tables()
after you untar it do a:
chown -R user:group web2py/applications
--
---
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
what is your database engine?
we need to see if the bottleneck is in database side.
Place a {{=response.toolbar()}} in your view and paste here the generated
SQL and timings.
Are you using pagination? how many per page? even with 100.000 records, the
grid should use an offset to limit the
You can customize the web2admin
https://github.com/rif/web2admin
--
---
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
http://stackoverflow.com/questions/9662346/python-code-to-remove-html-tags-from-a-string
--
---
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
Great idea Anthony, CUSTOM can be used in many ways when a builtin
validator does not match the requirements.
I documented this here:
http://rochacbruno.com.br/more-web2py-custom-validators/
@Massimo
Can we include at least the CUSTOM in gluon.validators ?
--
---
You received this message
Cool! but it does not allow the transformation.
class CUSTOM(object):you can use a function or a lambda
to validate or/and transform the field in the way you wantit is
the same as onvalidation and onsuccess form callbacksbut it
can be used per field in models or controller level
You should apply the CRYPT() validator when storing the password
--
---
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
class ANY(object):
def __init__(self, validators):
self.validators = validators
def __call__(self, value):
# validates the value against each validator
results = [validator(value) for validator in self.validators]
# Check if there is an invalid result
I guess the first one is wrong.. to amtch your criteria I think you need
this
class ANY(object):
def __init__(self, validators):
self.validators = validators
def __call__(self, value):
# validates the value against each validator
results = [validator(value)[1]
Finally, I just testes on the shell
*modules/anyvalidator.py*
class ANY(object):
def __init__(self, validators):
self.validators = validators
def __call__(self, value):
# validates the value against each validator
results = [validator(value)[1] for validator in
It gives me the idea of a CUSTOM validator
class CUSTOM(object):
def __init__(self, function):
self.function = function
def __call__(self, value):
# the function should return the error_message or None
return(value, self.function(value))
So the use should be:
A(value.strftime(%d/%m/%Y))
Em 15/02/2013 05:01, Simon Ashley gregs...@gmail.com escreveu:
Traditionally in other field types you could display a null value with an
expression similar to the following:
db.table.datefield.represent = lambda value, row: A(value) if value else
'unknown'
I am on mobile now and I cant ellaborate a good code example, but I can
give you a hint.
db.table.datefield.represent = lambda value, row :
value.strftime(%Y/%m/%d)
grid = SQLFORM.grid(db.table)
so grid will use the represent callback to display the data.
following this example you can do
def
models/db.py
db = DAL(.)
from gluon.tools import Auth
auth = Auth(db).define_tables()
# if forst time running create the new user
if db(db.auth_user).isempty():
password = CRYPT()(12345)[0]
db.auth_user.valdiate_and_insert(first_name=default,
of the standard I require 3 additional
tables + a user table.
So how do you propose I manage this scenario?
On Sat, Feb 9, 2013 at 6:26 PM, Bruno Rocha rochacbr...@gmail.com wrote:
Usually you create a script file in /models/db.py then you define your
tables there, so when starting in shell mode you
Use this one = https://github.com/rif/web2admin
--
---
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
I already suggested in a ticket =
https://code.google.com/p/web2py/issues/detail?id=1103
--
---
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
It needs more tests and contributions...
OPen an issue on github and I am sure we can solve this..
On Fri, Feb 8, 2013 at 5:38 PM, Derek sp1d...@gmail.com wrote:
It shouldn't be the default because it doesn't work for everyone (at
least, it doesn't work for me)
class
https://github.com/mdipierro/web2py-recipes-source/blob/master/apps/04_advanced_forms/web2py.app.star_rating.w2p?raw=true
On Fri, Feb 8, 2013 at 8:52 PM, Michael Gheith gheit...@aol.com wrote:
Hello web2py community :)
I'm trying to implement a simple star rating for my site. I followed the
Usually you create a script file in /models/db.py then you define your
tables there, so when starting in shell mode you pass -M
python web2py.py -S yourapp -M
-M run the models/* files and defines your table as object for you to
access.
Every framework works in this way.
Optionally, you can
Take a look:
http://www.kickstarter.com/projects/1369857650/real-python-for-web-development-featuring-web2py
Why Web2py?
web2py is an open-source web framework for rapid development. You can get
up in running in less than 10 minutes and build a full-featured application
in under an hour. Much
Looks awesome..
I already used the Mongo Data Wrapper (
https://github.com/citusdata/mongo_fdw) to replicate my Postgres data to
Mongo, I will take a closer look on this.
Thanks for sharing.
--
---
You received this message because you are subscribed to the Google Groups
web2py-users
def flash(user): response.flash = Please check your inbox
auth.settings.register_onaccept = flash
On Mon, Feb 4, 2013 at 12:12 PM, António Ramos ramstei...@gmail.com wrote:
How can i have a flash message telling the user to check and validate the
link sent to the user email?
without a flash
You can also use Redis Queue
http://rochacbruno.com.br/web2py-and-redis-queue/
--
---
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
WingIDE is the only one that I used and worked out of the box without the
need of hacks or plugins.
On Fri, Feb 1, 2013 at 2:37 PM, Alec Taylor alec.tayl...@gmail.com wrote:
Can we bring up a community wiki page for this?
For editing web2py apps, I have personally used: Eclipse, Geany,
Since you have the indexes created on DB backend, The DAL will use this for
any query on that table, because the output of .select() is in fact a pure
SQL statement.
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this
I would use sendgrid.com and its awesome newsletter API, alsoi sendgrid
takes care of spamming protection.
I wrote an module to interact with send grid through the API
https://github.com/rochacbruno/pysendgrid
But if you really want to use your own structure you should have a table
with email,
I guess you can try
{{=IMG(_src=plotimg)}}
or
img src={{=plotimg}} /
--
---
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
I think the problem may be the session preventing the duplicate submission
of the same form data.
--
---
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
“The Software shall be used for Good, not Evil.”
I like it! we should adopt it in web2py. The problem is to difference what
is good from what is Evil so I think this license has no meaning.
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
Is there the option to put the gluon folder on your site-packages or
dist-packages folder
Or maybe, start web2py in shell mode?
--
I think it is ok to have different dates on each places.
Each country/place can do in preferred data since it is in the same week.
Lets say:
place_here - May 16 (Thu)
place_here - May 17 (Fri)
Chicago - May 18 (Sat)
Brasil - May 19 (Sun)
Of course we can have more than one place at the same
is it SQLite? did you changed required from True to False?
SQLite does not have ALTER for column type and constraints.
Em 26/01/2013 10:04, __pyslan__ - Ayslan Jenken ayslan.pyt...@gmail.com
escreveu:
My models:
LogrType = db.define_table('logr_type',
Field('name', notnull=False,
I think both are bad! specially by the fact that the largest web2py
audience is not native English speaker, this kind of sentence should be
more explicit.
web2py takes care of main security issues, so developers have little...
--
I can think on two options.
*1. Unique Key*
db.define_table(table,
Field(table_a, reference table_a),
Field(table_b, reference table_b),
Field(unikey, unique=True, notnull=True, compute=lambda row:
%(table_a)s-%(table_b)s % row)
)
*2. Form validator*
def check_unique(form):
if
the grid has onvalidation argument.
SQLFORM.grid(..., onvalidation=check_unique)
--
Go to admin interface and click in Pack All: it generates a .w2p package.
Or just go to your shell and $tar -cvf myapp.tar.gz /path/to/my/app
If you want some more specific package system maybe it is better to put
your app in github and use Fabric, Puppet, Cheff, BUildout or other tools
like
def myfunc(form):
# here you get form.vars
auth.settings.register_onaccept = myfunc
Em 24/01/2013 06:24, Yebach vid.og...@gmail.com escreveu:
Hello
After a new user registers, I would like to send his data to my email
(user email and database where it was created)
I have user requires
auth.setting.register_onaccept = lambda form: mail.send(to=['x...@xxx.net'],
subject='web2py registration',
# If reply_to is omitted, then mail.settings.sender is used
reply_to='u...@example.com',
message= u'A new user has been created on database %s and has
auth.settings.verify_email_onaccept = lambda user:
mail.send(to='antonio.ra...@cires.pt',subject='Conta pendente de
Aprovação. Portal Empreiteiros',message=repr(user))
--
auth.settings.verify_email_onaccept = lambda USER:
mail.send(to='antonio.ra...@cires.pt',subject='Conta pendente de
Aprovação. Portal Empreiteiros',message=repr(USER))
--
The web2py on PyPi should be a meta-package, in setup.py it should download
the latest version from website and include on users site-package.
--
On Thu, Jan 24, 2013 at 9:34 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
How?
http://peak.telecommunity.com/DevCenter/setuptools#automatic-script-creation
--
return dict(register=auth.register() , login=auth.login())
{{=register}}
{{=login}}
Em 23/01/2013 20:39, sasogeek sasog...@yahoo.com escreveu:
how do I put the login and register forms on one page... so that a user is
logged in if they click the login button (if they've entered correct email
On Tue, Jan 22, 2013 at 3:09 PM, Richard Vézina ml.richard.vez...@gmail.com
wrote:
Does Model Less approach still relevent with the new lazy table feature??
No need to use this module based approach (unless you want), now with
lazy_tables it is better to use the standard ways to avoid extra
Issues page on google code: https://code.google.com/p/web2py (issues menu)
Develpers list: web2py-developers on google group
--
maybe the virtual fields?
--
in your models.
mail = auth.settings.mailer
mail.settings.server = your_smtp_server_and:port
mail.settings.sender = y...@you.com
mail.settings.login = y...@you.com:password
# sends an verification e-mail upon registration
auth.settings.registration_requires_verification = True
def
IS it SQLITE?
Sqlite dos not implements ALTER TABLE for column properties, if you created
the model with n length and so changed it later, sqlite does not respect
this.
It is a sqlite problem.
*if another database, so can be a dal problem
On Mon, Jan 21, 2013 at 11:43 AM, www.diazluis.com
I think the max is the first because you can ommit the second.
IS_LENGTH(10) will allow max 10. No need to inform the second.
But I agree this is odd.
--
include hidden fields
hidden id=customer name=customer
the use Javascript to populate
$('#customer').val(something)
--
SQLFORM expects a field named fences_customer the pattern is
tablename_fieldname
--
There is no official approach, testing is being an issue for a long time,
there was a project called web2py test runner, but the maintainer abandoned
the project.
If you can contribute with something on this subject, your contribution
will be very welcome.
The main problem of testing is the fact
``
htmlbodyHello World/body/html
``:code_html
``
print hello world
``:code_python
On Tue, Jan 22, 2013 at 1:50 AM, Ignacio Ocampo naf...@gmail.com wrote:
How I can use code tag with Markmin? Thank you.
--
--
``
Your code here
``
for testing: http://web2py.com/markmin
--
for this I thinnk you sould use extra render.
{{text = `` here is my code ``:pre_with_code}}
{{=MARKMIN(text, extra={pre_with_code: lambda text:
precode{0}/code/pre.format(text)})}}
Tested on shell
In [4]: text = `` here is my code ``:pre_with_code
In [5]: print MARKMIN(text,
Ok, problem fixed
Updated here: https://bitbucket.org/rochacbruno/powerformwizard/downloads
Live example here: http://www.web2pyslices.com/formwizard
--
http://docs.python.org/2/library/pickle.html
http://python.about.com/od/pythonstandardlibrary/a/pickle_intro.htm
--
Is it the web shell? (if yes, its buggy)
--
://labs.blouweb.com/PowerGrid
Need help, contribution, test..
[]'s
--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno** ]
--
--
auth = Auth(db, controller=foo, function=bar)
--
db.files.validate_and_insert(file_upload=db.files.file_upload.store(fileApp,
filename))
it should fire the validator (I guess)
--
There is this Slice:
https://www.web2pyslices.com/slice/show/1427/single-form-for-linked-tables
--
webfaction
openshift
linode
--
BTW:
PythonAnywhere is fantastic! the consoles, the way it integrates with
Dropbox etc... the support also is very helpful.
Have you tried to contact them?
https://www.pythonanywhere.com/ (click on the send feedback link)
maybe the guys can give you an option instead of paypal.
On Sat, Jan
On Thu, Jan 17, 2013 at 5:39 AM, damien rompapas hlvro...@gmail.com wrote:
I am sorry if the question is not clear enough.
Yes it is not clear :)
are you trying to create a table inside a table? it is not permitted on
relational dbms. (are you using NOSQL)?
I think you want to create
Wow, Now I see my example completely wrong..
should be
db.define_table('post',
# more fields here
Field('thoughts', reference Thoughts)
)
db.define_table('Thoughts',
Field('Editedby', db.auth_user, default=None, readable=True,
writable=True),
Did you read the book? I recommend chapters 3, 4 and 6
Plus the Ajax one: http://web2py.com/books/default/chapter/29/11
--
controllers/article.py
#http://./article/add
def add():
form = SQLFORM(db.article).process()
return dict(form=form)
#http:///article/edit/1
def edit():
article_id = request.args(0) or redirect(URL('index'))
form = SQLFORM(db.article, article_id).process()
return
models/foo.py
# the thing table
db.define_table(thing, Field(name))
# you may want to store likes on another table so you never allow a user to
like the same thing twice
db.define_table(thing_likes,
Field(user, reference auth_user, notnull=True),
Field(thing, reference thing,
printing where?
on the console it should work!
ON web response you need to use HTML or CSS to break
{{=variable_returned_by_controller}} br /
or
def action():
string = (
Line 1 br
Line 2 br
)
return string
or even better if you define in a template and use p, br
On Tue, Jan 15, 2013 at 6:20 AM, Daniel Gonzalez gonva...@gmail.com wrote:
IS_NOT_IN_DB(db, '%s.email' % (web2py_user_table))
If you too many records on user table, the above code will take a long
time, because on every request it will select email from auth_user
--
It will run only when called!
But if he is testing a form, the problem maybe there.
There are some imports?
--
You need to write to response
{{=crud.select(db.HumanLanguage, fields=['languageName'],
headers={'HumanLanguage.languageName': 'Language Name'})}}
or
{{response.write(crud.select(db.HumanLanguage, fields=['languageName'],
headers={'HumanLanguage.languageName': 'Language Name'}))}}
--
web2pyslices source code:
https://github.com/rochacbruno/Movuca
Ckeditor module
https://github.com/rochacbruno/Movuca/blob/master/modules/plugin_ckeditor.py
Ckeditor static files
https://github.com/rochacbruno/Movuca/tree/master/static/plugin_ckeditor
The plugin
I think that for doing this you should modify response.render to a
specialized function.
def my_response_render(*args, **kwargs):
# here you have to implement what you need
# and then do the normal response.render
in models/db.py
response.render = my_response_render
In that way
for table in db.tables:
db[table]_common_filter = lambda query: db[table]is_active == True
--
little fix.
On Fri, Jan 11, 2013 at 3:21 PM, Bruno Rocha rochacbr...@gmail.com wrote:
for table in db.tables:
db[table]._common_filter = lambda query: db[table].is_active == True
--
put in
web2py/applications/YOURAPP/static/css/yourcssfile.css
refer with
link href={{=URL('static', 'css', args='yourcssfile.css')}}
../
--
I understood as 1 or 2 devs...
or it is a half time developer?
--
Maybe a developer who read 1/2 of the web2py book :) LOL
--
On Fri, Jan 11, 2013 at 9:05 PM, Dave Cenker dave.cen...@gmail.com wrote:
However, this returns a list of company IDs instead of names and when I
try to do something like this:
db(train.company.id == id) it doesn't work.
should be
db(db.train.company == is)
What I'd really like to do is
form['_class'] = 'foo'
it should work
or even
form.elements('form')[0]['_class'] = 'foo'
--
Are you suggesting have a form for end users submit tickets for app
developer
or
inside /admin have a form for app developer submit a ticket to web2py
developers
?
--
On Thu, Jan 10, 2013 at 10:30 PM, Alex Glaros alexgla...@gmail.com wrote:
*views/default/mytable_manage.html*
look in controllers/default.py inside this file there is a function called
mytable_manage
--
Please read the chapter 3 and 4 (overview and the core) those things will
be very clear after you read few lines.
http://web2py.com/books/default/chapter/29/03#Overview
On Thu, Jan 10, 2013 at 10:50 PM, Alex Glaros alexgla...@gmail.com wrote:
The index.html page doesn't have much in it...so
I create some videos!
(currently I have 308 web2py videos on my VIMEO account)
But, it is all in Portuguese and major part of them are exclusively for my
students.
+1 for a video contest!
Example of my on line web2py classes.
A complete introduction to web
On Thu, Jan 10, 2013 at 3:09 AM, b00m_chef roman.goldm...@gmail.com wrote:
requires=IS_IN_DB(*db(db.owner.user == auth.user.id)*, 'owner.id',
'%(name)s')
--
I am using this recipe:
http://www.web2pyslices.com/slice/show/1522/generate-a-thumbnail-that-fits-in-a-box
I have plans to integrate it with a JavaScript Cropper plugin to get the
dimensions.
--
on the impressive *magick libraries, but
this one being a ctypes implementation is light and fast enough..
mic
2013/1/8 Bruno Rocha rochacbr...@gmail.com:
I am using this recipe:
http://www.web2pyslices.com/slice/show/1522/generate-a-thumbnail-that-fits-in-a-box
I have plans to integrate
I have a single server, ubuntu 12.04 running 3 web2py instances + 2 php
wordpress websites
Php runs with fcgi - web2py runs with uwsgi, because of that I have 12
nginx workers running
I am not an expert on this, but this solution is working well for me.
That is what I have in top
*TOP*
top -
and youi delete or comment that file?
--
Ok, but just read this
# User-made changes in this file will be silently lost, as it is silently
# rewrited with upgrade of uwsgi package.
#
# If you want to change default options of uWSGI daemon, then:
# * copy this file somewhere
# * add/remove/change options in copied file
# * edit
are you running on Google App Engine?
--
1 - 100 of 2316 matches
Mail list logo