is to minimize the number of changes
to db.py. I know I will need to change the line which instantiates Auth to
use MyAuth.
Does anyone have suggestions on how to organize models and customizations
to Auth?
Thanks.
Carlos
--
Bruno Rocha
[http://rochacbruno.com.br]
Field('user_id', 'integer', default=auth.user_id)
or
Field('user_id', 'reference auth_user', default=auth.user_id)
http://zerp.ly/rochacbruno
Em 29/11/2011 09:23, thodoris pasxi...@gmail.com escreveu:
Hello,
Simple question:
auth.user.id returns an integer
but if i define a field in a
is the user logged in?
http://zerp.ly/rochacbruno
Em 29/11/2011 12:51, lyn2py lyn...@gmail.com escreveu:
Here's the code:
#model
db.define_table('discussion',
Field('title', 'string', length=255, required=True),
Field('description', 'text', required=True),
Field('created_by',
I am sure it is not ckeditor because I tested without it.
may be it is a problem in current or in custom_importer.
note that my form is built in a module.
I will try to build the form in controller for test.
thanks again.
http://zerp.ly/rochacbruno
Em 29/11/2011 12:02, DenesL
500 categories and counting.
How it would be the best approach to make this list to load in the HTML
really quick?
Loading this long list takes considerable time especially on mobile
devices where the browser is slow.
--
Bruno Rocha
[http://rochacbruno.com.br]
I found that the problem is somewhere in the new welcome layout. some lib
there is changing the form encoding.
If I try with .load
http://labs.blouweb.com/movuca/article/show.load/2/vegetarian-cheese
The comments works ok with any browser.
Now I have to find what lib or html tag is doing that,
Finally the problem is solved, and it has not to be with web2py.
I am using jqm (Jquery Modal Plugin)
The sample code has
div class=jqmWindow id=photomodal
a href='#' class=jqmClose{{=T(Close)}}/a
br /
img class=photo jqmClose src= /
This was the issue:
http://www.nczonline.net/blog/2009/11/30/empty-image-src-can-destroy-your-site/
and
http://www.nczonline.net/blog/2010/03/16/empty-string-urls-in-html-a-followup/
://9.web2pysite.appspot.com/examples
The new website: www.web2py.com
web2py visual identity changed a lot in one year. what do people think
today about the current styles and layout?
--
Bruno Rocha
[http://rochacbruno.com.br]
32A.png
.
*default=request.args(0) or None*
--
Bruno Rocha
[http://rochacbruno.com.br]
May be
#model
db.define_table('mytable',
...
Field('other_table_id','reference other_table', default=*request.args(0)
or 0*,...),
...
)
or
# in controller before creating your forms
db.mytable.default = request.args(0) or redirect('some place')*
*
--
Bruno Rocha
[http
It happens even if I remove the ckeditor widget.
and happens also on the edit article form.
Denes found the problem but I cant understand why the problem is only with
firefox.
http://zerp.ly/rochacbruno
Em 28/11/2011 13:02, DenesL denes1...@yahoo.ca escreveu:
Seems to be a problem with the
--
Bruno Rocha
[http://rochacbruno.com.br]
Look here: http://code.google.com/p/web2py/source/browse/gluon/tools.py#327
This is inside the Mail.send method:
if not isinstance(self.settings.server, str):
raise Exception('Server address not specified')
it refers as *self.settings.server.* In Python 'self' is the convention to
refer the
has this capability.
--
Bruno Rocha
[http://rochacbruno.com.br]
On Mon, Nov 28, 2011 at 5:34 PM, Constantine Vasil thst...@gmail.comwrote:
If I add settings.**server = 'gae' in the 0.py, would it be available
globally to Mail()?
No.
every variable defined in models are only global to another models,
controllers and views.
--
Bruno Rocha
[http
I am trying to think it is a problem with web2py session vars in
current.session.
You have two options
def user():
from gluon.tools import Mail
mail = Mail()
mail.settings.server = gae
* auth.settings.mailer = mail # needs to bind mail to auth*
return dict(form=auth(), auth=auth)
or in models (or anywhere)
mail=auth.settings.mailer
probably there is an error in the plugin module.
the error can be in syntax or importing something inside the module.
check if the plugin is not trying to import another module.
I often have problems like that when there is some errors ij module.
http://zerp.ly/rochacbruno
Em 27/11/2011 12:47,
we are fetching the existing comments for this page*
pagecomments = db(db.comment.page_id==this_page.id).select()
* # now we return some objects to be rendered in the view*
return dict(page=this_page, comments=pagecomments, form=form)
--
Bruno Rocha
[http://rochacbruno.com.br]
issue with this browser?
Thank you.
--
Bruno Rocha
[http://rochacbruno.com.br]
gluon.rewrite import load
LOAD = load()
But the error persists. Am I importing LOAD improperly? Any other ideas?
--
Bruno Rocha
[http://rochacbruno.com.br]
() in query
--
Bruno Rocha
[http://rochacbruno.com.br]
my clean cache function raising an error.
My code is:
https://github.com/rochacbruno/Movuca/blob/master/modules/config.py#L41
I have not tried other cache methods for GAE.
--
Bruno Rocha
[http://rochacbruno.com.br]
I was an hg lover, for a long time I resisted to use git.
But now, I am discovering git github and I am really enjoying to work
with git.
May be because I like more github than bitbucket or gcode.
Software is like sex: it's better when it's free!
-- Linus Torvalds
--
Bruno Rocha
[http://rochacbruno.com.br]
a
specific gluon file?
--
Bruno Rocha
[http://rochacbruno.com.br]
*
*
*
*--
*
*
*
*Bruno Rocha*
*[http://rochacbruno.com.br]*
Right now I am developing a Social-CMS.
I am in very beggining of the project, I have all the ideas and directions
but for now only article user management.
But I am working to finish all the features in one month ( I have a
deadline with a client)
My goal is a model-less app (No models, I
Apache?
Running on Ubuntu 10.04 with wsgi. Installed using the one step
install script, no changes.
--
Bruno Rocha
[http://rochacbruno.com.br]
to old age, the soul similarly passes
into another body at death. A sober person is not bewildered
by such a change.
http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
--
Bruno Rocha
[http://rochacbruno.com.br]
/compagnucciangelo
--
Bruno Rocha
[http://rochacbruno.com.br]
()
def echo():
return jQuery('#target').html(%s); % request.vars.id
--
Bruno Rocha
[http://rochacbruno.com.br]
)
@*staticmethod*
def support_function(price, quantity):
return price*quantity
--
Bruno Rocha
[http://rochacbruno.com.br]
try
db[the_table]
http://zerp.ly/rochacbruno
Em 22/11/2011 00:49, monotasker scotti...@gmail.com escreveu:
I'm trying to abstract several content creation controllers into one
controller. I want to use request.args[0] to set the db table in which the
new row will be created. So far I've got
will need to be replaced.
--
Bruno Rocha
[http://rochacbruno.com.br]
On Sun, Nov 20, 2011 at 3:13 PM, chawk chrshawke...@gmail.com wrote:
setting
You trying to access auth.setting, it should be auth.*settings*
--
Bruno Rocha
[http://rochacbruno.com.br]
for this 'manager' to be part of
the managers group?
I have tried db.myTable.manager.requires_membership('managers'), but
of course this blew up.
Any ideas would be highly appreciated.
--
Bruno Rocha
[http://rochacbruno.com.br]
automatically, it works ok with SQLFORM and CRUD, but does not works with
SQLFORM.factory. I get the *_blob fields none
Someone knows about it?
Thanks
--
Bruno Rocha
[http://rochacbruno.com.br]
On Sat, Nov 19, 2011 at 2:02 PM, Bruno Rocha rochacbr...@gmail.com wrote:
*if request.env.web2py_runtime_gae: *
this was a typo when writing the email, actually is
*if **NOT** request.env.web2py_runtime_gae:*
18, 2011 at 11:42 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
http://osjs.0o.no/
php based but should be easy to rewrite in web2py
--
Bruno Rocha
[http://rochacbruno.com.br]
controllers to work by default.
I did not tested, but may be
controllers = ['ALL']
--
Bruno Rocha
[http://rochacbruno.com.br]
from gluon.storage import Storage
from gluon.dal import Rows
result = db.executesql(SELECT first_name, last_name FROM auth_user,
as_dict=True)
result = [Storage(item) for item in result]
newrows = Rows(records=result)
newrows[0].first_name
u'Bruno'
wait, there is a better way.
from gluon.dal import Rows, Row
result = access.db.executesql(SELECT first_name, last_name FROM
auth_user, as_dict=True)
rows = Rows(records=[Row(item) for item in result])
rows[0].first_name
u'Bruno'
You can set other values for each Row.
backward compatibility - quote taken from the preface of
the book.
Perhaps there is too much of a rush to add new features: not breaking
existing applications would seem to be of paramount importance.
A pity because in general, it is an outstanding platform.
--
Bruno Rocha
[http
of caching? Is there a way I can disable
it?
--
Bruno Rocha
[http://rochacbruno.com.br]
= {
'domain1.com' : 'app1',
'domain2.com' : 'app2',
},
controllers=['default', 'appadmin', ..., ..., ..., ]
),
)
I has to list every controller, also functions
--
Bruno Rocha
[http://rochacbruno.com.br]
.
Thanks,
Archibald
On 14 nov, 01:44, Bruno Rocha rochacbr...@gmail.com wrote:
which database engine?
http://zerp.ly/rochacbruno
Em 13/11/2011 22:38, Archibald Linx archibaldl...@gmail.com
escreveu:
Dear Web2py users,
How can I reset the database of my Web2py project
I am caching my configuration class, I am passing the class to cache.ram()
and it will be called to create a new instance, and the instance will be
cached.
/modules/config.py
class Config():
def __init__(self, db):
# inside config I use cache to read config from db and sometimes
I notice that if you are planning to run on GAE, your cached object needs
to be Pickable, in my case, the config object instance is a king of
Storage, which acts like a dict.
So follow what Massimo said, and store only dict like objects in GAE,
otherwise you will heve this issue:
PicklingError:
.
--
Bruno Rocha
[http://rochacbruno.com.br]
Hi,
I have this code working on localhost:
*def download():
**import os
**response.stream(os.path.join(request.folder, 'uploads',
request.args(0)))*
But does not works on GAE
Any hint?
--
Bruno Rocha
[http://rochacbruno.com.br]
forget about it, it is working now... using retrieve (dahhh GAE stores a
blob)
On Tue, Nov 15, 2011 at 2:40 AM, Bruno Rocha rochacbr...@gmail.com wrote:
Hi,
I have this code working on localhost:
*def download():
**import os
**response.stream(os.path.join(request.folder
*
In Estonian
http://../app/*peamine*/*artiklid*
Using routes.py, how can I make all the above urls to call default.py:
articles function ?
Thanks
--
Bruno Rocha
[http://rochacbruno.com.br]
args/vars
--
Bruno Rocha
[http://rochacbruno.com.br]
Try
db.table_settings.members.default = [auth.user.email]
if the field is a list:something it expects a Python list as value
--
Bruno Rocha
[http://rochacbruno.com.br]
http://zerp.ly/rochacbruno
Em 13/11/2011 13:49, Jonathan Lundell jlund...@pobox.com escreveu:
On Nov 13, 2011, at 2:16 AM, Bruno Rocha wrote:
I just tested this:
routes_in = (
('/(?Pappartigos|articulos|artiklid)', '/myapp/default/articles'),
)
routes_out = (
('/myapp/default
I am going to test the trick in models. it is useful to create /username
services.
http://zerp.ly/rochacbruno
Em 13/11/2011 17:21, Jonathan Lundell jlund...@pobox.com escreveu:
On Nov 13, 2011, at 11:07 AM, Bruno Rocha wrote:
Here's an alternative, though. I think it might work. In your
can you show your complete model¿ where are you creating Auth instance?
http://zerp.ly/rochacbruno
Em 13/11/2011 02:52, Jimmy Stewpot mail...@oranged.to escreveu:
Hello,
I have been playing around with web2py for about a month.. I have
finally got to the point where I wanted to test the
at all for migrate so I assume that it's
True by being ommited.
It has got me stumped.. I have not had problems like this in the past with
my previous testing.
- Original Message -
From: Bruno Rocha rochacbr...@gmail.com
To: web2py@googlegroups.com
Sent: Sunday, 13 November, 2011 5
note that if have syntax error in your module. the custom importer will
raise the ImportError
are you sure your module has only code compatible with py2.5 ?
it works locally?
http://zerp.ly/rochacbruno
Em 12/11/2011 02:49, Sathvik Ponangi psath...@gmail.com escreveu:
Hi!
I've recently
which database engine?
http://zerp.ly/rochacbruno
Em 13/11/2011 22:38, Archibald Linx archibaldl...@gmail.com escreveu:
Dear Web2py users,
How can I reset the database of my Web2py project ?
Thanks,
Archibald
a method for that
db.table.field.requires = IS_IN_SET(config.get_list('auth',
'privacy_options'))
In the future I will cache the config instance in memcached.
If you app is a bit simpler you should go with plain Python files in
/modules or /models
--
Bruno Rocha
[http://rochacbruno.com.br]
That worked very very well!
I created a file in /models (rewrite.py)
*routes = {
**default: default,
**articles: articles,
**inicio: default,
**artigos: articles,
**principal: default,
**articulos: articles,
**}**
**
**request.controller =
to install it, or how to enable it. I searched
the web2py group for examples, but I failed to find any.
I'd appreciate it if someone could post a working example of this
feature.
Thanks in advance, - Tom
--
Bruno Rocha
[http://rochacbruno.com.br]
, for
example I am from Brazil, and here the average price is a bit lower than in
U.S,
I cannot apply for more jobs for now because my task-list is overloaded,
but tell more about your project (you can do it here too).
--
Bruno Rocha
[http://rochacbruno.com.br]
'app03.auth_user' doesn't exist)
I loaded the app via the administrative interface over the loopback..
The sqllog has nothing interesting it.. I've restarted mysql, apache,
the management interface with no success.
Any advice would be greatly appreciated.
Regards,
Jimmy.
--
Bruno Rocha
This one: http://ourway.ir/pages/blog?u=blouweb
IS a very nice facebook clone app! can be extended for a cms. is it open
source?
and it will take a bit more time.
I think you should host the plugins at your site and if you can provide a
.json for accessing the plugins information it will be included from your
index to web2pyslices in future.
--
Bruno Rocha
[http://rochacbruno.com.br]
come up with that syntax?
Thx much,
BrendanC
--
Bruno Rocha
[http://rochacbruno.com.br]
* {{if auth.user:}}
**{{=form}}
** {{else:}}
**h3{{=T('Posting messages requires login')}}/h3
** a href={{=URL(''default, user, args=login, vars={_next:
URL(default,wheretoredirect)})}}
**Click here to login
** /a
**{{pass}}*
--
Bruno Rocha
='login')
...in db.py but it does not have any effect on the redirect after a
failed login attempt.
Does anyone know a way to overide the default redirect URL on a failed
login to be the new location of my user function or get this working
some other way?
Thanks
--
Chris
--
Bruno
forget about it, it needs to be a lambda because of:
return call_or_redirect(
self.settings.on_failed_authentication,
self.settings.login_url+\
'?_next='+urllib.quote(next))
it says that should be
...@themislexsol.com
wrote:
hello friends when i was given auth.requires.login() on table then i
was try for login then they login page give me need verification
error...
if u know plz give me need full think
thanks
--
Bruno Rocha
[http://rochacbruno.com.br]
) or
better, create your datamodels and other instances (Auth, Crud) in /modules
and load it only when you need it.
See this presentation from Martin Mulone for better practice on this:
http://www.slideshare.net/martinpm/web2py-pensando-en-grande-9448110
--
Bruno Rocha
[http://rochacbruno.com.br]
I guess you need
db.define_table(tblDriver,
Field(DriverName,'string',label='Driver Name'),
Field('id_tblVehicle', db.tblVehicle,label='Vehicle Name'))
db.tblDriver.id_tblVehicle.requires=IS_IN_DB(db, 'tblVehicle.id', '%(
VehicleName)s')
--
Bruno Rocha
[http://rochacbruno.com.br]
'))
db.tblDriver.id_tblVehicle.requires=IS_IN_DB(db, 'tblVehicle.id')
By thw way you have problem with the name you give to the fields, try to
name references with *tablename_id* to avoid confusion.
--
Bruno Rocha
[http://rochacbruno.com.br]
(user)*
is there a problem on doing that?
--
Bruno Rocha
[http://rochacbruno.com.br]
if it cannot be solved.
The real code is in: https://github.com/rochacbruno/Movuca and it is a bit
more complex than the example code I wrote here. (just clone it in to
web2py trunk version app folder)
Any hint about it?
Thank you.
--
Bruno Rocha
[http://rochacbruno.com.br]
:
Hii All,
I am using sqlform grid and i just want to put some authentication on each
some functions of grid i.e(Delete , Write) for certain groups' users
I can do this by using crud.xxx() but i m unable to use authentication
with sqlform grid().
regards,
Naleen
--
Bruno Rocha
[http
,
BrendanC
--
Bruno Rocha
[http://rochacbruno.com.br]
Browser shots is very nice tool.
http://browsershots.org/http://web2py.com/new_examples
The CMS (bloog) from Lucas is nice, but it is incomplete, can be used as
base for a new project.
integer it
works normally, looks like Field() constructor is trying to access db or
something like that when reference type is used.
Thanks
--
Bruno Rocha
[http://rochacbruno.com.br]
Also, it happens only on second request (form submission) the form loads
ok, when submitted the error occurs.
--
Bruno Rocha
[http://rochacbruno.com.br]
() returns unordered dict of attributes.
I think it is solved by now, In modules qe can't define dynamic attributes
in top level of module or class, all needs to be inside instances! (even
the imports)
Thanks.
--
Bruno Rocha
[http://rochacbruno.com.br]
, this is in *portuguese*, but I guess some latin people here will
understand the basics
(I am planning to extend my course and give some online classes in english,
but I am in need to improve my english first :) )
Hope it helps some web2py begginer.
--
Bruno Rocha
[http://rochacbruno.com.br]
)
I have now tested this but would this work ?
Nils
--
Bruno Rocha
[http://rochacbruno.com.br]
if you store sessions in a shared database you can be logged in both apps.
I still have no success running cas with a custom auth table.
http://zerp.ly/rochacbruno
Em 08/11/2011 10:55, Anthony abasta...@gmail.com escreveu:
On Tuesday, November 8, 2011 7:08:08 AM UTC-5, rochacbruno wrote:
Yes
It is for avoid confllicts, $ and jQuery has same purpose, and the use of
jQuery is recommended to avoid conflicts with another JS frameworks.
--
Bruno Rocha
[http://rochacbruno.com.br]
At the footer you forgot to mention the Portuguese user group, also I miss
the links in side navigation bar of current website.
On Mon, Nov 7, 2011 at 2:55 AM, Sathvik Ponangi psath...@gmail.com wrote:
Dear Massimo,
Restarting AppEngine seems to have fixed this as well.
But now I get an error saying that
NameError: global name 'db' is not defined
How do import db.py onto the module?
You cant import db onto a
it is a list of dictionaries.
http://zerp.ly/rochacbruno
Em 05/11/2011 14:15, Bianca Cadaveri biancacadav...@gmail.com escreveu:
May I ask one more question ?
web2py will pass the Row object for the record as the dictionary (the
Row class inherits from dictionary, so functions as a
,{'todo',db.todo.complete==False})
2. The dropdowns for Priority start with a blank slot, not 1.
pass zero=None to field requires
Field('priority',requires=IS_IN_SET([1,2,3,4,5], zero=None))
--
Bruno Rocha
[http://rochacbruno.com.br]
I guess you need .grid (not smartgrid)
todos = db.todo.complete==False
grid=SQLFORM.grid(todos)
--
Bruno Rocha
[http://rochacbruno.com.br]
--
Bruno Rocha
[http://rochacbruno.com.br]
2 files of the models .
Therefore we put the files in the common folder ( models/ ) .
Could you please suggest any other way to control the execution of the
files in the models.
Thank You
Anubhav Aggarwal
--
Bruno Rocha
[http://rochacbruno.com.br]
pagination.
What's the second best way to do paginate ? Is it one on official book
or something else ??
--
Bruno Rocha
[http://rochacbruno.com.br]
I like to use this: http://sontek.net/turning-vim-into-a-modern-python-ide
$ git clone https://github.com/sontek/dotfiles.git
$ cd dotfiles
$ ./install.sh vim
The best VIM config.
But I guess he means about web2py keywords, is there any plugin?
--
Bruno Rocha
[http://rochacbruno.com.br]
you are using ui=jquery-ui maybe locally it is not being loaded?
http://zerp.ly/rochacbruno
Em 29/10/2011 08:35, peter peterchutchin...@gmail.com escreveu:
Bruno
I have an indentical application on the web and locally. I use the
same version of web2py. However I seem to get some differences
machines.
Peter
On Oct 29, 12:46 pm, Bruno Rocha rocha...@gmail.com wrote:
you are using ui=jquery-ui maybe locally it is not being loaded?
http://zerp.ly/rochacbruno
Em 29/10/2011 08:35, peter peterchu...@gmail.com escreveu:
Bruno
I have an indentical application
801 - 900 of 2316 matches
Mail list logo