Ohh nice thinking, I forgot that I could do such thing :)
Anyways I asked this in other thread but do you know something about this?
How to use signature with web2py_component? (I changed web2py_ajax_page to
web2py_component since I saw that this calls the ajax_page)
So when a request is done
On Thursday, June 29, 2017 at 12:49:16 PM UTC-4, narcissus wrote:
>
> Thanks for your answer.
> Option 1) In my case I cannot change fields into the original database.
> Option 2) and 3) can you provide implementation examples for my specific
> case
>
I'm not familiar with how MySQL JSON fields
You don't need to do it that way. Just import json -- see
https://groups.google.com/d/msg/web2py/9WnoALNHxTI/54cTUgHNBgAJ.
Anthony
On Thursday, June 29, 2017 at 12:36:42 PM UTC-4, Filipe Reis wrote:
>
> Got it all working now. It was a problem with using response.json to parse
> the flash
Thank you, that looks helpful, I will start along these lines. I have some
questions, though:
1. Will this work if more than one fields are set to "group"?
2. What's up with count, does it ever make sense to have more than one
field set to "count", and if yes, what would be the difference
By any chance did you understand how to use signature with web2py_component?
So when a request is done to the page it only shows if was triggered the
that call only. This is what I think that @auth.requires_signature() doe
--
Resources:
- http://web2py.com
- http://web2py.com/book
By any chance did you understand how to use signature with web2py_component?
So when a request is done to the page it only shows if was triggered the
that call only. This is what I think that @auth.requires_signature() does.
--
Resources:
- http://web2py.com
- http://web2py.com/book
Thanks for your answer.
Option 1) In my case I cannot change fields into the original database.
Option 2) and 3) can you provide implementation examples for my specific
case
Option 4) I think I'll do it
Il giorno giovedì 29 giugno 2017 15:23:37 UTC+2, Anthony ha scritto:
>
> In most databases
Got it all working now. It was a problem with using response.json to parse
the flash message.
To future reference this is how it is:
var w2p_flash = {{=XML(response.flash) if response.flash else 'null'}};
if (w2p_flash) {
var w2p_flash = jQuery.parseJSON(JSON.stringify(w2p_flash));
Yeah that did it, however still getting the same issue: Resource
interpreted as Document but transferred with MIME type application/json.
This is for sure happening when using the session.flash with a dict.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
Try wrapping it in XML():
var w2p_flash = {{=XML(response.json(response.flash)) if response.flash else
'null'}};
Anthony
On Thursday, June 29, 2017 at 11:25:20 AM UTC-4, Filipe Reis wrote:
>
> Was looking better it seems that this is a problem with how response.flash
> passes the value.
>
>
You need to have at least a basic routes.py in the root /web2py folder, but
for application specific routing, you can also put a routes.py file in the
application folder (i.e., in /web2py/applications/myapp/). If you are using
the pattern-based rewrite system, you'll need to use routes_app in
Was looking better it seems that this is a problem with how response.flash
passes the value.
var w2p_flash = {message: New client inserted into
database., options: {theme: lime,
heading: Success}};
This is how the flash is passed to the view, is there any way to get it
right with " instead
Have you specified routes_onerror? If so, what does that code look like? It
looks like your error handler itself may be generating an error.
Anthony
On Thursday, June 29, 2017 at 9:42:42 AM UTC-4, Chris wrote:
>
> Hello!
>
> I'm running 2.14.6-stable+timestamp.2016.05.10.00.21.47 and have hit
You can instead put that code in the view of the controller. If you need it
across multiple actions, just create a separate view template for it and
use {{include ...}} to include it wherever needed.
Anthony
On Thursday, June 29, 2017 at 9:25:00 AM UTC-4, Filipe Reis wrote:
>
> Thanks for your
Hi all
I'm trying to modify an SQLFORM.grid so it has selectable check boxes,
which allow the user to download selected queries as CSV files once the
submit button has been clicked.
Can anyone help me with this?
Thanks in advance
Matt
--
Resources:
- http://web2py.com
-
Hello Alexia,
This is a pretty old thread :
https://groups.google.com/d/msg/web2py/Iu36WNoWkX4/bgIob2R6UjsJ
I suggest you to open another one... And tell us more on the issue you
experiment, we don't have enough informaiton (traceback, setup, web2py
version, os, etc) to help. Since 2011 web2py
Which web2py version? Which database/adapter??
But I think for unique=True you shouldn't have this error at least if you
had also implement a validator IS_NOT_IN_DB()... unique=True tell the
database to implement unique constrain, but you have to tell the front end
(IS_NOT_IN_DB()) too...
I use
Hello!
I'm running 2.14.6-stable+timestamp.2016.05.10.00.21.47 and have hit this
issue:
If I have a Field where unique=True, inserting a row with a duplicate Field
value triggers the constraint, as expected. However, the error does not
lead to a page linking to a ticket, but instead to a
Thanks for your time, this seems to be a solution to exactly what I want
however when I try to implement it I get this error:
Resource interpreted as Document but transferred with MIME type
application/json
Should this be a problem because I am including the web2py javascript also?
It needs to
In most databases (including MySQL), the DAL simply stores JSON in a text
field and converts to and from Python objects when writing/reading the
data. The Postgres adapter makes use of the Postgres native JSON field
type, but the MySQL adapter does not yet do so.
Some options might be to
Solved again...
Thank you
2017-06-29 14:03 GMT+01:00 Anthony :
> if not *record["created_by"]()* in ret:
>> ret.append(*record["created_by"]()*)
>>
>>
> That's different from the code you showed earlier. Probably you should
> just do something like this:
>
>
Hi,
I've created a database model containing a field of type json to access a
pre-existent MySQL database (created with mysql server version > 5.7.11)
containing the same field of type json into the same table.
I cannot understand why the json data stored into the database are read
always as
>
> if not *record["created_by"]()* in ret:
> ret.append(*record["created_by"]()*)
>
>
That's different from the code you showed earlier. Probably you should just
do something like this:
created_by = record['created_by']
created_by = created_by() if callable(created_by) else
Are you using this notification plugin for all flash messages on your site?
If so, why not just incorporate it into the layout and use response.flash
(and session.flash) as usual? In the layout, you could have something like:
$.notific8('{{=response.flash}}');
If you need to pass in options
Aparently not solved...
*function lazy_user at 0x2d82a28*
disappears but the field authors does not update anymore
if i go to admin to save a record i get this error
if not record["created_by"]() in ret:
TypeError: 'int' object is not callable
this is my new code
def get_userIds(rule):
Below is something similar I've been playing with. The interface is utter
garbage, but it shows the general idea. A form that allows you to select
fields and aggregation per field:
Manage a list of queries fields, adding in the field or its .sum() or
.count() method as necessary. Where
Hello, I was wondering if someone could help me in figuring this out.
I have a view that when the user click on a button opens a modal with a
insertion form.
I'm calling it by doing this way:
web2py_ajax_page("GET", url, "", target);
url - being the url like /house/create
target - being the
Solved.
Thank you again Anthony
2017-06-28 19:21 GMT+01:00 Anthony :
> In auth.signature, the "created_by" field has a "default" attribute, which
> is a function (called "lazy_user") that returns auth.user_id. At the point
> at which the value of the compute field is
28 matches
Mail list logo