I want something like this to work, but it doesn't, obviously.
def logout():
auth.logout()
response.js = 'alert("goodbye world");'
from gluon import HTTP
HTTP(202)
return dict()
I've also tried auth.settings.logout_onlogout = [onlogoutfunction]
but that's not working for me ei
Sure enough. So, I am thinking "out loud" here--what would be the
advantage of a function (or class) in the controller over a class in a
module?
1. Would I be able to get rid of the class and all of its attributes
because every variable in the single controller file is visible to all
functions?
Ouch, ouch, ouch ... that causes things to really disintegrate! I tend
to agree with your assessment that there's an order dependence
somewhere. But I don't see it, yet.
On Mar 27, 11:53 am, Anthony wrote:
> Try
>
> {{include 'scripts.html'}}
> {{include 'web2py_ajax.html'}}
>
I have a hubadmin.py and vcardadmin.py controller. I decorated the
functions in both controllers using:
@auth.requires(lambda: auth.has_membership(HUB) or
auth.has_membership(ADMIN))
@auth.requires(lambda: auth.has_membership(VCARD) or
auth.has_membership(ADMIN))
When I am logged in as a user
>
> one another question is about Bruno's answer about storing data in session
> using dictionary.
> I see that appending works for adding new orders but what if you place an
> order that's already placed in session? I know how to compare one word at a
> time, but with my knowledge, I don't kn
I would think so too but I don't see any!
Is there any other possibilities?
Is it hidden somewhere?
Please help me out
Thanks.
On Tuesday, March 27, 2012 11:52:47 AM UTC+9, lyn2py wrote:
>
> It would be /Programming/Python/web2py/
Thank you. the answer was very clear for me to solve it.
one another question is about Bruno's answer about storing data in session
using dictionary.
I see that appending works for adding new orders but what if you place an
order that's already placed in session? I know how to compare one word at
>
> var data = $('.info input[type=\'text\', )
> alert(data) // it shows pid=8&topping=1&topping=3&... on and on
> I have a problem on this line
> How can I send the serialized values by using ajax to the python method?
> This is what I wrote
> /
> ajax('{{=URL('tester',vars=dict(data=dat
Can you describe the problem? Is the below view the index.load view? What
is in plugin_app/layout.html? Should that be extended rather than included?
Anthony
On Monday, March 26, 2012 11:23:34 PM UTC-4, IVINH wrote:
>
>
>
> I have two views similar but different extension (index.html & index.loa
Try
{{include 'scripts.html'}}
{{include 'web2py_ajax.html'}}
You have to add files to response.files before including web2py_ajax.html
because that view calls response.include_files(), which generates the
and elements for whatever files are in response.files.
Adding items to response.
Huh? I'm sorry but I don't understand.
On Mar 27, 4:28 pm, Massimo Di Pierro
wrote:
> you cannot.
>
>
>
>
>
>
>
> On Monday, 26 March 2012 21:09:49 UTC-5, Limedrop wrote:
>
> > Just in case any of you want to do this...I've written a routine that
> > enables you to save a Query/Expression object
havoc ... in that it doesn't work any more. I'm using the latest
version of web2py_ajax.html. The response.files.append() statements
are part of an include file that's in the main layout.html head
section. Here's part of it
{{=response.title}}
{{include
edit applications/admin/models/0.py and set
MULTI_USER_MODE = True
then register and login in the admin. The first user to login is the
"teacher".
You will see two new buttons "manage students" and "bulk register". You can
use the bulk register page to give accounts to all your students. They c
you cannot.
On Monday, 26 March 2012 21:09:49 UTC-5, Limedrop wrote:
>
> Just in case any of you want to do this...I've written a routine that
> enables you to save a Query/Expression object in the session.
>
> I have a controller that uses a form to build a relatively complex
> query and I wan
If this for a specific application? A specific action?
On Monday, 26 March 2012 21:00:33 UTC-5, web-dev-m wrote:
>
> I am having a strange problem. I just upgraded from 1.99.2 to 1.99.7
> (manually by running update-web2py.sh from /scripts as the link was
> not working in the application).
>
I have two views similar but different extension (index.html & index.load).
Both work well with the 1.99.4, but index.load was not for 1.99.7?
My view:
{{include 'plugin_app/layout.html'}}
{{=content}}
Vào 05:29:43 UTC+7 Thứ hai, ngày 05 tháng ba năm 2012, Massimo Di Pierro
It is OK, I use raw sql to do this thing.
id =
db.to_be_lawyer.update_or_insert(db.to_be_lawyer.user_id==form.record.id,
user_id=form.record.id, created_time=datetime.datetime.today())
response.flash = '已经申请,请等待通知!'
On 3月27日, 上午9时50分, web2py_lover wrote:
> not work
>
> I write as
>
>
If the functions are in the same controller file, any functions in that
file are available (I believe they must take at least one parameter to
distinguish them from controllers that respond to page requests).
Should be pretty much the same. But note that the response.files approach
relies on some code in web2py_ajax.html.
What do you mean "causes havoc"? What actually happens? Can you view your
source and see if the files are being referenced as you expect?
We might need to see more of the relevant
Just in case any of you want to do this...I've written a routine that
enables you to save a Query/Expression object in the session.
I have a controller that uses a form to build a relatively complex
query and I want other controllers to use that query to generate
reports and graphs. I initially e
I'm working on a form creation project. Because formatting is
critical and the users are accustomed to office suites, I am having
them use Libreoffice to create their form templates. Also,
LibreOffice has a Python interface which is quite easy to use.
Right now I'm using a single instance of Lib
Alan,
Thank you for your reply.
I am using Mac OS Lion.
I have a folder /Programming/Python/web2py/web2py.app
And then, I execute by
open web2py
So basically my question is what would be ** on my system?
Please help me out one more time.
Thank you.
g
I am having a strange problem. I just upgraded from 1.99.2 to 1.99.7
(manually by running update-web2py.sh from /scripts as the link was
not working in the application).
I can see my application and all the files are there, but when I try
to get into any of the files it doesn't load. It just han
thank you Bruno.
I have one more question about query.( I think I was happened to see your
github code as well)
I have a form in HTML
and I read all the form values by serializing it
code
var data = $('.info input[type=\'text\', )
alert(data) // it shows pid=8&topping=1&topping=3&... on and on
not work
I write as
db.to_be_lawyer.user_id.default = auth.user.id;
db.to_be_lawyer.created_time.default =
datetime.datetime.today()
db.to_be_lawyer.user_id.readable = False
db.to_be_lawyer.created_time.readable = False
form_to_be_lawyer= SQLFORM(db.to_be_l
Fair enough point about modules but...
I have 3 controllers that pretty much displayed the same data. The
differences are in initial filter status, whether edit controls are
displayed, and privileges for different user groups. As I worked, I
was making the same changes 3 times to the shared code
Hi Niphlod,
Thanks for your reply. I'm running 1.99.7 and here's the model:
db.define_table('webpage',
Field('title'),
Field('body', 'text'))
db.define_table('comment',
Field('page_id', db.webpage),
Field('body', 'text'))
The issue is when you have an implicit inner join, but w
Hi guys,
I have an entity called article.
I want to build the ability to comment on each article. comment at least
need (created_on, user_id, article_id, text)
I'm running on GAE.
On my index page I'm showing 30-60 articles and I want each article to have
its comments showing. how would you do
Hi there,
I'm trying to install a web2py application on GAE using Cloud SQL.
When I try and submit a form that contains an upload field I get the
following exception:
dal.py", line 6124, in store os.makedirs(path)
AttributeError: 'module' object has no attribute 'makedirs'
I'm currently runnin
It work
Thanks
Just mail me in private where to give
Bussiere
Le lundi 26 mars 2012 20:23:06 UTC+2, selecta a écrit :
>
> if it works please donate to the web2py project
>
>
>
Am 20.03.2012 01:24, schrieb DenesL:
Spatial / GIS support (in latest trunk)
=
Sponsored by AidIQ for use by Sahana Eden
Very cool. Great news.
Has the Sahana Eden team also implemented a solution to the proxy issue
with the JS mapping frameworks such as openlayers?
begin
Glad to help!
Tip: start your project in the commandline:
>>python web2py.py -S yourprojectname -N -M
then play around to test your code snippets.
On Monday, 26 March 2012 19:10:49 UTC+1, web-dev-m wrote:
>
> This is embarassing. Thank you. I swear, I tried and tried.
>
> On Mar 26, 10:25
What I was looking for was a type-ahead function using SQLFORM.smartgrid
instead of typing a word and pressing search.
On Thursday, 22 March 2012 16:15:23 UTC-7, Alan Etkin wrote:
>
> I think you mean SQLFORM.smartgrid.
>
> Book's 7.8 section (the features are explained there):
>
> "...
a list of dictionaries.
session.order = []
pizza = {"id": 1234, "quantity": 2, "toppings": ["tomatoes", "pepper",
"zuchini"]}
session.order.append(dict(pizza))
On Mon, Mar 26, 2012 at 4:02 PM, Kenny wrote:
> I am just trying to make pizza order page with web2py.
> I usually store quantity of
I am just trying to make pizza order page with web2py.
I usually store quantity of pizza and id number in session.
But how can I store pizza topping info that user ordered in session?
I am not too familiar with python, so I don't know what would be the
best way to store it.
So session will have
Thanks Simon,
mostly people work on what interest them and usually patches are accepted
if: the syntax is general and not constraining, add functionality of makes
the code smaller, does not slow down existing code and does not break
backward compatibility.
I will open the book for editing this
@Johann, i don't know if you would copy paste the diff i've made into
PgAdapter,
and do some tests and post the results. Pg and Oracle schema works in
the same way.
I currently focusing to dev the MyDAL to support all the joins of
Oracle and doing
some tests on reference (many/one-to-many)
On Mar
This is embarassing. Thank you. I swear, I tried and tried.
On Mar 26, 10:25 am, villas wrote:
> Do this:
>
> files=db(myquery).select()
> files_as_list=[]
> for x in files:
> files_as_list.append(OPTION(x.resource_title[0:50], _value=x.id,
> _title=x.resource_title, ))
>
>
>
>
>
>
>
> On S
Make a simple model for storing files:
db.define_table("files",
db.Field("name"),
db.Field("content", "text"))
Then use a function similar to the one below to download the file:
def download():
file = db.files(request.args[0])
if not file:
raise HTTP(404, "File not found.")
Most of my contributions come from code written while working on a project.
While working on a project, I will find a bug or notice something that
could be much better, then I correct it and send Massimo a patch. The
mobile detection feature currently in web2py started as some code that I
wrote
What do you mean by "I've made skills and items unnecessary"? What about
these references?
Field('Skills','list:reference SkillUser',default=None)
Field('Items','list:reference Item',default=None)
And at which point in your code the error occurs? Why you didn't include
full error message?
>From
Hi all,
So I am a Web2Py convert, and am now using it for pretty much all of my
Pythonic WebDev projects.
As well as being an excellent framework, I am equally impressed with the
passion and friendliness of the Web2Py community and I was wondering what I
can I do to help contribute to it.
*
Or if there might be multiple records tied for max hits:
max_select = db(db.videos)._select(db.videos.hits.max())
records = db(db.videos.hits.belongs(max_select)).select()
Anthony
On Monday, March 26, 2012 12:20:31 PM UTC-4, rochacbruno wrote:
>
> record = db(db.videos).select(orderby=~db.videos
record = db(db.videos).select(orderby=~db.videos.hits).first()
On Mon, Mar 26, 2012 at 1:11 PM, Hassan Alnatour wrote:
> Dear ALL ,
>
> I have a Table like this :
>
> db.define_table('Videos',
> Field('Title'),
> Field('File','upload'),
> Field('Hits','integer'))
>
>
> how can i get the record
Bingo.
Thanks Anthony.
On Mar 26, 11:58 am, Anthony wrote:
> Try
>
> ZipFile(request.vars.body.file, 'r')
>
> Anthony
>
>
>
>
>
>
>
> On Monday, March 26, 2012 10:18:40 AM UTC-4, Cliff wrote:
>
> > I have an upload field called 'body.' It is meant to contain zipped
> > archives.
>
> > I want to
Dear ALL ,
I have a Table like this :
db.define_table('Videos',
Field('Title'),
Field('File','upload'),
Field('Hits','integer'))
how can i get the record with the highest Hits ?
Try
ZipFile(request.vars.body.file, 'r')
Anthony
On Monday, March 26, 2012 10:18:40 AM UTC-4, Cliff wrote:
>
> I have an upload field called 'body.' It is meant to contain zipped
> archives.
>
> I want to extract and parse one file from the archive. Right now I am
> using ZipFile which shou
Looks like your're retrieving the payload from the form field. I'd try
using the value recorded in the database instead, something like:
myfile = open(db.mytable[n].body)
I'm affraid I don't recall exactly how the upload mechanism works, but
there is a lot of info in the online manual about it.
Do this:
files=db(myquery).select()
files_as_list=[]
for x in files:
files_as_list.append(OPTION(x.resource_title[0:50], _value=x.id,
_title=x.resource_title, ))
On Sunday, 25 March 2012 21:25:33 UTC+1, web-dev-m wrote:
>
> I may not be following some sort of convention, but I'm trying t
Begin forwarded message:
> From: Lorenzo Mancini
> Date: March 26, 2012 3:01:38 AM CDT
> To: spea...@pycon.it
> Subject: [EuroPython 2012] Community voting is now open
>
> Hello everybody,
>
> this is Lorenzo Mancini from the EuroPython 2012 organization. You
> are receiving this e-mail beca
Web2py Version 1.99.7 (2012-03-04 22:12:08) stable
Python 2.7.2+
I am trying to load external library from python (
http://pypi.python.org/pypi/readability-lxml/0.2.3)
import urllib2
import readability
page = urllib2.urlopen(url)
html = page.read()
page is fetched
OK it worked !
The indent for last three line was wrong on book and it was fixed on the
downloaded code.
On Friday, March 23, 2012 6:18:36 PM UTC-5, Omi Chiba wrote:
>
> Alan,
>
> Thanks. Good idea. I will try the support files.
>
>
> Sent from my Verizon Wireless BlackBerry
>
> -Origin
I have an upload field called 'body.' It is meant to contain zipped
archives.
I want to extract and parse one file from the archive. Right now I am
using ZipFile which should be able to work with a file-like object,
according to the Python docs.
This does not work:
This also does not work:
fro
Wich web2py version? Is this the old editarea or the new editor in trunk?
On Monday, 26 March 2012 02:44:19 UTC-5, gubbanoa wrote:
>
> Sorry if this has been posted earlier; I could not find it immediately
> in the group. I think the web2py web editor sometimes messes up the
> code indentation.
So you want a web server on a local machine with a TCP backend to control
the remote device.
You also want some API to be able to access the server problematically.
If this is correct, you will need:
- a web2py application with functions decorated as services
http://web2py.com/books/default/cha
villas, you're right! I had forgotten the conclusion of our previous
discussion ... I'll try not to be so "lazy" next time, but truth be
told, my plate spilleth over. Anyway, the epydocs need lots of work
and the formatting leaves something to be desired. But I believe the
self-documenting nature o
problem is doing it within the db ^_^
Actually your answer is correct, and I need to rectify my example
period_to_update = db(db.periods.id==1).select().first()
start_time = period_to_update.start_time
elapsed = request.now - start_time
period_to_update.update_record(end_time=request.now,
i will try (i'am at work) and if it works (i hope it will) please give
me your paypal and drink something for me.
Regards
Bussiere
"Les nouvelles technologies offrent pleins de nouvelles possibilités,
pleins de possibilités d'erreurs surtout en fait."
insurance.aes256 : http://goo.gl/gHyAY
--
I think that the problem when doing fields=[] is that it tells web2py
to build a field-less form which has no meaning so far. gluon API
says: "...a list of fields that should be placed in the form...".
Instead, it's probably best to just use the db.table.field.readable
attribute
On 26 mar, 07:46,
Not sure if this is relevant, but you can do the following with datetime.
>>> import datetime
>>> a = datetime.datetime(2007, 12, 6, 16, 29, 43, 79043)
>>> b = datetime.datetime(2011, 10, 3, 12, 0, 0, 0)
>>> c = b-a
>>> c
datetime.timedelta(1396, 70216, 920957)
>>> (c.microseconds + (c.seconds +
damn mobile phone screen
I got it, seems a simple join, and for my simple model works without a
hitch.
can you please post your model and tell what web2py version are you running
?
Il giorno lunedì 26 marzo 2012 01:58:31 UTC+2, Limedrop ha scritto:
>
> The difference is in the FROM clause.
can use the following :-
form=SQLFORM.grid(db.auth_user, create=False, selectable = lambda ids:
del_emp(ids))
def del_emp(ids):
if not ids:
response.flash='Please Select the Check-box to Delete'
else:
for row in ids:
db(db.au
On the file locations, first you must know where did you install
web2py in your system (although even it can be retrieved with web2py
trough the execution environment variables)
Any working app will be located at /applications/
All application specific files reside inside that folder, including
co
first write the following code and than use the SQLFORM it will hide
your name field
db.to_be_lawyer.name.readable = False
On Mar 26, 3:31 pm, web2py_lover wrote:
> How to hide all fields of SQLFORM with submit button only?
>
> all fields of db.to_be_lawyer are 'name' and 'age'.
>
> I try
>
Could you post the errors you get when compiling?
Perhaps you can use the installer administrative interface facility
(w2p files) for remote app deployment.
On 26 mar, 00:17, netcode wrote:
> Hello all!
> i am from a windows environment and i expect things to be easy. well, i
> moved to ubuntu o
Is the buttons parameter documented somewhere?, I don't recall having
seen it.
Fields that have a readable attribute set to False cannot be seen:
db.to_be_lawyer.name.readable = False
...
The fields parameter of SQLFORM defaults to all, but passing an empty
sequence should prevent all fields to
Hello all!
i am from a windows environment and i expect things to be easy. well, i
moved to ubuntu of recent where i develop using python and web2py. I am
currently trying to raise a blog using the InstantPress CMS. I am done with
customizing its contents but i get errors when trying to compile
Hello,
I just started learning web2py last weekend.
I am amazed at the simplicity of this framework.
It's really beautiful.
I have binary installed on my Mac OS Lion.
It's really embarrassing but can I ask where I can find all the files on
local folder?
For example, say, I create a new applicati
How to hide all fields of SQLFORM with submit button only?
all fields of db.to_be_lawyer are 'name' and 'age'.
I try
db.to_be_lawyer.name.default = 'default name'
db.to_be_lawyer.age.default = '28'
form_to_be_lawyer= SQLFORM(db.to_be_lawyer, fields=[], buttons
= [INPUT(
did you see this slice
http://www.web2pyslices.com/slice/show/1443/auto-login-when-you-come-from-localhost
it logs you in when you come from localhost, just exchange the if an there
you go :D
On Monday, March 26, 2012 2:11:29 AM UTC+2, bussiere adrien wrote:
>
> it's more a logical problem than y
I think we all agreed that a concise reference is important. However, I
thought previous discussions had led to the conclusion that we should
concentrate on writing better docstrings. See existing epydoc:
http://www.web2py.com/examples/static/epydoc/index.html
On Monday, 26 March 2012 01:22:1
Sorry if this has been posted earlier; I could not find it immediately
in the group. I think the web2py web editor sometimes messes up the
code indentation. Has anyone else seen this?
Open a bugfree default.py file (which has been generated elsewhere and
is working fine) in the web2py web editor f
I would also like a reference manual which documents everything
systematically with usage examples - something like the reference manuals
of Turbo Pascal years ago or that of Python although it sometimes take me
longer to find what I am looking for in the Python manual than it would
have taken me
I recently ran into the same problem also using a left join. I wish it was
possible to use SQLFORM.grid with the result of db.executesql(query).
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)
I would really appreciate it if we can have that in DAL. I am a Postgresql
user.
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)
Thanks !
On Saturday, March 24, 2012 5:26:52 AM UTC+1, Javier wrote:
>
> sabsto
>
> You can use selectable, for example:
>
> selectable = lambda ids: delete(ids)
> form=SQLFORM.grid(query,selectable=selectable)
>
> def delete(ids):
> to_delete=db(db.tabla.id.belongs(ids))
> to_delete.del