Hello everyone.
Could you tell me how to create a new record in database without
submit buttons?
I actually would like to do it by the onclick event.
I know that I can call the ajax function like this.
But I don"t know what I have to write in the 'def:writing'.
My code implemented by a submit
On Jul 1, 8:34 pm, pbreit wrote:
> I usually do extension=''
What would extension=None do? It seems to make the most semantic
sense, to me at least.
In the method called by the AJAX event, you don't need the form at all. You
can just do a straight insert. You must pass the data to be inserted as
part of the AJAX call, either via args, or post data or some other method on
the URL. Then, inside writing(), just do a direct DB insert as docum
'Insert' method. That is what I wanted to know.
Thank you so much!!
2011/7/2 cjrh
> In the method called by the AJAX event, you don't need the form at all.
> You can just do a straight insert. You must pass the data to be inserted
> as part of the AJAX call, either via args, or post data or so
If you format this post in markmin and email it to me, I'll add it to the
book as an additional subsection after Apache setup.
Added here:
http://web2py.com/book/default/chapter/04#Cron
Please verify that I got the details correct. Also, in future if you want
something fixed in the book just email me directly and I'll get it done
ASAP. My ability to follow the groups closely waxes and wanes relative to
how busy I am
I have found that only the *new *Google Groups is working reliably. Using
the old system has become very unreliable.
Hi, I have a very simple case use that I'm not able to solve using GAE:
I have a file with the content of two tables (cities and provinces). Cities
have a db.provinces field, and when I start a new aplicacation I use to
populate these tables using data from a module with this structure:
Provinces
GAE is a NoSQL database http://en.wikipedia.org/wiki/NoSQL
but you can use a field where you can store a list of ids (one to many
relation denormalized)
http://web2py.com/book/default/chapter/06#Many-to-Many,-list:,-and-contains
I was trying to see this link--
http://mdp.cti.depaul.edu/
Is this link broken?
I could not access it.
2011/7/2 Vasile Ermicioi :
> GAE is a NoSQL database http://en.wikipedia.org/wiki/NoSQL
> but you can use a field where you can store a list of ids (one to many
> relation denormalized)
> http://web2py.com/book/default/chapter/06#Many-to-Many,-list:,-and-contains
>
I know, but using dal I can use
Can you explain to me why you prefer ajax=False to ajax=True? What
advantages do you expect?
On Jul 2, 1:28 am, LightOfMooN wrote:
> ajax=False is very important for me, so, I like 1.96 more than 1.97 :)
> I use it at most interactive components, that can be displayed on the
> all pages of site.
Where is that link? That was replaced by http://web2py.com more than 3
years ago.
On Jul 2, 7:56 am, Vineet wrote:
> I was trying to see this link--http://mdp.cti.depaul.edu/
> Is this link broken?
> I could not access it.
On Saturday, July 2, 2011 6:22:15 AM UTC-4, cjrh wrote:
>
> On Jul 1, 8:34 pm, pbreit wrote:
> > I usually do extension=''
>
> What would extension=None do? It seems to make the most semantic
> sense, to me at least.
The code for URL does this:
if extension is None and r.extension !=
Note, in that case, you won't be taking advantage of any of the built-in
form processing, such as input validation and return/display of form errors.
To get the validation, you could use the .validate_and_insert() method, but
you'd still have to manually process and deal with the potential valid
On Jul 2, 2011, at 7:41 AM, Anthony wrote:
> On Saturday, July 2, 2011 6:22:15 AM UTC-4, cjrh wrote:
> On Jul 1, 8:34 pm, pbreit wrote:
> > I usually do extension=''
>
> What would extension=None do? It seems to make the most semantic
> sense, to me at least.
>
> The code for URL does this:
With ajax=False I don't need some javascripts on every page.
I can just add {{=LOAD('voting', 'voting_viewlet', ajax=False)[0][0]}}
in layout.html, and on every page users can vote (for example),
because ajax=False passed vars of current request to LOAD. And I liked
it, because I can write some com
I've just been using it as a way to compartmentalize code but without the extra
request. For some things, the discrete load doesn't seem appropriate. If I lost
Ajax=false, I would probably bring the code back into the calling
view/controller. Which is not a huge deal for me. I'm also looking int
I pasted some code to better explain my approach:
http://pastebin.com/MS3y6sNQ
Advantages of ajax=false for me is passing vars of current request to
all LOADed components.
On 2 июл, 20:21, Massimo Di Pierro wrote:
> Can you explain to me why you prefer ajax=False to ajax=True? What
> advantages
On Saturday, 2 July 2011 16:57:11 UTC+2, Jonathan Lundell wrote:
>
> On Jul 2, 2011, at 7:41 AM, Anthony wrote:
> > On Saturday, July 2, 2011 6:22:15 AM UTC-4, cjrh wrote:
>
> So, extension=None is saying that we're going to stick with the same
> extension as the current request, and if it happens
You were right Anthony.
And I found what I exactly needed was 'Components' .
I didn't want to refresh the entire page.
But anyways, the fact that there is the insert method and it doesn't give me
much to create a record from input forms, was new knowledge for me, so it
was good to know about it.
Th
On Jul 2, 2011, at 9:37 AM, cjrh wrote:
> On Saturday, 2 July 2011 16:57:11 UTC+2, Jonathan Lundell wrote:
> On Jul 2, 2011, at 7:41 AM, Anthony wrote:
> > On Saturday, July 2, 2011 6:22:15 AM UTC-4, cjrh wrote:
> So, extension=None is saying that we're going to stick with the same
> extension as
Defaulting to 'html' is not what we want. In general, we don't want to see
explict 'html' extensions in our urls. Instead, web2py is set up to
interpret urls without extensions as 'html' view requests. If you explicitly
pass 'html' to URL() as the extension, it will add it to the URL --
otherwi
I don't know if this would work for you but you can compartmentalize view
snippets and {{include}} them:
{{include './html/item-box.html'}}
I have zero desire to for JavaScript-less support.
(In reply to both JL and AB)
The point regarding backwards compatibility is well-taken, I wouldn't want
to mess with that at all. However, cognitive dissonance in code is a
particular bugbear of mine. I am especially nervous (in general) of
situations where one thing is used to *sematically*
On Fri, Jul 1, 2011 at 1:20 AM, Bruno Rocha wrote:
> Db.define_table('foo',Field('a'),Field('b'), Field('ab',unique=True,
> compute=lambda r: r.a + r.b))
>
This failed for me with sqlite and I see from other discussions that the
same is true with Django - sqlite throws an error that it cannot cre
Yes, I can include templates with {{include}}, but I can't process
vars by that way.
On 2 июл, 23:38, pbreit wrote:
> I don't know if this would work for you but you can compartmentalize view
> snippets and {{include}} them:
> {{include './html/item-box.html'}}
>
> I have zero desire to for JavaS
I believe templates that you include will have access to the current
request.vars. You should even be able to call functions from views (though
they would have to return HTML or some objects your view can then handle).
On Saturday, July 2, 2011 2:59:44 PM UTC-4, LightOfMooN wrote:
> Yes, I can
On Jul 2, 2011, at 10:52 AM, cjrh wrote:
> The point regarding backwards compatibility is well-taken, I wouldn't want
> to mess with that at all. However, cognitive dissonance in code is a
> particular bugbear of mine. I am especially nervous (in general) of
> situations where one thing is us
Getting more comfortable with Web2Py and there sure is a lot to like about
it.
I'm wondering what is considered best practice for inserting records that
might already exist, when I also want to get the id of the record if it does
exist. I haven't come across a shortcut for this.
For now, I'm usi
Greetings,
I just installed Instant Press and am trying to figure out how to skin
it. The views/layout.html says you should create views/layouts/xxx, but
it's not real specific on what to name those files. I've tried
views/layouts/layout.html and views/layouts/index.html, but neither seem
to
At this moment I am doing this for a multiselect form page:
db.py:
db.define_table('instance',Field('app',db.application),Field('server',db.server),Field('type','string'),format=lambda
r: '%s %s' %
(db.application[r.app].name,db.server[r.server].hostname))
#table constraints:
db.instance.app.requ
Be careful about using an 'except' without specifying specific exception
types -- that code will attempt an insert regardless of the reason for the
failure in the 'try' clause.
Anthony
On Saturday, July 2, 2011 6:05:46 PM UTC-4, Nick Arnett wrote:
> Getting more comfortable with Web2Py and th
I also use LOAD(ajax=False) in emails and am not sure how well ajax=True
would work in various email clients.
Thanks for the ideas, I'm looking at the source code now.
On Jul 1, 6:15 pm, Bruno Rocha wrote:
> Here is a modified versionhttps://bitbucket.org/rochacbruno/surveycloud
>
> Bug fixes
> Auth included
> No more cpuckle
> Powertables
> Smart reports
>
> http://zerp.ly/rochacbruno
> Em 30/06/2011 23
I'm getting some unexpected 404s. Is there any way to make sure any route
caching is flushed? Any other ideas what might cause the problem? Nginx +
uWSGI on Ubuntu.
False alarm. Missing view. Have missing views always generated 404s? I know
the generics changed so missing views used to be rare.
On Sat, Jul 2, 2011 at 7:39 PM, Anthony wrote:
> Be careful about using an 'except' without specifying specific exception
> types -- that code will attempt an insert regardless of the reason for the
> failure in the 'try' clause.
>
I was wondering if someone would mention that... was just shortc
Do this instead
try:
urlID = db.web_page(url=url).id
except (KeyError,TyepError):
urlID = db.web_page.insert(url=url)
or better
row = db.web_page(url=url)
urlID = row and row.id or db.web_page.insert(url=url)
If db.web_page(url=url) fails with an OperationalError (database
Hello!
How do I make a database table where the fields are defined by another
table?
For example, suppose some users of my system are event organizers, and they
can define what fields would belong in a person's profile.
Then, attendees of that event have to fill out a profile with those specif
40 matches
Mail list logo