Re: [web2py] page min height

2012-11-22 Thread jonas
ssary */ @media (max-width: 767px) { > #footer { margin-left: -20px; margin-right: -20px; > padding-left: 20px; padding-right: 20px;} } > > > > On Friday, November 23, 2012 12:04:31 AM UTC+1, jonas wrote: >> >>

Re: [web2py] page min height

2012-11-22 Thread jonas
ht: -20px; > padding-left: 20px; padding-right: 20px;} } > > > > On Friday, November 23, 2012 12:04:31 AM UTC+1, jonas wrote: >> >> Hi. I tried the link and more or less copied the code but the sticky >>

[web2py] forms redirect and verification doesn't work

2012-12-02 Thread jonas
Hi. when using the code below redirect and verification doesn't work: def comment(): """ create comment form """ post=db(db.blog.id==request.args(0)).select().first() db.comments.post_id.default=post.id form=crud.create(db.comments) if form.process().accepted: session.flash

[web2py] Re: forms redirect and verification doesn't work

2012-12-05 Thread jonas
ocessing > itself. If you want it to redirect, do: > > crud.settings.create_next = URL('index') > > > as indicated in the book. > > Anthony > > On Sunday, December 2, 2012 4:15:51 PM UTC-5, jonas wrote: >> >> Hi. >> >> when using the co

[web2py] images not displayed when using img and URL

2012-12-05 Thread jonas
hi this is probably a trivial problem but I post it anyway: I have an image model: db.define_table('blog', Field('date','datetime',default=request.now), Field('image','upload'), Field('imageTitle','text',default="image text"), Field('title','text'), Field('text','text')) # f

[web2py] controller that don't returns a view?

2012-12-06 Thread jonas
hi I have a controller that basically inserts a number in a database. I don't want it to render any view. For now I just redirect back to index.html, but is there any other way to do it, i.e to have a controller that not renders any views? controller: def plus_minus(): """ add or subtr

[web2py] callback question

2012-12-08 Thread jonas
Hi I still have some problems with callbacks. I have a like button that is in my index.html view that add 1 to a database, then displays it: I want to call the plus function as a callback to avoid render another view, i.e I want to render the result in the index view, but I don't know how t

Re: [web2py] Re: callback question

2012-12-08 Thread jonas
urday, December 8, 2012 5:00:41 PM UTC+1, jonas wrote: >> >> Thanks, that solved the callback problem. now I just have to figure >> how to update part of the index.html view. >> >> On Sat, Dec 8, 2012 at 4:25 PM, Niphlod wrote: >> > use the power, Luke!

Re: [web2py] Re: callback question

2012-12-08 Thread jonas
7;default', 'comment.load', args=result.id, ajax=True)}} > > On Saturday, 8 December 2012 16:26:02 UTC-6, jonas wrote: >> >> LOAD looks interesting. trying to LOAD comment form but gets error >> (non-keyword >> arg after keyword arg) when using the followi

[web2py] recursive error when including sidebar view

