Doesn't this work?
db.post(id=ID).update_record(FIELD=VALUE)
Regards,
Annet
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message
You can create a dict and pass to update:
def post_update():
ID = request.vars.id
FIELD = request.vars.field
VALUE = request.vars.value
data = {FIELD: VALUE}
db(db.post.id==ID).update(**data)
Note: this solution is pure Python. No feature from Web2py here.
On Sat, Jul 12, 2014 at
a, pardon me, i realized my mistaken, i've complicated it.
*modules/functional_test.py*
#!/usr/bin/env python
# coding: utf8
import sys; sys.path.append('../../../')
from gluon.contrib.webclient import WebClient
client = WebClient('http://127.0.0.1:8000/testapp/',
postbacks =
Hi,
let say that i pass vars id, field & value to a controller. Than I want to
preform an update.
def post_update():
ID = request.vars.id
FIELD = request.vars.field
VALUE = request.vars.value
db(db.post.id==ID).update(FIELD=VALUE)
This, obviously, does not work. How can I achieve th
You can use routes.
On Sat, Jul 12, 2014 at 9:17 AM, Lisandro wrote:
> I'm quite a novice regarding to regular expresions, and I'm stuck with this
> idea: I want to hide appname, controller and function from specific url,
> lletting visible only the arguments of the url.
>
> For example, for this
after learning about gulp.js i had to do this
https://www.youtube.com/watch?v=zt5gnKk40Zw
my Gulpfile.coffee
gulp = require 'gulp'
stylus = require 'gulp-stylus'
prefix = require 'gulp-autoprefixer'
cssmin = require 'gulp-cssmin'
jade = require 'gulp-jade'
minifyHTML = re
Sure. Note, you don't need to replace the whole widget -- just update the
attribute directly:
form.element('input', _id='%s_%s' % (table_name, field.name)).update(
data={'show-trigger': '%s_%s' % (table_name, field.show_if.first.name)})
Anthony
On Saturday, July 12, 2014 4:38:58 PM UTC-4, L
I think a framework like web2py shouldn't break by default, and work only
if you know which parameter to set.
Anyway here's a better example:
db.define_table('person', Field('name'))
db.define_table('other', Field('show_trigger', 'boolean'))
db.person.name.show_if = (db.other.show_trigger ==
I want a hidden input with a custom attribute (e.g.: data-geo) to be stored
in the database upon form validation.
How can I achieve this ?
1. Adding raw html to a custom form, although custom forms have a lot of
drawbacks in web2py
2. Messing with DOM. At your own risks.
Have you confirmed that "CHOPARD" is in the HTML delivered by the server?
Note, the webclient will not run any Javascript or Ajax requests, so if
"CHOPARD" is added to the DOM via Javascript after the initial HTML is sent
from the server, you won't be able to test for it.
Anthony
On Saturday,
Put db.trip.id > 0 in the query and check the delete box.
Anthony
On Saturday, July 12, 2014 11:51:58 AM UTC-4, JoeCodeswell wrote:
>
> Dear web2py-users,
>
> What is the proper way to truncate table from appadmin?
>
> The following does a truncate but shows errors in response.flash.
>
> In https
Instead, you can just do this:
form = SQLFORM.factory(db.person, table_name='person')
Anthony
On Saturday, July 12, 2014 2:02:45 PM UTC-4, Louis Amon wrote:
>
> Not sure if somebody noticed before, but the show_if syntax (backed by
> web2py.js) is actually breaking if you use SQLFORM.factory to
Not sure if somebody noticed before, but the show_if syntax (backed by
web2py.js) is actually breaking if you use SQLFORM.factory to generate your
form.
Example:
db.define_table('person', Field('name', 'string'), Field('show_trigger',
> 'boolean'))
> db.person.name.show_if = (db.person.show_t
I would also like to add an optional 'extra' because it is nice to be able
to search like this:
search_text = '"David Cameron" uk'
By quoting search 'phrases' as well as words, you can get a better result.
After all, I would not want every David in the UK to be listed.
I have found tha
Dear web2py-users,
What is the proper way to truncate table from appadmin?
The following does a truncate but shows errors in response.flash.
In https:// ...appadmin/select/db?query=db.trip.id%3E0
Query:
Update: [x] db.trip.truncate()
Delete: [ ]
RESULT:
db.trip is truncated
I'm aware of that. But I can't get it to work inside if s component loaded
on my page. Works fine when not in a component.
Jim
On Jul 12, 2014 4:33 AM, "Tim Richardson" wrote:
> The plugin is on web2pyslices and can be installed via admin. The book
> talks about using web2pyslices and plugins.
I'm quite a novice regarding to regular expresions, and I'm stuck with this
idea: I want to hide *appname, controller and function* from specific url,
lletting visible only the arguments of the url.
For example, for this url:
http://mydomain.com/init/default/store/erbalito
should look like this
The link has a transcription to text of the video comments
Em 12/07/2014 08:49, "Massimo Di Pierro"
escreveu:
> What does the video say? Can you summarize it? I have limited bandwidth
> today.
>
> On Friday, 11 July 2014 17:22:24 UTC-5, Ramos wrote:
>>
>> Can this help to use coffeescript instead
hi,
pardon me for opening the old discussion. i had controllers (master.py)
that contain grid function (brand), and want to test it in command prompt
(functional test), yet in the web browser it show the value (running well
as expected), but not in the terminal. any idea what's going on the
ba
Do not do dal queries in a try..except. If the db query fails it may not be
automatically rolled back.
I think you want:
category = request.args(0) and db.blog_cat(slug=request.args(0))
query = db.blog_post.blog_cat.contains(category.id) if category else
db.plog_post
posts = db(query).select(ord
Hi group!
I'm building a small blog where the user has the ability to assign multiple
categories to blog posts.
My quesition is.. what is the proper way to query those posts?
db.define_table('blog_cat',
Field('name', 'string', label=T('Name of the category')),
Fie
The plugin is on web2pyslices and can be installed via admin. The book talks
about using web2pyslices and plugins.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Iss
What does the video say? Can you summarize it? I have limited bandwidth
today.
On Friday, 11 July 2014 17:22:24 UTC-5, Ramos wrote:
>
> Can this help to use coffeescript instead of javascript ?
>
>
> http://tarantsov.com/WorkflowThu/source-maps-with-coffeescript-and-uglify-js/
>
> web2py does not
I am not 100% sure but why are you storing information in cookies when not
in session? It is more error prone and does not add anything. Are you
disabling sessions for speed somehow?
On Friday, 11 July 2014 11:23:13 UTC-5, Arthur Alves wrote:
>
> Hello guys,
>
> I have a problem with response.c
This is a security issue. All action (defined as functions in controllers)
but have a view, unless accessed locally. This prevents you for
accidentally exposing internal objects.
On Friday, 11 July 2014 10:34:44 UTC-5, Carl Hunter Roach wrote:
>
> In my default.py I add a function newview
>
> wh
Mind web2py offers all of this out of the box:
db.define_table('stuff',Field('name'), auth.signature)
auth.signature adds created_on, created_by, modified_on, modified_by and
is_active. These fields can be used by auth for full auditing if enabled by
auth.enable_record_versioning(db)
Any
for example, let's say you want to upload text files.
db.define_table('one',Field('filename','upload'),Field('processed','boolean',default=False,writable=False))
db.define_table('two',Field('one','reference one'),Field('results','text'))
def index():
return dict(form = SQLFORM.grid(db.one))
Can you try:
--config=T:/MyFolder/etc/config.py
It is not finding the file.
On Thursday, 10 July 2014 03:56:37 UTC-5, Kuba Kozłowicz wrote:
>
> I have following project structure:
>
> T:/MyFolder/web2py.py
> T:/MyFolder/etc/config.py
>
> I am trying to run the instance with following command:
>
I do not think there is any real issue here. You can create web
applications with web2py that runs in a TV browser. It is mostly a matter
of choosing a layout that fits the screen size and restrict to JS libraries
that are supported by TV browsers.
In fact any web2py app will run on a TV brows
29 matches
Mail list logo