First, thank you very much for your help. The first solution works perfect
:)
But i have some issues with the ongoing ones, i'm afraid
def ausgabe():
a = 4
records = SQLTABLE(dba(dba.person._id==
a).select(dba.person.name),headers='fieldname:capitalize')
newvariable = records[0].name
Thanks anthony, you're right - this models_to_run approach makes no sense in my
use-case - it assumes a 1:1 correlation between controllers and their
used-models, which would only occure in very simple apps. The whole point of
using a relational database is to have great flexibility and
hello,
my database (sqlite) is (partially) filled by another program,
which inserts Null or None values.
Now if I use these fields in an HTML form, they show up as None
instead of an empty string.
Is there a simple way to solve this for all fields at once ?
thanks,
Stef
--
Resources:
-
Hey guys,
It's been a while since I used web2py and I've pretty much forgotten
everything. Try as I might for the last two days I can't quite figure this
out.
I used a web2pyslice to create a main application which manages
authentication. I have another app referencing main to
if you mean the other app fills the fields with an actual string that
holds the 'None' value (it could be very well foo, bar or pizza)
then
fake_none_value = 'foo'
for f in db.table.fields:
db(db.table[f] == fake_none_value).update(f=None)
should solve it
On Saturday, January 18, 2014
we're trying to come up with something here
http://code.google.com/p/web2py/issues/detail?id=1809
if you have any inputs please share ^_^
On Saturday, January 18, 2014 1:30:33 AM UTC+1, Ray (a.k.a. Iceberg) wrote:
On Sunday, December 15, 2013 10:00:19 AM UTC-7, Rob Paire wrote:
Hello all,
replace
form = SQLFORM.grid(db.rig, user_signature=False)
with
form = SQLFORM.grid(db.rig.user_id = auth.user.id,
user_signature=False)
On Saturday, 18 January 2014 10:42:38 UTC-6, David wrote:
Hey guys,
It's been a while since I used web2py and I've pretty much forgotten
Hi,
I'm new to web2py and just learning the framework.
I have an issue with my CSS static file which is not reloaded by the
browser in local.
I have read thread about versioning of static files but it doesn't seem to
solve the problem. Probably I don't it correctly.
Here is the line set in my
Congratulations... and a big thank you also... I have just found web2py and
absolutely amazed at how brilliant it is
On Saturday, 4 January 2014 14:08:38 UTC+10, Massimo Di Pierro wrote:
Web2py/me have been nominated for the Edison Award. Please wish web2py
(and me) good luck. :-)
--
Hi Massimo,
This is where I was having problems. I tried what you posted.
@auth.requires_login()
def edit_rigs():
form = SQLFORM.grid(db.rig.user_id = auth.user.id,
user_signature=False)
return dict(form=form)
I get a Keyword can't be expression error on this. That's where I am
I see my problem was a simple syntax error.
== not =
Yes it is working like that. Thank you Massimo!
On Saturday, January 18, 2014 12:50:07 PM UTC-6, David wrote:
Hi Massimo,
This is where I was having problems. I tried what you posted.
@auth.requires_login()
def edit_rigs():
form
Hi and welcome!
If you look at the source of the page in a browser, do you see the
static_version inserted as a part of the path to your css? It should be
something like /static/_1.1.4/css/somecssfile.css.
After a change to 1.1.5, the path should change to
/static/_1.1.5/css/somecssfile.css.
Only the default value of models_to_run assumes a 1:1 correspondence
between controllers and models. You can set the value of models_to_run to
whatever you want conditionally (and it can even change multiple times from
model file to model file). So, for example, you could do:
if
Also, note that models_to_run is a list of regexes (relative to the /models
folder), so you don't need to list each individual model file.
Anthony
On Saturday, January 18, 2014 2:08:16 PM UTC-5, Anthony wrote:
Only the default value of models_to_run assumes a 1:1 correspondence
between
thanks,
it's a workaround,
but I mean the field is empty / Null / None (type),
which is translated by web2py into a string value 'None'.
cheers,
Stef
On 18-01-14 19:06, Niphlod wrote:
if you mean the other app fills the fields with an actual string
that holds the 'None' value (it could be
Hi!
I have a problem with web2py ... I want to timestamp user-initiated changes
in tables which perfectly works when using
Field('modified_on', 'datetime', default=request.now,
update=request.now, readable=False, writable=False),
But since my application also changes values in
My bad. I put the typo in the example.
On Saturday, 18 January 2014 12:51:30 UTC-6, David wrote:
I see my problem was a simple syntax error.
== not =
Yes it is working like that. Thank you Massimo!
On Saturday, January 18, 2014 12:50:07 PM UTC-6, David wrote:
Hi Massimo,
This is
Hey,
I have a simple one-to-many relation, between questions and answers. Each
question may have 0 or more answers, so any *db.answer.question* refers
to a certain *db.question.id http://db.question.id*.
Now, in order to create a code for efficiently displaying the questions
and their
Hi everyone,
Although I have used database serveral times, I have not done anything
beyond very basic, so I am wondering what would be the best practice for
this case:
I have a database table for storing a 'real-time' playlist of songs like
this:
hello,
maybe I'm doing this completely wrong, but it's a long time ago I used
web2py.
In the main page I have a lot of links.
In fact these links are just indexes to a row in the database.
As I understand, the only way to pass parameters from clicking a link,
is to use services.
An
Example from
https://google-developers.appspot.com/chart/interactive/docs/gallery/combochart
If I place this code in a standard .html view, it works fine-
script
jQuery(document).ready(function() {
setTimeout(function() {
// Google Visualization stuff goes here
function
You deserve it, Massimo. I wish the best for you and to the awesome web2py!
On Saturday, January 4, 2014 1:08:38 AM UTC-3, Massimo Di Pierro wrote:
Web2py/me have been nominated for the Edison Award. Please wish web2py
(and me) good luck. :-)
--
Resources:
- http://web2py.com
-
I'm trying to automatically count each time a record is being updated. I
could make a lambda function that worked for a dictionary:
Field('edits', 'integer', compute=lambda r: int(r['edits'] or 0) + 1 ),
However, I don't get this to work in practice. Can a lambda for edits not
use its own
but I mean the field is empty / Null / None (type),
which is translated by web2py into a string value 'None'.
None is translated into a string value as 'None' by Python, not web2py. If
you want different behavior, you have to be explicit (no reason to assume
the default behavior should be
I have tried this and work, let me know if it's the think you wanted. I
have used SQLFORM but i guess the code will be the same for CRUD (I have
never used it)
Just my workaround, I think there will be a better method perhaps
import time # This is required to include time module.
import
I think you are mixing concepts you cannot return something from
process().accepted, you need to return at the end of your tracer_form()
function, is the function who returns things. In the proccess().accepted
you can do some operations, and modify variables that will be later
returned by
I'm trying to automatically count each time a record is being updated. I
could make a lambda function that worked for a dictionary:
Field('edits', 'integer', compute=lambda r: int(r['edits'] or 0) + 1 ),
However, I don't get this to work in practice. Can a lambda for edits not
use its
27 matches
Mail list logo