Location: http://www.web2py.com/books/default/chapter/29/11#jQuery-and-Ajax
In the reference to web2py_ajax.html:
response.files.insert(1,URL('static','css/calenadar.css'))
should be
response.files.insert(1,URL('static','css/calendar.css'))
Enter code here...
Regards
Johann
I migrated an application running in 1.94.6 to 1.99.7.
I have a peculiar problem. Crud.create on normal tables work. But whenever
I apply crud.create on children table (that is there is a foreign key in
the table; of course, I set a default value for this key before calling
crud.create), I get
Just two questions regarding the book:
- Are all the typos/erratas collected somewhere? I've seen a couple of
posts of Johann Spies, but I would like to know if more has been detected.
- Is the web version of the book corrected as soon as those mistakes are
detected, or is it exactly the same tha
Hi,
I have downloaded and extracted Facebook sdk and trying to use in my web2py
application, I have uploaded facebook.py in my application's Modules and
trying to import using the statement
"from applications.facebook.modules.facebook import * " in default.py class
and when i try to run its g
ok,
my pbx can run python scripts but these python scripts must reside in an
internal folder of the pbx.
So i have a script that calls the web2py script. So far so good?
Next how do i call a module function from the command line, so i can pass
this line to my script via os.system('python /home/use
2012/4/5 Anthony :
> Does it work if you do the following at the top of model and controller
> files (requires latest web2py version):
>
> if 0:
> from gluon import *
>
> If you've got db and auth objects, you could also add:
>
> from gluon.tools import Auth
> db = DAL()
> auth = Au
Maybe a web service is more suitable
Em 5 de abril de 2012 10:05, António Ramos escreveu:
> ok,
> my pbx can run python scripts but these python scripts must reside in an
> internal folder of the pbx.
>
> So i have a script that calls the web2py script. So far so good?
> Next how do i call a
I have a table with five fields in a database and i want to fetch the
records one by one randomly and display on the html page with radio buttons
and when i click on the next button the next record will shown on the html
page.
Thanks, Anthony
Parameter-based routing does work for subdomains, but it doesn't seem to
accept wildcards like this:
domains = {
'localhost:8000' : 'welcome',
'*.localhost:8000': 'operations'
}
I almost have pattern-based routing working. I'm going to post another
question with a fuller e
@johann, have you tried MyDAL to connect and follow the how to?
https://github.com/adesst/web2py
On Thursday, April 5, 2012 1:46:48 PM UTC+7, Johann Spies wrote:
>
>
>
> On Thursday, 5 April 2012 01:17:48 UTC+2, Massimo Di Pierro wrote:
>>
>> Can a query involve tables from different schemas?
>>
>
Hi guys
Too simplify things: I like to do a database with two tables:
food(name(string),taste(reference)) and taste(name(string))
food should take one or more references to taste for example orange is sour
and sweet.
I thought the list:references should be the right type. but when I choose
the t
Would there be merit in defining _id for a table schema where the
_primarykey list contains a single field
Doing this seems to allow SQLFORM.grid to behave as desired
I have a simple patch that seems to do this. I am not sure how this
affects insert performance etc
I can't understand why this isn't working. The regular expressions seem to
work OK in an interactive Python session. Details are below.
Grateful thanks for any help.
My web site (still in development) has two applications. The welcome app
will handle the marketing side, with links to demos, '
->i have a table with 6 fields-one field for question, 4 fields for answer
and 1 last field for storing correct answer
->i want to fetch 1 question and it's 4 options on web pageoptions are
with radio buttons
->when user select one option and click on next button then a flash is
visible with
>
> Hi, Anthony, that's enough to avoid Eclipse marking as errors lines
> containing web2py references, but to get autocomplete working, with
> the latest web2py stable version , I need to add to my modules:
>
> if 0:
> from gluon import *
> global LOAD; LOAD = compileapp.LoadFactory()
>
On Apr 5, 2012, at 6:20 AM, Cliff wrote:
> I can't understand why this isn't working. The regular expressions seem to
> work OK in an interactive Python session. Details are below.
> Grateful thanks for any help.
>
> My web site (still in development) has two applications. The welcome app
> w
>
> Why not to use session storage object?
> It is available globally.
>
Somewhat inefficient if the values don't vary per user.
Anthony
Error message is clear: it failed to look up the module. Can u change
into the directory and import it on the console?
--- on 2012/4/5 22:41:15, Amit wrote:
>
>
> Hi,
> I have downloaded and extracted Facebook sdk and trying to use in my
> web2py application, I have uploaded facebook.py in my app
I use PyDev and add web2py src into "PyDev - PythonPath" to resolve the
incorrect refs and enable autocompletion.
Alternatively, u could install the path of web2py src into systeml
envirnoment vairable "pythonpath".
--- on 2012/4/5 22:51:41, Rod Watkins wrote:
> I know this has been asked before
Hello,
Thanks for your reply...
Here how I do caching :
dblabels_en=dict([(r.table_name+r.column_name,r.column_name_en_ui)\
for r in db().select(db.dict_database.ALL,cache=(cache.ram,3600))])
The problem, is that I think the for and dict creation are re-executed each
request.
Richard
On T
You should provide some code of where you get until now so we could help or
suggest further reading...
Richard
On Thu, Apr 5, 2012 at 9:32 AM, Sonu Srivastava <
sonu.srivast...@zero-group.com> wrote:
> ->i have a table with 6 fields-one field for question, 4 fields for answer
> and 1 last field
Please open a bug report this on googlecode.
On Thursday, 5 April 2012 03:38:38 UTC-5, Sundar wrote:
>
> I migrated an application running in 1.94.6 to 1.99.7.
>
> I have a peculiar problem. Crud.create on normal tables work. But whenever
> I apply crud.create on children table (that is there is
I'd like to see the patch. Can you email it to me?
On Thursday, 5 April 2012 07:26:58 UTC-5, marius.v.niekerk wrote:
>
> Would there be merit in defining _id for a table schema where the
> _primarykey list contains a single field
>
> Doing this seems to allow SQLFORM.grid to behave as desired
>
>
Hello everyone,
When I try to show a datetime object in a table header using the TH()
helper it raises an error as the following (could be something regarding
dateutil.relativedelta library):
%d format: a number is required, not
datetime.datetimeI can reproduce the code using this (Version 1.99.7
>
> Here how I do caching :
>
> dblabels_en=dict([(r.table_name+r.column_name,r.column_name_en_ui)\
> for r in db().select(db.dict_database.ALL,cache=(cache.ram,3600))])
>
> The problem, is that I think the for and dict creation are re-executed
> each request.
>
Why don't you just store the
I think you want:
db.define_table('Taste',
Field('Name',unique=True),
format = '%(name)s # <<< important
)
db.define_table('Food',
Field('Name',length=128),
Field('Taste','list:reference Taste'),
)
On Thursday, 5 April 2012 08:09:37 UTC-5, BlueShadow wrote:
>
> Hi guys
>
If you put the module in the application's /modules folder, you don't need
to specify the full path -- just do:
from facebook import *
However, I think there may be in issue with the custom importer that
results in an ImportError if there is any error in the module being
imported (perhaps it i
seems to be an alarm=False ;)
I solved this moving a function that imports dateutil.relativedelta to a
module and deleting the same (duplicate) import from the action that called
that function, awrf...
sorry for the noise
I wasn't know I could do that...
Thanks
Richard
On Thu, Apr 5, 2012 at 11:14 AM, Anthony wrote:
> Here how I do caching :
>>
>> dblabels_en=dict([(r.table_**name+r.column_name,r.column_**name_en_ui)\
>> for r in db().select(db.dict_database.**ALL,cache=(cache.ram,3600))])
>>
>> The problem
Thank you Jonathan,
I get it. It's like a substitution in Vim, where you have to escape some
characters on the search side but not on the replacement side.
I'm getting along better with regular expressions, but they are not my
friends yet.
On Thursday, April 5, 2012 10:16:51 AM UTC-4, Jonatha
On Thursday, April 5, 2012 11:49:43 AM UTC-4, Richard wrote:
>
> I wasn't know I could do that...
Yes, in that case you're not caching the Rows object, you're just caching a
dict that you create from the Rows object -- dicts are cacheable.
Anthony
Thanks Anthony, I think it improves speed, I will know more precisely when
I push a update on my prod server.
Richard
On Thu, Apr 5, 2012 at 11:59 AM, Anthony wrote:
> On Thursday, April 5, 2012 11:49:43 AM UTC-4, Richard wrote:
>>
>> I wasn't know I could do that...
>
>
> Yes, in that case y
I found an old thread:
https://groups.google.com/forum/?fromgroups#!searchin/web2py/auth.login()$20from$20inside$20a$20component/web2py/Qg4AAePIlJw/tOTdGwtAj6EJ
The discussion stopped at some point.
On Friday, March 30, 2012 7:08:10 AM UTC-7, Anthony wrote:
>
> On Friday, March 30, 2012 2:22:4
Yes, that gets the autocomplete. Yea!
The request, response, T and others still show up as errors, so I've just
turned off code analysis.
On Wednesday, 4 April 2012 16:23:02 UTC-7, Anthony wrote:
>
> Does it work if you do the following at the top of model and controller
> files (requires lates
I use Plugin Wiki and I want hide its Pages menu.
In db.py I have:
plugins = PluginManager()
plugins.wiki.editor = False
however when I trace Plugin Wiki after its initialization (after _() call),
there is
plugins.wiki.editor = False
but plugin_wiki_editor = True
and menu Pages will appear.
Wh
Seems to me he's writing a 'test' type app - you are presented the
questions in the random order, and you don't want to be presented the same
question again.
I think you'd want to store in the session object a list of questions
already taken, and make sure your random select excludes that list.
>
> Yes, that gets the autocomplete. Yea!
>
> The request, response, T and others still show up as errors, so I've just
> turned off code analysis.
>
I can't get code analysis to work at all, so I can't test this.
Anthony
compute= works for me once, when I create a record (or when Field==None).
And that is exactly what you write in documentation.
But I need calculated field which updates always when source fields will
change.
Maybe proper way is to use default=(or compute=)+update= ?
I'm sorry for late response.
Thanks Massimo
I had a bit of a headache porting it to my big app. The Problem was a
single line:
db.define_table('Taste',
Field('Name',unique=True),
format = '%(Name)s' # <<< important
)
db.Taste.Name.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'Taste.Name')]
db.define_table('Food',
First it must be decided if the configuration should be on the server or on
the application level. A configuration per application would be more
flexible so I'd prefer that. Basically all that's needed is a configuration
file which could be similar like the language translation file. The
settin
You don't need this line if you une format= and if you don't need fancy
stuff like making a subset of element of your Taste table.
But, what the problem exactly?
By the way, it is weird to use capitals for table name and field name. It
confusing.
Richard
On Thu, Apr 5, 2012 at 1:57 PM, BlueSha
Is there any reason not to have a col3 argument to SQLFORM.grid, and pass it to
the create/edit SQLFORMs? Likewise comments. Or maybe just an sqlform argument
dict to be passed as additional kwargs?
I love caching!!
I think I solved much of my speed problem... I didn't thought that building
those dict could be so costly...
I really thank you Anthony.
Richard
On Thu, Apr 5, 2012 at 12:13 PM, Richard Vézina wrote:
> Thanks Anthony, I think it improves speed, I will know more precisely when
No reason, please send me a patch and I will add it.
On Thursday, 5 April 2012 13:51:35 UTC-5, Jonathan Lundell wrote:
>
> Is there any reason not to have a col3 argument to SQLFORM.grid, and pass
> it to the create/edit SQLFORMs? Likewise comments. Or maybe just an sqlform
> argument dict to be
Did you use the required apache NameVirtualHost directive?
I just wanted to make a note how it works so someone other might benefit
from it. I like capital letters^^
Hey all,
I'm building a crud-heavy app using web2py restful api/decorator. In a
non-restful context, it's easy (and cruft free) to create and grab forms
using the built-in crud wrapper.
However, in a restful context with separate GET/POST/PUT/DELETE methods,
what's the least repetitive and mos
Seems to be working as intended from here. Possibly your browser's cache
playing yedi mind tricks on you :D
On Wednesday, March 28, 2012 9:49:10 AM UTC-4, Sergi Pons Freixes wrote:
>
> Hi All,
>
> After checking the apache documentation and looking at older related
> discussions in the group, I
Any recommendations on how to change the options in a second drop down menu
based upon the selection in first drop down menu.
See
http://stackoverflow.com/questions/8146260/best-practice-for-populating-dropdown-based-on-other-dropdown-selection-in-web2p/8152910#8152910
.
Anthony
On Thursday, April 5, 2012 4:29:19 PM UTC-4, cmzobrist wrote:
>
> Any recommendations on how to change the options in a second drop down
> me
Actually, it was a typo on my part...I did get it to work but now, working
on 23,500 records and it takes so long to process..is that jquery??
Thanks for the help...
On Wednesday, 4 April 2012 13:24:35 UTC-7, Anthony wrote:
>
> Could be an issue with DataTables -- you might consider ask
This is how it works:
# define auth
auth = Auth(db, hmac_key=Auth.get_or_create_key())
auth.define_tables(username=True,signature=True)
# define your own tables like
db.define_table('mything',Field('name'),auth.signature)
# than do:
auth.enable_record_versioning(db)
how does it work? every tab
is it possible to redirect the archive to a separate database?
On Thu, Apr 5, 2012 at 7:16 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:
> This is how it works:
>
> # define auth
> auth = Auth(db, hmac_key=Auth.get_or_create_key())
> auth.define_tables(username=True,signature=True)
>
I'm trying to set up unit testing using testRunner.py as laid out here:
http://www.web2pyslices.com/slice/show/1465/unittesting-doctesting-and-userinterface-testing
. When I run the tests I'm getting this error:
AttributeError: 'thread._local' object has no attribute 'app'
This is fixed if I
I'm also now getting a second error (when I change line 60):
Traceback (most recent call last):
File "/home/ian/web/web2py/gluon/shell.py", line 206, in run
execfile(startfile, _env)
File "testRunner.py", line 110, in
g=custom_execfile(f)
File "testRunner.py", line 75, in custom_exe
Now you can. ;-)
auth.enable_record_versioning(db, archive_db=other_db)
On Thursday, 5 April 2012 17:28:43 UTC-5, rochacbruno wrote:
>
> is it possible to redirect the archive to a separate database?
>
> On Thu, Apr 5, 2012 at 7:16 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>
Now you can. ;-)
auth.enable_record_versioning(db, archive_db=other_db)
On Thursday, 5 April 2012 17:28:43 UTC-5, rochacbruno wrote:
>
> is it possible to redirect the archive to a separate database?
>
> On Thu, Apr 5, 2012 at 7:16 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>
# model:
db.define_table('event',
Field('title'),
Field('start_datetime','datetime'),
Field('stop_datetime','datetime'))
# controller:
def events():
response.view = 'generic.ics'
events = db(db.event).select()
title = 'my calendar'
forgot to say. You need generic.ics from the new welcome app.
On Thursday, 5 April 2012 18:15:01 UTC-5, Massimo Di Pierro wrote:
>
> # model:
>
> db.define_table('event',
> Field('title'),
> Field('start_datetime','datetime'),
> Field('stop_dateti
great! I am testing
On Thu, Apr 5, 2012 at 8:09 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:
> Now you can. ;-)
>
> auth.enable_record_versioning(db, archive_db=other_db)
>
>
> On Thursday, 5 April 2012 17:28:43 UTC-5, rochacbruno wrote:
>>
>> is it possible to redirect the archive
Example:
# model
db.define_table('point',
Field('name'),
Field('latitude','double'),
Field('longitude','double'))
#controller
def map():
return dict(
googlemap_key='...', # get this from google maps
center_latitude = 41.878,
center_longitude
hi i'm little confused with request.
...
model:
db.define_table('menu',
Field('parent',type='integer', requires=IS_EMPTY_OR(IS_IN_DB(db, 'menu.id',
'%(title)s'))),
Field('title', type='string',label=T('Title')),
Field('content', type='text',label=T('Content')),
Field('menu_type', type='stri
Please check it again. I did not change the API but changed the internal
logic so that one can do:
db.table._archive_records()
without using auth at all. This allows use with gluino too.
On Thursday, 5 April 2012 18:19:17 UTC-5, rochacbruno wrote:
>
> great! I am testing
>
> On Thu, Apr 5, 20
You may also want to look at this thread:
https://groups.google.com/forum/?fromgroups#!topic/web2py/E5QxVWKxu6A
On Friday, March 30, 2012 6:27:15 AM UTC+8, thstart wrote:
>
> I need to do a major rework in order to move client-side
> functionality to the browser and using Javascript
> to get mo
>
> Here is another thread:
>
https://groups.google.com/forum/?fromgroups#!topic/web2py/XaHiLQHQ9X0
Note that it will not be sufficient to just do login/logout with ajax. You
may also wish to extend functionality to include registration and password
retrieval. In addition, decorators will have
Consider this text
text = """
**bold**
''italic''
``code``
[[anchor]]
[[link to #anchor]]
http://example/image.jpg (embeds the image)
http://example/image.mp3 (embeds the audio)
http://example/image.mp4 (embeds the video)
@{hello} (embeds the variable hello)
@{controller/function/a/r/g/s.extensi
Massimo, this is great!
Question: does it keep a copy of the latest previous record only (I'm
sorry, I hope that made sense), or do all submitted changes get copied to
archive (a new record is stored for each submitted change) ?
If the answer is "all submitted changes get copied" , then I woul
I just registered for Linode to host web2py. after playing it for few
hours, It doesnt seem too easy to deploy..
I followed
https://groups.google.com/forum/?fromgroups#!topic/web2py/kd_A86Qwz6w
by creating a script and run it. (init.deb.sh files are relocated)
I think everything's followed nice
By the way, the setup I was looking at was wsgi+ nginx
On Thursday, April 5, 2012 9:14:07 PM UTC-7, Kenny wrote:
>
> I just registered for Linode to host web2py. after playing it for few
> hours, It doesnt seem too easy to deploy..
>
> I followed
> https://groups.google.com/forum/?fromgroups#!top
It stores all previous versions.
On Thursday, 5 April 2012 22:29:46 UTC-5, mart wrote:
>
> Massimo, this is great!
>
> Question: does it keep a copy of the latest previous record only (I'm
> sorry, I hope that made sense), or do all submitted changes get copied to
> archive (a new record is sto
I use Linode and I just run web2py/scripts/nginx+uwsgi and t works like a
charm!
On Fri, Apr 6, 2012 at 1:14 AM, Kenny wrote:
> I just registered for Linode to host web2py. after playing it for few
> hours, It doesnt seem too easy to deploy..
>
> I followed
> https://groups.google.com/forum/?fro
Thanks for pointing to the actual problem, I put facebook.py into the
application's modules folder and import the path has resolved the problem.
Regards,
Amit
On Thursday, 5 April 2012 20:48:10 UTC+5:30, Anthony wrote:
>
> If you put the module in the application's /modules folder, you don't nee
i am following their tut right now. It caused "502 Bad Gateway"
any idea?
On Thursday, April 5, 2012 9:39:13 PM UTC-7, rochacbruno wrote:
>
> I use Linode and I just run web2py/scripts/nginx+uwsgi and t works like a
> charm!
>
> On Fri, Apr 6, 2012 at 1:14 AM, Kenny wrote:
>
>> I just register
go to your shell, download web2py, unzip it and run the script
~/$ wget http://www.web2py.com/examples/static/web2py_src.zip
~/$ unzip web2py_src.zip
~/$ cd web2py/scripts
~/web2py/scripts$ chmod +x setup-web2py-nginx-uwsgi-ubuntu.sh
~/web2py/scripts $ ./setup-web2py-nginx-uwsgi-ubuntu.sh
just f
Rocha! What just happened?!!!
wow! I was looking at the codes falling down on the screen for few mins. I
was like "What's this script doing? " and then.. boom! done and done. Thank
you!
I have one more question. Did this script install PIL? It was too many
lines. I wasn't able to catch up. ha
That script doesnt work on newer ubuntu versions uwsgi-python should just
be uwsgi. Tried on 11.10 and 12.04 both failed.
On Apr 5, 2012 10:12 PM, "Bruno Rocha" wrote:
> go to your shell, download web2py, unzip it and run the script
>
> ~/$ wget http://www.web2py.com/examples/static/web2py_src.z
@Bruce,
I see. I will keep that in mind. Glad that I ran it on 10.04.
Can't you just create a regular Python module, store the settings in there,
and import the module in your app code in order to access the settings? If
it's an app-level module (i.e., in the application's /module folder), you
can even create and edit it via the admin interface. To get such module
And there is still a archive_db parameter?
Like:
db.table._archive_records(archive_db=other_db)
2012. április 6., péntek 3:28:40 UTC+2 időpontban Massimo Di Pierro a
következőt írta:
>
> Please check it again. I did not change the API but changed the internal
> logic so that one can do:
>
> db
79 matches
Mail list logo