i set form.errors = dict() at the end of controller but i still get errors,
is this a bug or i'm doing a wrong way?
--
---
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
Hi,
i have a count problem.
I have two queries.
assets = db((db.asset.asset_class_id == asset_class_id) &
(db.asset_value.asset_id == db.asset.id) &
(db.asset_value.location_value ==
location_id)).select(db.asset.ALL,
In documentation i see:
>>> count = db.person.id.count()
>>> for row in db(db.person.id==db.thing.owner_id).select(
db.person.name, count, groupby=db.person.name):
print row.person.name, row[count]
Alex 2
Bob 1
but i need to limit the number of rows
--
---
You received this m
Hey cheers!!! exactly what am looking for
On Thu, Apr 25, 2013 at 8:40 AM, Johann Spies wrote:
> What about using the keepvalues option:
>
> From the book:
>
> form.accepts(vars, session=None, formname='default',
> keepvalues=False, onvalidation=None,
> dbio=True, h
I am having a nightmare getting file upload to work when the form is loaded
using LOAD or component=(URL, tarrget=div). The file fails to be uploaded
but the record is added to the DB without the file record. It does also not
appear in the upload folder
--
...
Hi,
I am trying to connect to a remote postgres database running on a ubuntu
server. The application is hosted on windows 7 server. Getting following
error on application startup:
('ERROR', '42P07',
'relation "mytable" already exists')
The strange thing is in databases folder, I already have
You need to use some ajax file upload mechanism.
Here's an example:
http://www.web2pyslices.com/slice/show/1438/ajax-file-upload-in-loadweb2py-components
If you follow that example, I recommend you put the javascript directly on
the webpages that will use it so you don't have to deal with versio
Well the local variable 'r' referenced before assignment seems obvious, if
you have no data, like it is happening now (the response has "results":[]),
then r never gets defined. You could fix this setting r = [] before the
for.
Quarta-feira, 24 de Abril de 2013 10:01:05 UTC+1, 黄祥 escreveu:
>
>
you may have the mytable file but the connection string when it was
generated was different (there's a hash in front of all .table files just
for this). Anyway, if you're sure that you don't need to trigger any
migration, just set fake_migrate_all=True for one request and all .table
files will
what's the purpose of limiting the number of rows you have to count ?
On Thursday, April 25, 2013 11:39:50 AM UTC+2, Domagoj Kovač wrote:
>
> In documentation i see:
>
> >>> count = db.person.id.count()
> >>> for row in db(db.person.id==db.thing.owner_id).select(
> db.person.name, count,
http://web2py.com/books/default/chapter/29/12?search=uploads
*Because Ajax post does not support multipart forms, i.e. file uploads,
upload fields will not work with the LOAD component. You could be fooled
into thinking it would work because upload fields will function normally if
POST is done
You misunderstood me. In the post above there is a regular select without
limitby clause, i want to limit number of records in that select, so i
assume count will be also limit?
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubsc
Thanx!!! will check it out.
On Thu, Apr 25, 2013 at 2:09 PM, Niphlod wrote:
> http://web2py.com/books/default/chapter/29/12?search=uploads
>
> *Because Ajax post does not support multipart forms, i.e. file uploads,
> upload fields will not work with the LOAD component. You could be fooled
> int
Hi,
I have three tables, say "parent", "child" and "grandchild", and want to
do an inner join on parent and child, and left outer join on child &
grandchild. So, all parents with children, and all grandchildren if they
exist.
However, I can't accomplish this in a single query, and have been
During validation, each input gets its own reference to form.errors, so if
you simply replace form.errors, each input will still refer to the original
form.errors. So, instead of replacing form.errors, you have to alter it:
form.errors.clear()
Anyway, this shouldn't be necessary, because you ca
thanks, what is the difference between hideerror in sqlform and
form.process? i noticed errors hide only if i use hideerror in sqlform not
in form.process
On Thursday, April 25, 2013 5:16:27 PM UTC+4:30, Anthony wrote:
>
> During validation, each input gets its own reference to form.errors, so i
This is not cool, its giving me a weird behaviour and its not even working.
On Thu, Apr 25, 2013 at 1:19 PM, Leonel Câmara wrote:
> You need to use some ajax file upload mechanism.
>
> Here's an example:
>
> http://www.web2pyslices.com/slice/show/1438/ajax-file-upload-in-loadweb2py-components
>
Can I have an example looked at a slice it does not work either!
On Thu, Apr 25, 2013 at 2:18 PM, Teddy Nyambe wrote:
> Thanx!!! will check it out.
>
>
> On Thu, Apr 25, 2013 at 2:09 PM, Niphlod wrote:
>
>> http://web2py.com/books/default/chapter/29/12?search=uploads
>>
>> *Because Ajax post do
Technically, hideerror is an argument of the .accepts() method of FORM (and
therefore SQLFORM) -- it is also an argument of .validate() and .process(),
which ultimately call .accepts(). Because of the way it is implemented, you
can also pass hideerror directly to FORM() and SQLFORM(). It should
I am trying to customize a json field to use a widget to be used at
SQLFORM.smartgrid that:
1. create a custom number of inputs to receive quantity of items for each
month of project
2. put this values on json field
3. update them at database.
the 2 first i could put to work, using the code below
So for the website that I'm developing I want my users to be able to set
"availabilities," and after they have expired, I want them to be set as
inactive . Also another feature would be validating the form to make sure
the start and end time contained a vaild availibility (ex. the start time <
I think your mistake is the following :
db(where clauses).select(tables and join)
So your query should read like this :
rows=db(WHERE CLAUSE IF YOU HAVE SOME OTHER THAN THE
JOIN).select(db.parent.ALL,
db.child.ALL, db.grandchild.ALL, join=db.child.on(db.child.**parent_id==
db.parent.id), left=db
for form validation and list user i think you can do something like :
e.g. using sqlform.grid (you can modified it if you want to use sqlform)
def __onvalidation_booking(form):
if form.vars.start_availability > form.vars.end_availability:
form.errors.end_availability = 'End Availabili
how are you setting self.accept_result.dict_response? if it is request
args or vars web2py does some checking to prevent various code injection
attacks. maybe that is mucking with your binary data?
On Friday, April 19, 2013 1:51:29 PM UTC-7, Jim Gregory wrote:
>
> I'm working on a script to ge
>
> DAL now supports MongoDB which is nice for auth and forms. But I'd like to
> use the MongoDB query facilities (and maybe GridFS).
> Is it possible to obtain a connection to the database through DAL or
> should just use pymongo's MongoClient, as if it was another application?
>
A possible s
It's not working because you're doing something wrong. Probably because
you're just copy pasting things without thinking.
Here is an example of a working view using it, you can replace {{=form}}
with your LOAD.
{{extend 'layout.html'}}
{{block head}}
http://malsup.github.com/jquery.form.js";>
I'm using a compute field to set uid's for model instances. The problem is
that the compute function gets called on INSERT and on each subsequent
UPDATE operation.
I don't want the UPDATE's to change this field - can I somehow detect where
there's an INSERT or an UPDATE in progress? I thought a
auth_user stores the information about users
auth_cas stores the tickets used by CAS to determine whether a user is
logged in or not.
It is used for the CAS server, not client.
On Wednesday, 24 April 2013 14:00:17 UTC-5, mjm wrote:
>
> The docs at
> http://web2py.com/books/default/chapter/29/09
I've got a query which looks like this:
(db.tracking.number >= 0) & (db.tracking.number <= 22000)
where number is an integer. And this should select everything with
numberbetween 0 and 22000 but it doesn't. For example, if I set the query to
just
(db.tracking.number >= 0)
as expected it grab
Code very similar to this has worked in prior versions of Web2py.
pertinent code from controller:
PRODS = db.purchased_products
POPRODS = db.purchase_order_products
#base query just does a join
q = LOTS.product_id==PRODS.id
# find out if we need to add to the base query
field = request.get_vars
Thanks for the help. It worked.
After regeneration of .table files, fake_migrate_all flag should be set to
False again, right?
Regards
On Thursday, 25 April 2013 17:04:15 UTC+5, Niphlod wrote:
>
> you may have the mytable file but the connection string when it was
> generated was different (t
Thank you both for your replies.
The reason I asked was I want to narrow the number of third party
JavaScript plugins down as much as I can.
Furthermore, the autocomplete/typeahead source is a table containing 5000+
records, that's why my
source is a json one.
For now I'll stick with a customiz
yes ideally you run in production with migrate=False.
When you need to change table models, than migrate=True.
When you run into sync problems, and only then, fake_migrate_all is there
to help.
On Thursday, April 25, 2013 6:47:35 PM UTC+2, at wrote:
>
>
> Thanks for the help. It worked.
>
>
prepare a table model and a select() to reproduce the issue please...
PS: I'm not sure that &= is recommended/supported.
--
---
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, sen
As long as web2py "goes", it issues a select to your database engine and
that one is responsible for picking up the records you want.
Is the select generated by web2py correct ?
If yes, then it's a problem either with your backend or your data.
If not, then pack an app to reproduce the issue.
PS
a computed field gets calculated on update by design. it's something
"dependant" on all other rows values, so if they change, the computed value
needs to change also.
If you want to calculate it only on insert, why don't you just set a
default value ?
If the case is more complicated, I urge
that's more or less exactly what I don't understand. you usually
count() something without any limits because you don't know the cardinality
of your wanted resultset.
If you limit your resultset to n rows, what's the purpose of counting ?
That's why there's no db(query).count(limitby=(0,n))
Ah silly me, I totally overlooked the default functionality. And those
triggers seem useful. Thanks :-)
On Thursday, April 25, 2013 8:23:24 PM UTC+2, Niphlod wrote:
>
> a computed field gets calculated on update by design. it's something
> "dependant" on all other rows values, so if they cha
I am using SQLite and had changed from string->int so I deleted all of the
database files in /myapp/databases and then reloaded all of the data. The
issue persisted :(
The select generated is correct. I think you're right in saying it's
something wrong with the backend.
Thanks!
David
--
--
Does any one use wymeditor in web2py?
I downloaded version 0.5 and put it in the static folder, and included the
following tag in layout.html
and used the following function:
$(document).ready(function(){
$('#promo_text').wymeditor();
});
For some reason this doesn't turn the promo_text
count = db.person.id.count()
I understand this line of code, it is obvious that limitby clause here
would be stupid.
>>> for row in db(db.person.id==db.thing.owner_id).select(
db.person.name, count, groupby=db.person.name):
print row.person.name, row[count]
Alex 2
Bob 1
I don'
Thanks to all of you for your suggestions. I'm not sure which way I'll
tackle this, but I have a good understanding now of what my options are to
tweak the SQLFORM feature. Your help is much appreciated.
--
---
You received this message because you are subscribed to the Google Groups
"web2py
Yeah, I agree. I read the documentation and I have no clue what is
happening there. Are there two people named Alex? Does 'Alex' own two
items? Why is it grouping by person name instead of person id? Why is
'count' assigned as a count of person IDs, used as an argument in the
select (presumably
Thanks!
--
---
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 options, visit https://groups.google.com/groups/opt_o
Thanks Mark!
--
---
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 options, visit https://groups.google.com/groups
db.person.id.count() returns an Expression object. It generates SQL like
"COUNT(person.id)". When it is passed to the .select(), the count is
returned as one of the columns in the result. The key used to identify the
count column in each Row object of the result is the count SQL itself
(i.e., "
Hi Massimo, I'm wondering how apply this change, I tried with the last
version, but isn't work yet,
I thought that was implemented in gluon\sqlhtml.py line 2242...
I'm trying to call it on this way:
grid = SQLFORM.grid()
return dict(form=form, grid=grid, license_plate=license_plate,
summary=
Hiding errors in SQLFORM.grid?
for example:
form = SQLFORM(db.table):
if form.accepts(request.vars, hideerror=True):
In SQLFORM.grid?
El viernes, 14 de septiembre de 2012 08:25:45 UTC-3, Gerd escribió:
>
> Hi!
>
> I receive the following error
>
> Traceback (most recent call last):
>
&= is now in trunk but one cannot do
query = date_field < "4/1/13 and 4/5/13"
On Thursday, 25 April 2013 13:16:52 UTC-5, Niphlod wrote:
>
> prepare a table model and a select() to reproduce the issue please...
>
> PS: I'm not sure that &= is recommended/supported.
>
--
---
You received this
I raised the issue https://code.google.com/p/web2py/issues/detail?id=1462
Thanks and warm regards,
Aravindan.
On Wednesday, 24 April 2013 09:54:01 UTC+5:30, Massimo Di Pierro wrote:
>
> This is reasonable request and we may be able to accommodate it. Please
> open a ticket on google code.
>
> ht
On Thursday, April 25, 2013 7:11:17 PM UTC-4, Massimo Di Pierro wrote:
> &= is now in trunk but one cannot do
I think it's always been possible to do &= with Query objects because the
__and__ method is defined. What was recently added was __rand__ and
__ror__, which according to
http://docs.p
The &= is working on other query clauses, just not the ones I said were
giving problems.
I'll get dal.py from trunk tomorrow AM and try it.
@Massimo, perhaps I wasn't clear. This query = date_field < "4/1/13 and
4/5/13" stuff isn't what I wrote, it's what dal.py emitted.
On Thursday, April 2
hi
is it possible to use recaptcha in custom forms?
i've already tested it but it return an error :
Traceback
1.
2.
3.
4.
5.
6.
7.
8.
Traceback (most recent call last):
File "/home/stifank/Desktop/web2py/gluon/restricted.py", line 212, in
restricted
exec ccode in environment
File
"/hom
it's work now, thank you so much for your hint leonel. for the recipe in
admin page it seems have limitation, because when i use it, no tweets
showed up, when i use the twitter widget it can show up.
--
---
You received this message because you are subscribed to the Google Groups
"web2py-use
I do not think the problem is &== but the data you are comparing (a date
with a string).
On Thursday, 25 April 2013 21:13:09 UTC-5, Cliff Kachinske wrote:
>
> The &= is working on other query clauses, just not the ones I said were
> giving problems.
>
> I'll get dal.py from trunk tomorrow AM and
Thanx buddy!!! its working. I will go through the code and go through
Massimo's book and understand why it does not work when using ajax. I still
dont understand the code, but it works now.
Thanx a lot!
On Thu, Apr 25, 2013 at 5:37 PM, Leonel Câmara wrote:
> It's not working because you're doin
Hi Richard,
On 25/04/13 15:35, Richard Vézina wrote:
I think your mistake is the following :
db(where clauses).select(tables and join)
I've not seen it summarised quite like that before - very helpful, thank
you.
I've got a bit of a mental block about this (as evidenced by the fact
that
I understand now, there are two pepople named Alex and one named Bob. Much
better example would be to put example like:
>>> for row in db(db.person.id==db.thing.owner_id).select(
db.person.name, count, groupby=db.person.name):
print row.person.name, row[count]
Alex 2
Bob 4
Here
58 matches
Mail list logo