I'm trying to use javascript to automatically insert a link to a plugin web
page within an application. However, the javascript, being a static file,
has no way of generating a valid URL in the proper web2py fashion using a
URL helper.
I thought perhaps I could use the base element to re-define
is why I am trying to use
the URL helper rather than just generate the string using
request.application on it's own.
On Wednesday, 27 February 2013 21:32:48 UTC, Niphlod wrote:
>
> ehm ... request.application !
>
> On Wednesday, February 27, 2013 10:26:51 PM UTC+1, RHC wrote:
>
, which is unfortunate. I was hoping to keep that
benefit, but I think I will have to manage without it.
On Thursday, 28 February 2013 16:42:53 UTC, Anthony wrote:
>
> No, just do:
>
> {{='/%s/' % request.application}}
>
> Anthony
>
> On Thursday, February 28,
Ah, that looks like it would do what I need. Thanks!
On Thursday, February 28, 2013 7:43:35 PM UTC, Anthony wrote:
>
> {{='/%s/' % request.application if URL().startswith('/' + request.
> application) else '/'}}
>
> Anthony
>
> On Thurs
I have a view which consists of several web2py compnents. I load these
components initially using the ajax=False option so they get loaded in with
the rest of the page, they then get reloaded via an ajax trapped submit
button within that component. The only problem is that the buttons start
off
cations/welcome/static/js/web2py_bootstrap.js#L27
>
> On Thursday, February 28, 2013 11:29:19 PM UTC+1, Anthony wrote:
>>
>> Please show some code.
>>
>> On Thursday, February 28, 2013 5:15:06 PM UTC-5, RHC wrote:
>>>
>>> I have a view which consists of
ing
around and submitting any changes. Incidentally how would I go about
submitting or requesting a change like this if I did give it a go?
On Friday, 1 March 2013 11:32:26 UTC, RHC wrote:
>
> Thanks. It certainly looks like that code makes the change I'm thinking
>
Thanks Anthony, that's very useful to know.
I'll have a look and try the simplest option :-). I'll have to update
web2py first so I'm not tinkering with old code to start with. I'll post my
code in one of those places if it works as expected.
On Saturday, March 2, 2013 12:59:45 AM UTC, Anthony
I have recently been exploring the possibilities of AngularJS and so far it
looks like a great framework for interactive forms and general data editing.
I would love to use it with web2py as I love the way web2py works and much
prefer python to javascript :-)
My main concern is that web2py's fo
Thanks for the responses, a number of useful pointers there.
I have had a look at the sqlhtml.py and html.py to see if I can adapt one
of these to effectively produce a json version of a form which can be
validated when it is submitted. I came to the conclusion that I didn't
understand enough o
Thinking about this some more, what I would like would be for a controller
to generate this json:
{ form:
{ fields:
[ {name: 'id', type: 'int', value: 234, error: '', comment: ''},
{name: 'title', type: 'string', length: 100, value: 'My Test
Record', error: '', comment: '
Thanks for that link to the web3py code, that looks much neater, but I
guess not all the functionality is there yet which might help. It looks
like the From initialisation and process methods skip the HTML generation
completely and the various style_x methods create the HTML version as
per
Thanks for that Alan. Yes I realise that the server creates the form for
the clientapi, my wording was not very good.
The as_json() and as_dict() methods looks useful, but still generates the
HTML component for the various inputs which I would then have to pull the
relevant information out of.
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
I am trying to create a component plugin. I would like to add in some
javascript and css files from the plugin with as little editing as possible.
I have a view.load file as part of the plugin and I tried to add something
like this to the top of this view file:
{{
response.files.append(URL('sta
Niphlod,
Thanks, I wasn't aware of these other ways to append these files. That's
certainly useful to know.
Richard.
On Tuesday, June 25, 2013 9:16:35 PM UTC+1, Niphlod wrote:
>
> response.files gets only called inside web2py_ajax.html, that is evaluated
> only when you load the layout.html
>
Thanks for your response Anthony and Niphlod.
For the record I went with dynamically loading css and javascript as
follows:
/* Load required css dynamically */
function loadcss(path) {
if (document.createStyleSheet) {/* check if need to use an IE
compatible method */
docum
Thanks for pointing out that the script won't get cached. I'd better sort
that out :-)
I didn't know about that modernizr feature, useful to know how it works and
what it's for, but that is for another time I think. I will probably skip
the modernizr stuff in this component, I use jquery all th
I have a strange problem with an application I have copied from an old
web2py 2.0.9 installation to another machine running web2py 2.9.5
When I try and register a new user using the standard user function, the
register button POSTS to the application root /CMS/#, instead of the
/CMS/default/use
-UKYhz6n9Cfl7FrNNETgfldTA>,
>
> and the form has action="#"?
>
> On Thursday, May 29, 2014 5:24:13 PM UTC-4, RHC wrote:
>>
>> I have a strange problem with an application I have copied from an old
>> web2py 2.0.9 installation to another machine runnin
Well your response prompted me to check the nginx logs which confirm it was
going straight to /CMS, no redirect. I then switched to a minimal
layout.html file as that was the one component that was still not a default
file. This then registered a user okay. When I went through the original
head
HI,
I am beginning to experiment with py4web, I like the sound of it and I am
looking to convert a web2py project to py4web to see how they compare.
It appears that the LOAD (helper?) that was available in web2py templates
is not available in py4web. I was using this to populate part of a web
HI,
Looking at the py4web documentation at
http://py4web.com/_documentation/static/index.html#chapter-08 I see the
following where I expected to find details of the URL helper.
URL
The URL helper is documented in [[Chapter 4 URL ../04#URL]]
I go to Chapter 4:
http://py4web.com/_documentation
re
> js or some lib (JQuery, axios, Vue.js ... )
>
>
>
> On Sunday, February 23, 2020 at 9:18:51 PM UTC+3, RHC wrote:
>>
>> HI,
>>
>> I am beginning to experiment with py4web, I like the sound of it and I am
>> looking to convert a web2py project to py4w
24 matches
Mail list logo