assuming your webserver user is www-data and desired password 123456
cd path/to/web2py
sudo -u www-data python -c from gluon.main import save_password;
save_password('123456',443)
--
In my experience working with this I fired out that it is better to use
haversine directly on database, you can find haversine functions for
MySQL, Postgres and even for SQlite.
I dont know how one can write haversine with DAL api, but you can do it
with executesql() as you are going to turn this
IS_IN_DB receives a cache parameter so you can do
db.table.field.requires = IS_IN_DB(, cache=(cache.ram, 1800))
For that number of records I would use an ajax widget with endless scroll.
(http://ivaynberg.github.com/select2/#infinite)
--
You can do something like this:
In [17]: request_vars = {'table[0][]': ['1', '2'], 'table[1][]': ['3',
'4']}
In [18]: table = request_vars.values()
In [19]: table[0]
Out[19]: ['1', '2']
In [20]: table[1]
Out[20]: ['3', '4']
or to be sure about the sequence.
In [25]: request_vars =
Trunk means the most recent devel version from git or hg, it is unstable
but issues are fixed very quickly
git clone https://github.com/web2py/web2py
hg clone https://code.google.com/p/web2py
--
I just looked at the code but I cant see how did you solved this, I am
having the exact problem on another custom widget.
I want a field where users will put recipe ingredients separated by new
lines
*The field*
Field(ingredients, list:string, requires=LINE_SEPARATED_LIST(),
I did that, a modal for field details... I did a pull-request with this,
maybe you can improve the design.
--
I did the modal part, now need to do the shortcuts.
also as you are working on mult-db support, the code may change a little.
look:
[image: Inline image 1]
[image: Inline image 2]
--
Your call, also if you prefer to take the modal logic from modules/server
side DOM on to HTML template it is easy to change.
I just created as Server side DOM because it can be reused.
--
I am using the default multi-select and this
http://ivaynberg.github.com/select2/
--
I have the exact same problem, but it is with tags widget.
I tried a lot but did not found the way to solve it :/
BEFORE VALIDATION ERROR:
[image: Inline image 1]
AFTER VALIDATION ERROR
[image: Inline image 2]
--
And data-clips are amazing feature!
https://postgres.heroku.com/dataclips/icuwejkuecgtzhbdtcpeomdakcyg
--
This one:http://ivaynberg.github.com/select2/#infinite
It is easy to implement, just a default text box and you bind this.
--
What do you have in your view? are you using any JavaScript to manage the
form submission?
--
There is Pyodel (learning tool), I dont know about the status of QAStak and
PyForum.
@rif what about multiple databases and databases named differently?
your code expects a db object, so I think you can put on the models a
config variable for dbs
plugin_web2admin_dbs = [db, other_db,
@rif I have some suggestion
Screenshot: http://i.imgur.com/3t2kv.png
For the suggested [fields] buttom it can be done with a modal or popup, it
can loads a table style=display:none; id=tablename_fields inside the
popup or modal, or if prefered it can retrieve this info via ajax.
To retrieve
I noted that this happens with memcached too.
type 'exceptions.AttributeError' 'list' object has no attribute 'find'
My cached .select(cache=(cache.memcache, 1200)) is retrived as a list.
Function argument list
(menus=[Row {'show_order': 0, 'parent': 1, 'title': 'Co...2, 6, 3, 18, 20,
21),
You can read the read-only or hidden fields from the form directly on
request.vars, instead of form.vars use request.vars and it should work.
--
The ajax function:
ajax(
url, # here you set a string to a complete url, it can include args
and vars
[], # form inputs, if you have a form on the page you can set
['name', 'email'] if you do not have a form set it to null
target, # an id of any html element where you want the
*Create this function in some model*
*
*
*def new_user(first_name, last_name, email, passw):
**users = db(db.auth_user.email==email).select()
**if users:
**return users[0].id
**else:
**my_crypt = CRYPT(key=auth.settings.hmac_key)
**
Yes, it raises the same error when using cache.disk, so I think for now we
should include a note on /book.
and I will try to emulate the .find .exclude and .sort externally using
listcomprehension or map.
--
The same problem without cacheable
--
Ok, changing all my selects to cacheable=False it works on .disk, redis and
memcache.
Even on the rows where I am not using the .find() and .exclude() methods
the cache are failing.
If do
{{for row in cached_rows:}}
{{pass}}
it gives me nothing..
Also {{if cached_rows:}} returns always
I would like to have a repo of scaffold apps and a command line tool +
/admin tool to checkout
ADMIN - create new app - SELECT(*['simple', 'bootstrap', 'foundation',
'ecommerce', 'tuned',..long list])
and on command line
python web2py.py -S newappname*|*foundation
downloading
also it will need on admin BUTTON('update scaffold list') and in command
line web2py.py -S updatescaffold
--
Nice work!
the select2.js is the same as choosen? I really like it! should have a
web2py widget for this.
SUGGESTION:
it is very annoying to request host/app/plugin_web2admin the url does not
looks good. To change this, the hard option is tricking on routes. But
there is an easy way:
NOTE: it
This plugin for Bootstrap looks very nice for response.flash
http://pinesframework.org/pnotify/
--
for that cases shouldn't use _before_insert and _before_update triggers?
--
db.define_table('likes',
Field('username', 'reference auth_user'),
Field('songname', 'reference songs'),
Field('playlist_name', 'reference playlist'),
Field('unique_key', unique=True, notnull=True, compute= lambda row:
%(username)s-%(songname)s-%(playlist_name)s),
)
Now on any
The computation should be
compute= lambda row: %(username)s-%(songname)s-%(playlist_name)s % row
--
I did some changes on Movuca, but I still have to solve little issues in
order to commit.
But I just commited a workarounf for the problem:
https://github.com/rochacbruno/Movuca/commit/aa25103e9c37921a34a225b8e82ca0f8634ca831
--
if the package is in your Python wen2py have to see this..
you can try inside web2py code (i.e models)
import sys
sys.path.append(/path/to/installed/package)
Have you restarted web2py since you installed the module?
On Mon, Sep 10, 2012 at 4:52 PM, monotasker scotti...@gmail.com wrote:
I'm
If you are running on webfaction, maybe it is under apache and mod_wsgi, so
you need to restart Apache to reload the mod_wsgi.
$service apache2 restart
or
$/etc/init.d/apache2 restart
(but you need to check if it is running apache, nginx or other)
--
Here is the solution:
https://github.com/rochacbruno/web2py_model_less_app/blob/master/modules/myapp.py#L82
That approach subclasses DAL so it need to include _lazy_tables = {}
But, now that we have lazy_tables in default DAL, I recommend you to use
the default web2py scheme with
Maybe we can put a dropdown select and adjust the prefered editor using
cookies in the same way we do with the admin language?
So it will be easy to switch from codemirror to ace and no need to edit the
0.py
On Sun, Sep 9, 2012 at 4:35 PM, Marin Pranjić marin.pran...@gmail.comwrote:
It is not
On Sun, Sep 9, 2012 at 9:27 PM, Andrew W awillima...@gmail.com wrote:
(although I still don't quite really understand what a lazy table is).
imagine you have
models/db.py
db = DAL(...)
db.define_table(table1.)
db.define_table(table2.)
...
...
db.define_table(table30.)
So, for
maybe this?
form = SQLFORM.factory(
Field('test',
type='string',
requires=IS_IN_DB(*db(db.table.field == xyz)*, db.city.name_url,
'%(name)s', multiple=True),
widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v,
style='divs'),
default = 'New-York'),
I am using:
cache_key = %s_%s_%s % (query, start, end)
total, rows = cache.ram(cache_key, lambda: (db(query).count(),
db(query).select(limitby=(start, end), cacheable=True)), 3600)
Should I put a dummy cache=(...) just to have the benefits?
--
Thats great! I started using codemirror on another project and I find it
awesome.
I will update from trunk now and test in Ubuntu..
--
code mirror works ok for me in chrome, opera and firefox (ubuntu).
--
Let's create a virtual-env with Python 2.7 and it will not be a problem.
--
that should be under */views/default/contribuyentes.html*
On Thu, Sep 6, 2012 at 4:48 PM, ocascante oscarcascantefons...@gmail.comwrote:
Hi, i am new in web2py.
I have web2py 2.07 installed in my linux mint 13 computer. I used the
script available in google to install it.
Now, i have a
db(db.table.field == None).select()
should give you all records with field = NULL
db(~db.table.field == None).select()
All records where field NULL
Is that?
--
On Wed, Sep 5, 2012 at 3:12 PM, Marin Pranjić marin.pran...@gmail.comwrote:
it is db.table.field != None
operator ~ is used for ORDER BY and it maps to DESC.
Yes, my bad, you are right, but there is one case where ~ is used in query
~db.table.field.belongs(list) and
Your URL should have the vars
url: /test01/default/getContent?sourcetitle=xxx
If you do not pass the vars on url you can't get them at the called
controller
--
or you call it with .json extension and use the generic json view
url: /test01/default/getContent*.json*?sourceTitle=x
or you do this on the return
import json
def getContent():
titleArg = str(request.vars.sourceTitle)
print --
print
You can do:
if request.args(0) in ['edit', 'delete']:
STORE_DETAILS.id == int(request.args(2)) or redirect(URL('default',
'wherever'))
db.pages.stores_id.default = STORE_DETAILS.id
query = ((db.pages.stores_id == STORE_DETAILS.id))
form = SQLFORM.grid(query=query)
That is just a RSS reader with local storage for favorites, read/unread
etc..
--
Small question..
cache.ram.clear(regex='*') will clear the whole cache?
--
So I assume cache.ram.clear() will do the job ?
--
There is a free option..
I manage the web2py facebook page, (also Massimo and Anthony are added as
co-managers), facebook can tweet automatically from page -- twitter.
So we can add more people to page management and all publications by page
will go to twitter.
Just need to enter there, go to
this:
def validate_my_form(form)
if form.vars.channel == foo:
form.errors.channel = This channel is not valid
if form.process(onvalidation=validate_my_form).accepted:
# do whatever here
*Bruno Cezar Rocha** - @rochacbruno*
rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821
www.facebook.com/web2py
--
cache.ram or even better (memcached) is preferred! if you use session and
your sessions are stored on filesystem, if you have too much data it will
be hard to load on each request.
DATA = cache.ram(request.http_host, lambda: db(..).select(cacheable=True),
86400) # keeps for 24 hours.
Now, on
Martin, I am doing the same for portuguese.
Which number did you named your spanish version?
36-spanish-work-in-progress ?
I forked and I will put a 37-portuguese-work-in-progress
On Mon, Sep 3, 2012 at 4:27 PM, Martín Mulone mulone.mar...@gmail.comwrote:
I know but it's not in markmin, and
FYK:
The portuguese will be done by a community, so we are tracking the statuses
on this file:
https://github.com/rochacbruno/web2py-book/blob/master/sources/37-web2py-portuguese-work-in-progress/translation_status.md
Maybe someone can follow the pattern...
--
You can use http://feeds.feedburner.com/web2pyslices as source for
automatic posts...
also it would be nice to include web2py.com/download/changelog.rss (create
it) and use as source to tweet automatically when change log gets updated.
It can also be done with github commits (you can integrate the
I guess it can help you to discover the problems:
http://nicolargo.github.com/glances/
(I would like to have a web-socket version of that app)
--
If you have access to files (ssh or ftp) you can try to edit this line
File ...web2py/applications/admin/controllers/default.py
https://192.168.1.102/admin/default/edit/admin/controllers/default.py,
line 113, in check_version
+ XML(' strong class=upgrade_version%s/strong' % version_number)
I think you can use cache.
user_data = cache.ram(user_data_%s % auth.user_id, lambda :
dict(field=value, field=value), 86400)
--
Server side DOM.
An example:
mysubmitbutton = form.elements('input[type=submit]')[0]
mysubmitbutton[_value] = GO
mysubmitbutton[_class] = btn btn-primary
Other example, if you want to change the class of all input objects.
inputs = form.elements(input')
for input in inputs:
input['_class']
This should work..
# On models
class SQLFORM(SQLFORM):
''' Customized SQLFORM '''
def __init__(self, *args, **kwargs):
kwargs.setdefault(formstyle, divs)
super(MySQLFORM, self).__init__(*args, **kwargs)
On Sun, Sep 2, 2012 at 8:11 PM, vinicius...@gmail.com
There is markmin2pdf and markmin2html on gluon.contrib
https://github.com/web2py/web2py/tree/master/gluon/contrib/markmin
--
It is running web2py 1.99.7, is there a way they upgrade to 2.0.5 ?
*Bruno Cezar Rocha** - @rochacbruno*
rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821
www.CursoDePython.com.br | www.rochacbruno.com.br
Blog: Using Python to get all the external links from a
Include this:
[ ] Rows.find(lambda row: bool(), limitby=(0,1))
--
Also mention that this
[x] new syntax: db.mytable.insert(myuploadfield=open()), thank you
Iceberg
Now works as:
[ ] db.table.myuploadfield.default = open()
--
Yes!
You have some options:
1 Use sqlite locally, use rocket server (built-in), use py2exe to pack your
app as a windows application .exe, or py2app to pack as apple application.
Take a look on to this:
http://web2py.com/books/default/chapter/29/14#How-to-distribute-your-applications-as-binaries
did you turned lazy_tables to True on your db definition?
Bruno Rocha
http://rochacbruno.com.br
mobile
Em 31/08/2012 10:02, Jim S j...@qlf.com escreveu:
Getting the following:
Traceback (most recent call last):
File C:\dev\web2py\gluon\restricted.py, line 209, in restricted
exec
There is something here: http://ubuntuforums.org/showthread.php?t=1636667
On Fri, Aug 31, 2012 at 7:02 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
Address already in use: make_sock: could not bind to address [::]:80
--
I cant understand how versioned folders would help on this case? I ran on
to this issue a long time ago and I ended using pure html for this.
script src={{=URL('static', 'js',
args='mylib.js')}}?{{=get_random_number()}}
This works for me when I need to bypass the cache to get the proper js
Without OAuth and permissions I only can see one way.
The twitter url for tweets is:
def tweet():
tweet_url =
https://twitter.com/intent/tweet?original_referer=%(referer)srelated=%(related)ssource=%(source)stext=%(text)s
form = SQLFORM(db.tweets)
if form.process().accepted:
I tested this on a project (maybe web2py version -1.97)
response.files.append(URL('static', 'css', args='myfile.css',
vars=dict(v=get_random(
I dont know if it is working now, but I used the plan html for doing this.
--
It is only possible if you have implemented OAuth and user gave access
permission for your application.
--
How are you defining the db connection? are you using models or modules?
which db?
--
I think it is now working, I checked the source and there is:
if isinstance(item,str):
f = item.lower().split('?')[0]
if f.endswith('.css'): s += css_template % item
elif f.endswith('.js'): s += js_template % item
elif
Which version of web2py? which version of windows?
BTW: You have not to install web2py, web2py is executable, no need to
install!
If you downloaded the windows version .exe you just need to run it (if it
is not working, please tell us your version of windows and web2py)
If you download the
TICKET ID
127.0.0.1.2012-08-31.01-09-21.3e3284ec-20dd-4076-9a0b-889f72a85cf7
type 'exceptions.RuntimeError' Failure to connect, tried 5 times:
Traceback (most recent call last): File
/home/bcr/projects/web2py21/gluon/dal.py, line 6722, in __init__
self._adapter = ADAPTERS[self._dbname](*args)
Reverted to old checkout and it worked again, so the passwd it not wrong..
On Fri, Aug 31, 2012 at 1:41 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
I do not think this is related. Sure this worked before? Looks like
legitimate wrong password.
On Thursday, 30 August 2012
Now I got this:
bcr@vaiubuntu:~/projects/web2py203$ python web2py.py -a 1234
Traceback (most recent call last):
File web2py.py, line 18, in module
import gluon.widget
File /home/bcr/projects/web2py203/gluon/__init__.py, line 15, in
module
from globals import current
File
3 of them are hosted on my server. unfortunatelly I got problems migrating
my VPS and I am working on this.
Bruno Rocha
http://rochacbruno.com.br
mobile
Em 31/08/2012 02:25, Jemes Hsu jemes...@gmail.com escreveu:
--
You can use template render
from gluon.template import render
html = b{{=name}}/b {{for x in range(10)}} Hellobr {{pass}}
print render(content=html, context=dict(name=Bruno))
On Wed, Aug 29, 2012 at 1:14 PM, lucas sjluk...@gmail.com wrote:
ok, that is fine for simple code execution, but
for label in form.elements('label'):
label[_style] = display:none;
On Wed, Aug 29, 2012 at 2:47 PM, Alec Taylor alec.tayl...@gmail.com wrote:
How do I remove labels from forms?
I want to use placeholders instead...
(this is for the auth.register form)
Thanks for all suggestions,
there be a loop I can add before that to set the
placeholder of each input?
On Thu, Aug 30, 2012 at 3:58 AM, Bruno Rocha rochacbr...@gmail.com
wrote:
for label in form.elements('label'):
label[_style] = display:none;
On Wed, Aug 29, 2012 at 2:47 PM, Alec Taylor alec.tayl...@gmail.com
I generally do this on user function:
profile_fields = ['first_name', 'last_name', 'email', 'description',
'picture']
if 'profile' in request.args:
for field in db.auth_user.fields:
if field not in profile_fields:
db.auth_user[field].readable =
can you show the code?
I am using
db.table.field.compute = lambda row: row.otherfield
On Wed, Aug 29, 2012 at 4:09 PM, Daniel Gonzalez gonva...@gmail.com wrote:
Hi,
I have recently updated trunk.
I am using a compute function when creating new entries. In the compute
function I access
For me on Linux Ubuntu 12.10
bcr@vaiubuntu:~/projects/web2py21$ python web2py.py -S welcome -N -R
../thisfile.py
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2012
Version 2.00.1 (2012-08-28 14:26:44) rc4
Database drivers available: SQLite3, pymysql, psycopg2, pg8000, IMAP
- You can use conditional models.
- You can use IF on models
if not request.controller == public:
# my logic goes here
- You can go to the option B (simple separate app)
- You can serve the login form as static html file
http://yourapp/static/public.html
- You can use
To solve this issue include in the line 88 of myapp.py
https://github.com/rochacbruno/web2py_model_less_app/blob/master/modules/myapp.py#L88
self._LAZY_TABLES = []
On Mon, Aug 27, 2012 at 11:33 PM, Andrew awillima...@gmail.com wrote:
Possible Issue, this might be due to the dal changes (or
def show():
item_id = request.args(0)
item_slug = request.args(1)
query = (db.items.id == item_id) (db.items.slug == item_slug)
item = db(query).select().first()
return dict(item=item)
http://myapp/items/show/1/awesome-product
http://myapp/items/show/2/awesome-product
On
examples images has 1.1 MB, examples static has 1.9MB
On Sun, Aug 26, 2012 at 8:46 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
According to this the web2py size doubled in Oct 2011 yet I cannot think
of what caused this.
Can anybody help figure it out? What did we include that
Martin,
what about a twitter bootstrap plugin?
we can create a plugin to inject bootstrap specific helpers.
THUMBNAILS(), POPOVER(), MODAL(), PILLS() also a bootstrap manager.
{{=bootstrapmanager(v=2.1, js=True)}}
So it will be app agnostic.
what do you think about?
Em 24/08/2012 08:37,
can you try changing db.bookpage to reference bookpage
Em 24/08/2012 13:01, Niphlod niph...@gmail.com escreveu:
There is something else going on. This is the log (no errors creating
tables) of the following model on mysql 5.5. web2py trunk (but at least on
table creation nothing should have
You should see Rad2py, created by Mariano Reingart
http://code.google.com/p/rad2py/
On Fri, Aug 24, 2012 at 6:14 PM, Christian Espinoza chespin...@gmail.comwrote:
Hello guys,
There are somebody with some experience using wx instead of a web view
layer??
I have some questions about
this: http://code.google.com/p/gui2py/
--
On Thu, Aug 23, 2012 at 3:11 PM, Anthony abasta...@gmail.com wrote:
I'd also still be interested to see a real-world example of where this
would be useful.
Anthony
Someone posted an example of GAE CPU Cycles, with class based Lazy Tables
it lower to half cycles. Also there is another user
Great!
This new navbar is very better! Thank you Martin!
On Thu, Aug 23, 2012 at 3:48 PM, Martín Mulone mulone.mar...@gmail.comwrote:
Twitter Bootstrap scatfolding application *updated.
Now is awesome :-P
* Now based on version 2.1.0 (sync)
* Menu based on twitter bootstrap navbar
Put
z-index: 0;
on flash alert
On Thu, Aug 23, 2012 at 4:05 PM, David Marko dma...@tiscali.cz wrote:
The alert 'Well done! ...' conflicts somehow with menu when you click e.g.
on 'Bootstrap' menu item ...
Dne čtvrtek, 23. srpna 2012 20:48:03 UTC+2 Martin.Mulone napsal(a):
Twitter
Considering this:
def details():
try:
equipment = db.equipment[int(request.args(0))]
except:
equipment = db(db.equipment.slug == request.args(0)).select().
first()
return dict(equipment=equipment)
Your view details.html should be
h1{{=equipment.title}}/h1
web2py version??
On Thu, Aug 23, 2012 at 10:00 PM, pylix pyl...@gmail.com wrote:
Here's my model
db = DAL('sqlite://storage.sqlite')
db.define_table('person',
Field('name', requires=IS_NOT_EMPTY()),
Field('phone', requires=IS_NOT_EMPTY()),
Field('address',
Is not an option to create a new branch?
keep the current /gluon/* in the default branch and the optimized one in a
separate branch, available only for those who want to use Python 2.7.3+
On Wed, Aug 22, 2012 at 10:28 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
We run into a major
201 - 300 of 2316 matches
Mail list logo