2012-12-10 Thread jonas
aceback (most recent call last): File "/Users/jonas/Dropbox/web2py/gluon/main.py", line 538, in wsgibase serve_controller(request, response, session) File "/Users/jonas/Dropbox/web2py/gluon/main.py", line 225, in serve_controller run_view_in(response._view_envi

[web2py] Re: recursive error when including sidebar view

2012-12-10 Thread jonas
same recursive error. is there something wrong with the path? On Monday, December 10, 2012 12:21:45 PM UTC+1, jonas wrote: > > HI > > I have two views that I want to have in the same layout file. One is for > the sidebar and the other one is for the main column. > &g

[web2py] Re: recursive error when including sidebar view

2012-12-10 Thread jonas
ok, that solved the problem. Thanks On Monday, December 10, 2012 4:46:12 PM UTC+1, Anthony wrote: > > > > and in layout.html: >> >> >> {{if left_sidebar_enabled:}} >> >> >> >> >> >> {{include 'sidebar.html'}} >> > > In layout.html you include sidebar.html, but then

[web2py] calling LOAD from a button

2012-12-11 Thread jonas
Hi I have a link that redirects to a comment page: {{=A(TAG.i(_class="icon-pencil"), _rel="tooltip", _title="give a comment", _class="btn", _href=URL('comment',args=result.id))} But I want to use LOAD instead of filling a form in a separate page: {{=LOAD('default','comment.load',args=result.i

[web2py] custom form validation

2012-12-14 Thread jonas
Hi I have a custom comment form: def comment(): """ create comment form. Every comment is id locked to the specific post """ #crud.settings.create_next = URL('index') post=db(db.blog.id==request.args(0)).select().first() db.comments.post_id.default=post.id form=crud.create(

[web2py] custom form validation doesn't work

2012-12-15 Thread jonas
Hi. I have a default form that is passed in view: {{=form}} using this validation and insertion works. but when I use a custom form none of that works. why? Also form.process().accepted works only when using default form. My second question is: when submitting the form I redirect to index, and

[web2py] controller not returning variables

2012-12-22 Thread jonas
this is probably simple but I post it anyway I have a layout that includes sidebar.html: {{block left_sidebar}} {{include 'default/sidebar.html'}} {{end}} and sidebar.html: {{left_sidebar_enable=True}} me (from sidebar.html): {{for pre in about:}} {{for

Re: [web2py] Re: controller not returning variables

2012-12-22 Thread Jonas
- but the other views do not call their own controller functions. > > Anthony > > On Saturday, December 22, 2012 3:11:38 PM UTC-5, jonas wrote: >> >> this is probably simple but I post it anyway >> >> I have a layout that includes sidebar.html: >>

Re: [web2py] Re: controller not returning variables

2012-12-22 Thread jonas
ok. thanks, that clarified the a few things. On Saturday, December 22, 2012 10:48:35 PM UTC, Anthony wrote: > > On Saturday, December 22, 2012 5:00:52 PM UTC-5, jonas wrote: > >> Ok, I have a {{include}} statement in the beginning of the layout.html >> file that ca

Re: [web2py] Re: controller not returning variables

2012-12-23 Thread jonas
act: {{=pre.contact}} {{pass}} but it would have been better to return the ab dict from the sidebar.py controller instead. On Saturday, December 22, 2012 11:24:11 PM UTC, jonas wrote: > > ok. thanks, that clarified the a few things. > > On Saturday, December 22, 2012 10:48:35 PM UTC

[web2py] generating svg from controllers

2012-12-26 Thread jonas
Hi. Is there any way to generate xml svg via controllers? svg can be made by using declarative syntax, i.e xml instead of javascript. is it possible to return an string containing svg xml and render it in index.html? for example, a very simple function, index.py: def index(): a="" r

[web2py] Re: generating svg from controllers

2012-12-26 Thread jonas
> def index(): > return dict(a="") > > Then in the view, to prevent the XML string from being escaped, you have > to wrap it in the XML() helper: > > {{=XML(a)}} > > You might also take a look at the generic.xml view for help serializing > data into XML. >

[web2py] jQuery function not working in index.html

2013-01-05 Thread jonas
Hi when using the following functions in index.html only the last one works: {{extend 'layout.html'}} index.html Hello 2World 2 jQuery('.one').click(function(){ jQuery('.two').slideToggle() }); Hello 3 World 3 but when using the first function in layout.html it suddenly works. why is no

[web2py] Re: jQuery function not working in index.html

2013-01-05 Thread jonas
solved the problem, missing closing statement, although I think that was included in the real code On Saturday, January 5, 2013 3:23:00 PM UTC+1, jonas wrote: > > Hi > > when using the following functions in index.html only the last one works: > > {{extend 'layout

[web2py] anyone tried jQuery svg?

2013-01-06 Thread jonas
Hi. Has anyone here tried the jQuery svg lib http://keith-wood.name/svg.html? I tried to use it in web2py but with no success. the necessary lib was imported: but is seems that the svg function is not present : svg should be here $('.test').svg(); var svg=$('.test').svg('get'); svg.cir

[web2py] links in texts stoded in a database

2013-12-24 Thread jonas
Hi How do you put links to other sites in a text that is stored in a database? for example, I have a blogg where all coments, posts etc are stored in a database. Everytime I add a post I do it from the admin interface by adding new entries in the database. But adding a link in the text is not w

[web2py] calling custom javascript functions

2014-01-11 Thread jonas
hi I have developed javascript functions in /static/js/custom/charts.js they are loaded in layout.html: I call them in index.html by: myfunction(); I know that ajax and jQuery can be used to call python functions in default.py and my question is, is it possible to use ajax or jQuery to

[web2py] controller not returning java script variable correctly

2014-01-15 Thread jonas
Hi I have a controller that is supposed to return a list to a js function (for testing purposes): def test(): print "called2" data=[3, 6, 2, 7, 5, 2, 0, 3, 8, 9, 2, 5, 9, 3, 6, 3, 6, 2, 7, 5, 2, 1, 3, 8, 9, 2, 5, 9, 2, 7] return 'var data=%s;' % data I am calling this with an

[web2py] Re: Top 3 web2py features

2010-05-25 Thread Jonas Rundberg
Mengu, I agree to all the mentioned pros for web2py. Would you like to elaborate on your first item -scalable? Which features in web2y fo you refer to that facilitates scalability? cheers / jonas On May 7, 12:13 am, Mengu wrote: > 1) scalable > 2) fast > 3) easy

[web2py] Re: generic.load

2010-07-16 Thread Jonas Rundberg
point at? Could the 'Ajax Recipes' be updated in the book? (I can help if that's needed, as soon as I understand the concept enough) cheers / jonas On Jul 13, 7:06 pm, mdipierro wrote: > BTW since 1.80.1 welcome include a generic.load > what is it? > > Say you have

[web2py] w3p_fc bug?

2010-07-16 Thread Jonas Rundberg
Hi In sqlhtml.py, SQLFORM: the comment field's class is w3p_fc. Should't this be w2p_fc to be consistent with w2p_fl and w2p_fw? cheers / jonas

[web2py] one solution to web2py+eclipse and "undefined variable" warnings

2010-04-22 Thread Jonas Rundberg
find "Consider the following names global: (comma separated)" There you can add service,auth,T,response,session,request,db or whatever. Doing this seems easier then writing "global request", ... at the top of all of your controller files. cheers / jonas rundberg -- Subs

[web2py] Re: CRON doesn't work

2010-11-10 Thread Jonas Rundberg
Hi Sverre, I have the exact same issue. (Running web2py 1.87.3) Did you manage to get to work? / jonas On Nov 4, 11:10 am, Sverre wrote: > My cron tab looking like this > > #crontab > */2 * * * *     root  *sys/test_cron > @hourly          root  *applications/mm/cron/exp

[web2py] difference between crud.select(db.hem,query) and db(query).select()?

2012-06-26 Thread Jonas Fredriksson
hi When doing results=crud.select(db.hem,query) I got a list containing the result with html tags in the beginning and the end. But I am not able to access different fields like result.info and so on. When I am using results=db(query).select() I can do results.info. Is there any way to get in

Re: [web2py] page min height

2012-11-22 Thread Jonas Fredriksson
Hi. I tried the link and more or less copied the code but the sticky footer don't work. especially the push seems not to work. here is my code: page header span4 span8 span10 span2 sticky footer? On Thursday, November

Re: [web2py] Re: forms redirect and verification doesn't work

2012-12-05 Thread Jonas Fredriksson
now it works, had to put everything in the right order: crud.settings.create_next = URL('index') post=db(db.blog.id==request.args(0)).select().first() db.comments.post_id.default=post.id form=crud.create(db.comments) Thanks again On Wed, Dec 5, 2012 at 12:55 PM, jo

Re: [web2py] Re: images not displayed when using img and URL

2012-12-05 Thread Jonas Fredriksson
ault', 'download', > args=row.something) as a "downloader" of an 'upload' record. > > > On Wednesday, December 5, 2012 6:41:58 PM UTC+1, jonas wrote: >> >> hi >> >> this is probably a trivial problem but I post it anyway: >&g

Re: [web2py] Re: controller that don't returns a view?

2012-12-07 Thread Jonas Fredriksson
Thanks. Actually the call comes from a button: It has to provide the right result.id so the like addition relates to the right post. I will try using callbacks from the button call to see if it works. On Thu, Dec 6, 2012 at 11:17 PM, Niphlod wrote: > Learned something also today! Nice one Anth

Re: [web2py] Re: callback question

2012-12-08 Thread Jonas Fredriksson
tle="you like this", > _class="btn", _href=URL("plus",args=result.id)) > and you can turn it into a callback using > A(TAG.i(_class="icon-thumbs-up"), _rel="tooltip", _title="you like this", > _class="btn", callback=

Re: [web2py] Re: calling LOAD from a button

2012-12-14 Thread Jonas Fredriksson
thanks I use the following solution; {{for result in res:}} {{=result.id}} {{=result.title}} {{=A(TAG.i(_class="icon-plus-sign"), _rel="tooltip", _title="testing", _class="btn", _href='#', _onclick="jQuery('#uc').toggle();")}} {{=LOAD('default','comment.load',args=result.id,ajax=True)}} with

Re: [web2py] Re: custom form validation

2012-12-15 Thread Jonas Fredriksson
ok. another thing is that if I use a regular form, {{=form}}, then validation works but not if I use the custom form. Also form.process() works, so the problem seems to be related to custom forms. On Sat, Dec 15, 2012 at 4:06 AM, Anthony wrote: >> form=crud.create(db.comments) >> if form.

Re: [web2py] Re: custom form validation doesn't work

2012-12-16 Thread Jonas Fredriksson
base but I want to avoid that in this case, so another form of redirect would be better. On Sun, Dec 16, 2012 at 3:35 PM, Massimo Di Pierro wrote: > Hello Jonas, > > Can you show us your custom form, the one that does not work. Validation and > form processing are done before the vie

Re: [web2py] Re: custom form validation doesn't work

2012-12-16 Thread Jonas Fredriksson
I send the app to your gmail address. On Sun, Dec 16, 2012 at 4:35 PM, Massimo Di Pierro wrote: > This should work. I do not see why it does not work. Can you email me, > perhaps privately, an example app so I can reproduce it? > > > On Sunday, 16 December 2012 09:26:54 UTC

Re: [web2py] Re: controller not returning variables

2012-12-24 Thread Jonas Fredriksson
ok, to include everything in the for loop is more elegant. The reason why I wanted to separate the call to sidebar.py is that the sidebar contains almost static material that doesn't change that much, while the main page (index page) has content that changes more. In the first version I had the db

Re: [web2py] Re: anyone tried jQuery svg?

2013-01-08 Thread Jonas Fredriksson
svgBasics.html >> >> See the drawInitial function. >> You need to load it, put it into a document.ready function or something. >> >> >> On Sunday, January 6, 2013 2:14:13 PM UTC, jonas wrote: >>> >>> Hi. >>> >>> Has anyone here

[web2py] sidebar bug in 1.99.1?

2011-10-05 Thread Jonas Rundberg
Hi Using left or right sidebars in layout.html doesn't render the page as intended. (Using both sidebars seems ok). layout.html sets the width of #content to 740px, but it should be 720px to handle the padding in #page. I've tried it on OSX, Chrome+FF5 cheers / jonas

[web2py] changes in 1.96.1 & 1.96.4

2011-06-23 Thread Jonas Rundberg
cal_import local_import has the reload=True feature. How does this work now? 1.96.4 - better support for "id" fields not called "id" Are we now able to define any existing integer fields as id? How would I use this? br / jonas

Re: [web2py] Re: links in texts stoded in a database

2013-12-27 Thread Jonas Fredriksson
I tried ckeditor and I've got an editor in admin so I can insert links, so far so good. but the text is still rendered plain with html tags visible. my function and db in db.py: (text field is the field I want to insert links into) def advanced_editor(field,text): return TEXTAREA(_id = str(te

Re: [web2py] Re: links in texts stoded in a database

2013-12-29 Thread Jonas Fredriksson
just to clarify, my problem is that html tags in my input text area is just rendered as tags, naturally because the field is classified as text and nothing else. I need to render the html elements when displaying text. On Fri, Dec 27, 2013 at 10:01 PM, Jonas Fredriksson wrote: > I tr

Re: [web2py] Re: links in texts stoded in a database

2013-12-30 Thread Jonas Fredriksson
the XML function solved the problem: {{for i, row in enumerate(rows):}} {{=DIV(XML(T(row.table_field), sanitize = True) ) }} {{pass}} thanks. On Mon, Dec 30, 2013 at 3:29 AM, 黄祥 wrote: > another way around is define it on the represent for your table text field. > e.g. > table.table_field.re

Re: [web2py] calling custom javascript functions

2014-01-12 Thread Jonas Fredriksson
I just wanted to see if it's possible to call custom made js functions using jQuery. I found that it is possible to call by using this function: $(document).ready(function() { $(function_call()); } css tags can also be added. but it is simpler to just use myfunction(); In the web2py book al

Re: [web2py] calling custom javascript functions

2014-01-12 Thread Jonas Fredriksson
yes, and it works. thanks On Sun, Jan 12, 2014 at 3:08 PM, Anthony wrote: > Did you try: > > $(document).ready(function() { > myfunction(); > }); > > Anthony > > On Sunday, January 12, 2014 3:48:48 AM UTC-5, jonas wrote: > >> I just wanted to see if

Re: [web2py] Re: controller not returning java script variable correctly

2014-01-15 Thread Jonas Fredriksson
ument.write() line will be executed > before the ajax call has completed. Try putting the document.write() in the > returned Javascript itself. > > > On Wednesday, January 15, 2014 11:09:04 AM UTC-5, jonas wrote: >> >> Hi >> >> I have a controller

Re: [web2py] Re: controller not returning java script variable correctly

2014-01-15 Thread Jonas Fredriksson
nice solution and it works. thanks On Wed, Jan 15, 2014 at 7:34 PM, Anthony wrote: > graph1 is the actual function, the write function was just for testing. >> This works but it means that I have to make a python function for every js >> function call when passing values from python functions.