In the tukker application example given in the killer-web-development.com
the test_has_right_title fails in-spite of having the exact code and
steps followed according to the instructions on the website.
The message I get after running the application is :
FAIL: test_has_right_title
Thanks Massimo,
It both works.
My objective is to find the difference of last 2 entries. But I preferred
to use the last you given below.
But my problem is, it always use the first row to compute the difference.
Thanks for your reply.
On Sunday, June 23, 2013 2:55:53 PM UTC+3, Massimo Di
oh jiminy crickets, harry really should be party. i changed things from
the original a bit to be less esoteric and i made it worse, sorry. that
damn human in me. lucas
LOL I know it's easy to get muddled up, I do it all the time. Glad you
managed to figure it out. D
--
---
You
I am trying to run a web2py application. Using python2.7 it is running
fine. But I want to use python higher version. When I try with python3.0 or
3.1, am getting an error as
Traceback (most recent call last):
File /var/www/vhosts/astrozon/web2py/web2py.py, line 18, in module
import
As I'm new to web2py, I usually have several tabs open to various web2py
chapters from the online book.
Unfortunately, the page title for each tab is web2py. See the attached
screenshot.
Can those book pages get more descriptive titles?
--
---
You received this message because you are
LOL I know it's easy to get muddled up, I do it all the time. Glad you
managed to figure it out. D
i know damn, even though i have been programming for almost 30 years, and
web2py for 3, i still get muddled. especially when i almost get to
comfortable with a language i start
hello one and all,
is there a setting to disable the left side panel that shows the filenames
in the editor?
my habits are used to it off. lucas
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop
Web2py is not compatible with python 3.x.
Regards,
Ales
On Monday, June 24, 2013 11:19:15 AM UTC+2, Pradeeshnarayan wrote:
I am trying to run a web2py application. Using python2.7 it is running
fine. But I want to use python higher version. When I try with python3.0 or
3.1, am getting an
Web2py is not available for 3.x python.
There is an experimental port to 3 (unmaintained) but that was more of a
'proof of concept' and not recommended.
The main developer, Massimo, is working on web3py which is being rewritten
and enhanced to take advantage of python 3. However, that is
OK, just for the record: The reason my code below was not working for
update was wrong first argument of ajax() funcion. In my code the first
argument - url - wad relative, while it *should* be absolute. So all I
needed to do is change this:
script
$('#select_1').change(function() {
Hi Anthony,
I almost missed your post. I didn't know this.
Thanks!
On Monday, 24 June 2013 02:52:01 UTC+1, Anthony wrote:
FYI, you can do:
myint = request.args(0, default=0, cast=int, otherwise='http://error_url')
The default value is returned if there is no arg at the index specified.
Sorry, just occurred to me that your tables are defined in the wrong order
-- if you want the default validator and represent attribute, you have to
define the referenced tables (b and c) before the referencing table (bc).
It can only create the validator and represent attribute if the
I have a SQLForm and use the formset DIV for it but its not what I really
want. Rather than having just one column with all of the fields required to
be filled out, how do I set it so its like 3-4 columns?
For example:
Name Address City State
Instead of:
Name
Address
City
State
Was there ever a fully working solution proposed or discovered for using
executesql with grid and smartgrid?
On Friday, 22 June 2012 07:54:05 UTC+1, pbreit wrote:
I have an app where I pull down 5,000 records. I started with DAL and
db.item.ALL and it was taking around 4 seconds. I added 5
http://web2py.com/books/default/chapter/29/07#Custom-forms
I don't think it's in the book yet, but you can also create a custom
formstyle if you need to use the layout in multiple
places: https://groups.google.com/d/msg/web2py/QmoRmapiOwA/tZqeEbii6QgJ
Anthony
On Monday, June 24, 2013 8:53:16
The doc-text for requires_signature() speaks about group id and role. Seems
to be a cut-and-paste error.
--
---
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
Thanks for the response. So now I am really confused because I have no idea
where to put this code if I am using a SQLFORM.factory?
Basically I just want to add row fluid to make the layout a little easier
to navigate. I do not have a html file to set this code in for this form.
Thanks.
On
I assume that means you are relying on a generic view to display your
table. If so, you can instead create a non-generic view (which you should
probably do anyway), or you can build the form DOM on the server using
web2py HTML helpers (probably not the way to go). The custom formstyle
option
Thanks for the responses.
The formstyle looks interesting but I cannot make heads or tails out of the
way to use it. Are there any examples of this some place?
Thanks
On Mon, Jun 24, 2013 at 9:55 AM, Anthony abasta...@gmail.com wrote:
I assume that means you are relying on a generic view to
Your best bet is to look at how the built-in ones work, starting here:
https://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#752. Copy
the one of those that is closest to what you want and modify it as
necessary.
def myformstyle():
[custom code here]
form = SQLFORM(...,
Thanks again for the info.
I guess I still do not get it though if I set my formstyle to table3cols
would'nt my form at least be laid out like:
Name Address City
State
Or am I not looking at this correctly?
On Mon, Jun 24, 2013 at 10:16 AM, Anthony abasta...@gmail.com wrote:
Your best bet
Ah, I see now.
Thanks
On Mon, Jun 24, 2013 at 10:50 AM, Anthony abasta...@gmail.com wrote:
No, 3 columns means:
Col 1 Col 2 Col 3
label widget comment
It's still one field per row. When in doubt, try it out. :-)
Anthony
On Monday, June 24, 2013 10:26:08 AM UTC-4, Tom
No, 3 columns means:
Col 1 Col 2 Col 3
label widget comment
It's still one field per row. When in doubt, try it out. :-)
Anthony
On Monday, June 24, 2013 10:26:08 AM UTC-4, Tom Russell wrote:
Thanks again for the info.
I guess I still do not get it though if I set my formstyle to
If I have a form factory with 3 tables, how would I define the fields I
wanted shown for each?
This is the code for my controller. I have tried to set it in several spots
but all of them throw an error.
def register_patient():
mark_not_empty(db.patient)
Hello,
I have a form where I want to manipulate a couple of extra elements
*separately* in the view.
I'd like to be able to wrap them in a separate div element so they are
physically on the page somewhere else and not together with the other form
fields.
In the controller-
form =
Why bother inserting them into the form object if you don't want them
included in the form at all -- just insert them separately in the view?
Note, they won't be submitted with the form unless they are inside the
form tag. If you simply want a custom layout with separate divs *within* the
Thanks for the suggestion, but refreshing the page doesn't make a
difference. I've tried setting up the ssh tunnel with different ports,
etc., but I can't get editing to work. Seems as though it could be a
permissions problem, but I can't see why there is a problem. It's also
possible that
You can set the readable and writable attributes of the fields, or
.factory() can take a list of specific fields rather than entire tables.
Anthony
On Monday, June 24, 2013 11:15:28 AM UTC-4, Tom Russell wrote:
If I have a form factory with 3 tables, how would I define the fields I
wanted
You can try whith:
http://dev.s-cubism.com/plugin_solidform
On Mon, Jun 24, 2013 at 12:02 PM, Tom Russell t...@caregointl.com wrote:
Ah, I see now.
Thanks
On Mon, Jun 24, 2013 at 10:50 AM, Anthony abasta...@gmail.com wrote:
No, 3 columns means:
Col 1 Col 2 Col 3
label widget
I tried doing the specific fields like:
form=SQLFORM.factory(db.patient(fields=['first_name']),
db.emergencycontacts, db.dependents, formstyle = 'table3cols')
but that just throws an error saying no tables selected. I guess what I am
trying to do is set certain fields to be show for each table
Hi Anthony,
Thanks for the note - what prevented me from making the custom layout is
that the form fields are generated on the fly; I don't know what they are
or how many up front (there are hundreds or thousands of fields generated
for this form), so inserting them separately seems tricky(?)
I have a new problem.
I already done my widget but now i want 5 rating widget's for 5 categories
in my database.
I have this column in my database (named places.categ):
places.categ
a
b
c
d
a
e
I have 21 markers in my Google Maps and
Hi Bruno, is this project alive ?
Saludos
El sábado, 6 de agosto de 2011 00:27:57 UTC-3, rochacbruno escribió:
HI, I am working a lot to create a simple CMS system based on RadiantCMS.
As a goal I want to create a database (cached) based, configurable system,
where has:
*Pages *
*Blocks
I have a new problem.
I already done my widget but now i want 5 rating widget's for 5 categories
in my database.
I have this column in my database (named places.categ):
places.categ
a
b
c
d
a
e
I have 21 markers in my Google Maps and
Thanks for the note - what prevented me from making the custom layout is
that the form fields are generated on the fly; I don't know what they are
or how many up front (there are hundreds or thousands of fields generated
for this form), so inserting them separately seems tricky(?)
You
How do you guys release upgrades of your own apps?
The setup is:
- You write a web2py app and release the code.
- Several people install it on their servers.
- They change the database connection string, and little more. It works for
real.
- Over time, they customize css files, even some views.
db.patient(fields=['first_name'])
No, the above isn't web2py syntax -- don't know where you saw that. As I
mentioned, to control which fields are shown, you can set the readable and
writable attributes of the fields (check the book), or you can list
individual fields instead of entire tables:
Previously we were able to define imports that we want shared across all
our models/controllers/modules by adding them to __init__.py in the
app/modules directory (eg. import simplejson as json). This doesn't seem
to work anymore, and I can't figure out what changed. Was this
functionality
Not sure but there should be. Please open a ticket and we will add it
tonight.
On Monday, 24 June 2013 05:05:34 UTC-5, lucas wrote:
hello one and all,
is there a setting to disable the left side panel that shows the filenames
in the editor?
my habits are used to it off. lucas
--
---
Good idea. Asap. It is easy to do.
On Monday, 24 June 2013 05:01:11 UTC-5, Holger Schurig wrote:
As I'm new to web2py, I usually have several tabs open to various web2py
chapters from the online book.
Unfortunately, the page title for each tab is web2py. See the attached
screenshot.
Can
I am not sure what you mean. If you install a module under the modules/
folder you should be able to import it anywhere in the app. Is this not
working?
On Monday, 24 June 2013 13:09:59 UTC-5, Matt wrote:
Previously we were able to define imports that we want shared across all
our
Yes, I am able to do that. But, in the __init__.py file inside the modules
directory I was also able to define something like import simplejson as
json (eg) and then it would act as if I imported that in all my
models/controllers/modules.
For a more specific example, we have a method called
Are you looking for an hard-code option or for an easy-to-click button to
reduce the whole panel?
Paolo
On Monday, June 24, 2013 8:31:48 PM UTC+2, Massimo Di Pierro wrote:
Not sure but there should be. Please open a ticket and we will add it
tonight.
On Monday, 24 June 2013 05:05:34 UTC-5,
for models, it's as easy as using a single file called
models/0_connection.py that holds the customizable bits (e.g. the DAL
connection string) and using a models/db.py for your static things, i.e.
your define_tables statements.
For updates to views that they customized in the meantime and you
ok, let's rewind a bit. if you configured whatever (i.e. nginx+uwsgi) and
all is working on 127.0.0.1:80 when accessed from the the server itself, it
HAS to work if you access the admin app using 127.0.0.1:80 over an ssh
tunnel. Now the question is: how do you access the working setup and how
I would add the title in the url, not only for a better seo but also for a
faster in-browser url matching against visited url while typing,
from:
http://web2py.com/books/default/chapter/29/02
to:
http://web2py.com/books/default/chapter/29/02/The database abstraction
Solved...
In Austria we have a service of our gouvernment called Bürgerkarte
(Citizen Card).
Details: http://www.buergerkarte.at/index.en.php
This service could be used to sign a pdf file in a way that it is accepted
by law.
I want to integrate this service in a web2py application.
But there
I have argued for slugs *instead* of chapter numbers in the URL's. There
are many links to the book on the internet (here, Stack Overflow, etc.),
and if we ever re-number the chapters (which we have done in the past), all
the old links break.
Also, when a section title ends with
Relating to d3.js and csv files, I'm having two problems trying to get a
string object to load either
1. with d3.csv.parse or with
2. function() {return x; }
right after the line,
g = new Dygraph( document.getElementById(div_pt),
that begins to generate a d3 graph.
The problem is similar
Do you want to embed the data in the page, or do you want to serve it as a
CSV file? If you want to embed it in the page, you might need to embed it
in some Javascript as a Javascript data structure rather than as pure HTML.
To serve a CSV file, see
Anthony, thanks! I will give the @service.csv method a try.
On Monday, June 24, 2013 3:12:15 PM UTC-5, Anthony wrote:
Do you want to embed the data in the page, or do you want to serve it as a
CSV file? If you want to embed it in the page, you might need to embed it
in some Javascript
hard-code or button? doesn't matter to me, just a way to do it and how to
get it done. cool? but, whatever the method, it be permanent and across
all editable files. lucas
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe
On Sunday, 23 June 2013 10:27:22 UTC+10, Anthony wrote:
On Saturday, June 22, 2013 4:55:02 PM UTC-4, lucas wrote:
it works fine, but only as long as requires=IS_NOT_EMPTY() is not also
included in the options.
Yes, the IS_NOT_EMPTY validator doesn't really make sense with a checkbox,
That is strange behavior. I tried it also, and it gave the error you
experienced. Here are some observations from my experiments.
It's saying your title string is empty; yet if you look in the DOM via
Firebug, title is being set correctly, just as shows up in the title bare
of the browser.
Hi,
I tried the @service.csv example in the book and it does return values, but
they are not in the form of a url but a download. I wonder if this is the
expected behavior? I am using mac os.
When I enter the path to the url including values, the system immediately
returns the downloads
Imagine you had an apache server set up on linux to serve web2py apps to
various virtual hosts, and you wanted one common web2py code base for the
sake of convenience, but allow each virtual host to have its own
applications directory.
What would be the best way of doing it? Redirects based on
This sounds a lot like the reason shared version control was invented,
which provides tools to manage simultaneous development on the same code
base. This is actually how web2py is developed, although of course with the
expectation that changes will be merged.
Look at github.
--
---
You
Anthony - thank you very much - that works perfectly!
Is this documented somewhere that I could have looked up myself?
--
---
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
in controller
from gluon.tools import Service
service = Service()
def call():
session.forget()
return service()
@service.json
def pullDataToMap():
...logic..
return result
result looks like this
{'San_Jose':102,'Paris':2,'London':38}
I am trying to call that function
Marco,
First try to understand where the slowness is: a loop of yours, dal
building a resultset, postgresql. Since the load comes from uwsgi seems a
problem on python/web2py side. Use the profiler.
1. check you are using processes with uwsgi not threads in a number not
above twice the number
http://web2py.com/books/default/chapter/29/07#Storing-the-original-filename
Note, for upload fields, request.vars.myuploadfield is just a Python
CGI.FieldStoragehttp://docs.python.org/2/library/cgi.html#using-the-cgi-moduleobject,
so it's not specific to web2py.
Anthony
On Monday, June 24,
I was looking at comparisons of such websites, but I though that must
be a common issue fo web2py developers, so that's why I asked. I can
design the app in such a way that this problem does not arise, but it
would take more work and I would be wasting the great admin interface.
My time is
No, when you request the URL, it's supposed to return a CSV file. You
provide the URL to D3, and it makes an Ajax request to the URL in order to
retrieve the CSV file. See https://github.com/mbostock/d3/wiki/CSV. Looks
like you can also pass a CSV string to D3.csv.parse(), so you might be able
I am trying this example and get an error. Is this the way to set up the
csv service
and call it? Do I need the .as_list() on the end of the select?
in default.py
def csvtab():
rows = db(db.ptoday.id0).select( ).as_list()
for row in rows:
data = row.csvdata
ddata =
Mmm, more info... I've tested with a hard-coded markmin input (the example
one, that I attach), and it fails also in GAE... Don't know what's
happening cause there is no log in the appengine dashboard (there is even
no warnings). Simply it renders the content without loading the css and js
Thanks for the tip.
I did set one field to not be readable like this:
Field('alternatepid', label='Alternate PID', readable=False),
but it still shows on my form.
Should'nt be there should it?
Thanks.
On Mon, Jun 24, 2013 at 1:57 PM, Anthony abasta...@gmail.com wrote:
web2py uses github and/or google code, developer's choice.
--
---
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
The method I first pointed out might be easier:
http://web2py.com/books/default/chapter/29/10#CSV
def csvtab():
rows = db(db.ptoday.id0).select( ).as_list()
for row in rows:
data = row.csvdata
Note, .as_list() converts the Rows object to a list of dictionaries, so you
cannot
On of the crud forms I generate in my app has such 3 fields:
date_from (date)
until_now (boolean)
date_to (date)
The idea is simple:
if until now is checked, date to *can be empty*;
else date_to *is required*;
(I worked from ... until now */or/* I worked from ... to ...)
*
*
Is there a way to
Try writable=False.
On Monday, June 24, 2013 6:04:43 PM UTC-4, Tom Russell wrote:
Thanks for the tip.
I did set one field to not be readable like this:
Field('alternatepid', label='Alternate PID', readable=False),
but it still shows on my form.
Should'nt be there should it?
Thanks.
Field('date_to', 'date', requires=IS_DATE_IN_RANGE(...) if not request.
vars.until_now else None)
The IS_DATE_IN_RANGE validator can be set up so it requires the date to be
later than request.vars.date_from. You can also use an onvalidation
function with the form.
Anthony
On Monday, June
That was quick. Thanks.
On Tuesday, June 25, 2013 12:17:39 AM UTC+2, Anthony wrote:
Field('date_to', 'date', requires=IS_DATE_IN_RANGE(...) if not request
.vars.until_now else None)
The IS_DATE_IN_RANGE validator can be set up so it requires the date to be
later than
Ah yes both readable and writable have to be defined. Thanks again
On Mon, Jun 24, 2013 at 6:12 PM, Anthony abasta...@gmail.com wrote:
Try writable=False.
On Monday, June 24, 2013 6:04:43 PM UTC-4, Tom Russell wrote:
Thanks for the tip.
I did set one field to not be readable like this:
Yes, it is --folder to change the application folder on the command line
but I'm 99% convinced the best way to do what I want is to rewrite URLs
with AliasMatch
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this
Totally agree with Anthony about associating well-named slugs to sections.
In the longer term, it is much much important for the book to be optimally
organised than worrying about old links. Having said that, it wouldn't be
too difficult to 'pin' current chapters to specific slug placeholders,
I have a form and I load a pre existing value that I generate internally
before I call the form. What I want to see on the form is the value shown
up but just as plain text so the user cannot modify it. If I do
readable-False then it just shows None for the value rather than the value.
How would
db.mytable.myfield.default = some_value
db.mytable.myfield.writable = False
Leave readable at True in order to show the value but not allow it to be
edited.
Anthony
On Monday, June 24, 2013 11:00:59 PM UTC-4, Tom Russell wrote:
I have a form and I load a pre existing value that I generate
Yes I tried that:
Field('medical_record_number', label='MRN', writable=False, readable=True,
requires=IS_NOT_EMPTY()),
Still just shows none for the field on the form.
In my controller this is what I am doing:
form.vars.medical_record_number = 'KND' + str(date.today().year) + '' +
hi Jose .
i had this problem too.
I posted an issue with it.
http://code.google.com/p/web2py/issues/detail?id=1560can=6
In a meantime , you could fix it by
At sqlhtml.py
Line 2618 : query = table._id != None --- query = table.id 0
hope it help.
On Tuesday, May 7, 2013 9:15:33 PM
I'm not sure that method will work for readonly fields, so you may have to
use the method I showed (i.e., set the default value for the field before
creating the form).
Anthony
On Monday, June 24, 2013 11:23:01 PM UTC-4, Tom Russell wrote:
Yes I tried that:
Field('medical_record_number',
I ended up doing this in the controller which works for what I need:
form.element('#no_table_medical_record_number')['_readonly']=True
On Tue, Jun 25, 2013 at 12:03 AM, Anthony abasta...@gmail.com wrote:
I'm not sure that method will work for readonly fields, so you may have to
use the
Yes that works, though it's not as secure because someone can still submit
a value for that field if they are determined, so you might want to check
for that variable on the server and delete it if submitted.
Anthony
On Tuesday, June 25, 2013 12:15:04 AM UTC-4, Tom Russell wrote:
I ended up
Yes I understand that. What would be the best way to handle this?
Seemingly, the couple of items suggested did not work for me so I am not
sure where that leaves me.
On Tue, Jun 25, 2013 at 12:35 AM, Anthony abasta...@gmail.com wrote:
Yes that works, though it's not as secure because someone
Did you try this method (setting these before creating the form):
db.mytable.myfield.default = some_value
db.mytable.myfield.writable = False
Anthony
On Tuesday, June 25, 2013 1:02:40 AM UTC-4, Tom Russell wrote:
Yes I understand that. What would be the best way to handle this?
Seemingly,
Yes I just tried it and that works fine. That works as expected. Thanks for
the help. Exactly what I was looking for to begin with.
On Tue, Jun 25, 2013 at 1:23 AM, Anthony abasta...@gmail.com wrote:
Did you try this method (setting these before creating the form):
db.mytable.myfield.default
So I took and modified the welcome app to my needs and added another app.
If I login with the welcome app and with a link, open the other app and
have it set with auth.requires_login(), it requires the user to login
again. How does one handle this stuff in web2py? Do I need another app the
way I
86 matches
Mail list logo