Kyle Flanagan | 23 Sep 18:12 2014
Picon

Customize SQLFORM.grid view page and add custom "Back" button

I have a controller that creates a grid off of a table -- very basic grid. I test to see if the user is "viewing" an item in the grid (if request.args and request.args[0] == 'view') and if so, I customize the view to present the information in the grid in a different layout.

Now, I'd like to add a back button similar to what you get on the standard view for a grid but without displaying the grid on the 'view' page.

I know how to create the button in the view, but I'm not sure how to create the URL since it's using the signature in the link.

{{=A(T('Back'), _href=URL(????), _class='btn')}}

--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
libertil | 23 Sep 15:03 2014
Picon

ordering in dropdown

Hi,
 I am trying to implement a data entry form for an entity called Model.
It should have a drop down menu showing entries from linked table pollutans.
So far no problem in implementing it. I want now to reorder the elements in
the dropdown menu using the field pollutant_order' in the pollutants_info table.
pollutants_info table has a 1:1 link to the pollutants table and is used to store
values that do not belong to the business data model.

I tried modifying the

db.models.pollutant_fk.requires = IS_IN_DB(db,'pollutants.pollutant_id','%(pollutant_label)s')

using a query
qry=db(db.pollutants.pollutant_id ==  db.pollutants_info.pollutant_id).select(orderby=db.pollutants_info.pollutant_order)

db.models.pollutant_fk.requires = IS_IN_DB(qry,'pollutants.pollutant_id','%(pollutants.pollutant_label)s')
but I get an exception


type 'exceptions.AttributeError'> 'Table' object has no attribute 'pollutants.pollutant_label'


I think there is concept in the DAL that baffles me!

Model

db.define_table('pollutant',

   Field('pollutant_id', type='string'),

   Field('pollutant_notation', type='string'),

   Field('pollutant_label', type='string'),

   Field('pollutant_definition', type='string'),

   primarykey=['pollutant_id'],

   format='%(pollutant_definition)s',

   migrate=False)


db.define_table('pollutants_info',

   Field('pollutant_id', type='string'),

   Field('pollutant_order', type='integer'),

   Field('required_a', type='boolean'),

   Field('required_b', type='boolean'),

   primarykey=['pollutant_id'],

   format='%(pollutant_order)s',

   migrate=False)


db.define_table('models',
    Field('model_id', type='integer'),
    Field('model_code', type='string'),
    Field('pollutant_fk','reference pollutants.pollutant_id', represent= lambda id, row: db.pollutants(id).pollutant_label if id else ''),
    format='%(model_code)s',
    primarykey = ['model_id'],
    migrate=False)

db.models.pollutant_fk.requires = IS_IN_DB(db,'pollutants.pollutant_id','%(pollutant_label)s')

--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
libertil | 23 Sep 10:59 2014
Picon

Default time for datetime picker widget

Hi,

I was wondering if there is an easy way to specify a default time (say 00:00)   in place of the current system time in the
datetime picker widget included in the web2py distribution

Regards

Luca

--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Richard | 23 Sep 09:02 2014
Picon

Table creation error 139 using MySql

I am hosting my app on python anywhere and get the following error:

<class '_mysql_exceptions.OperationalError'> (1005, "Can't create table 'richdijk$imanops03d.form_iv_9cf75329ccbc' (errno: 139)")


when creating a new table using:

    issue_var_fields= [
                    Field( "d"+str(db[issue_var_table][date_row.id]['iv_date']).replace("-", ""),
                          issue_var.data_type,
                          default=db[issue_var_table][date_row.id]['iv_value'],
                          label = str(db[issue_var_table][date_row.id]['iv_date'])
                         )
                     for date_row in db(db[issue_var_table]).select()
                     ]
    db.define_table('form_%s'%issue_var_table, *issue_var_fields)

What may be the cause of this?

--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Aldo Bassanini | 22 Sep 05:11 2014
Picon

Response Stream Control

Hello everyone.
Is there any way to control the final status of the response.stream function?

I need to serve a small file to a client application (the client app uses wget, not a browser), but I wish to know if the client successfully downloaded the file, in order to update some server-side data.

The way that I am thinking to achieve this, is programming the client application (a shell script) to GET a second URL (sending a session-id or something like that) from the server, after downloading the file, but this means, that I have to develop some file validation logic to verifiy the correct downloading (md5suming? or alikes) in the client, that I prefer to avoid, since the client has a very small environment (OpenWrt's Busybox Shell) and very small CPU and RAM.


Thank's in advance and any suggestions will be appreciated

--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
T.R.Rajkumar | 21 Sep 06:43 2014
Picon

web2py grid auto page

I have a SQLFORM.grid. It paginates the returned rows. Now I want to move through all the pages on a set timer interval without clicking the page numbers, i.e I want to auto page like an album without post back using jQuery. How to achieve that. Thank you.

--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Alex Kazakov | 21 Sep 16:19 2014
Picon

Interactive computer vision project

Hello all,

I would like to create an app where a scientific movie is uploaded and analyzed (in Matplotlib graphs manner).

I managed to upload and access the movie, but right now I have no idea how to implement the next part:
I would like to show a single frame from the movie, and ask the user to click on an object that he recognizes in the pic, so that I could store the [x,y] values for future analyzing.

So what I am looking for are web2py equivalents of "event.dblclick" or "pylab.ginput"...

Is an interactive model of that kind even possible to be implemented via web2py platform?

Thanks,

Alex.

--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
António Ramos | 21 Sep 23:35 2014
Picon

Signed url to non users of the app

Hello i have an app that creates some graph about some data


How can i share a link to a view of that graph and send it to a person that is not a user of my app and allow it to access the link for limited period of time?



Thank you

António

--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Sefa Denizoğlu | 20 Sep 21:26 2014
Picon

Translation and git usage

Hello there,
I'm translating the book into Turkish and I've cloned the book from GitHub. I then created a
..sources/43-web2py-turkish-translation-in-progress/
local directory following the convention. I just didn't want to mess with Massimo's code directly on the GitHub, so I decided I'd better do some translation/editing on new personal repo first. So, I initialized a local repo under 43-web2py-turkish-translation-in-progress/ and pushed those edits to my personal repo on Bitbucket.

That's what I did so far:

$ git clone https://github.com/mdipierro/web2py-book.git
$ cd web2py-book/sources
$ web2py-book/sources > mkdir 43-web2py-turkish-translation-in-progress
$ web2py-book/sources > cd 43-web2py-turkish-translation-in-progress
$ web2py-book/sources/43-web2py-turkish-translation-in-progress > edit 01.markmin
...
(go to bitbucket and make a repo for myself as a sandbox)
...
$ web2py-book/sources/43-web2py-turkish-translation-in-progress > git init
$ web2py-book/sources/43-web2py-turkish-translation-in-progress > git remote add origin https://denizoglu-HWgY0/vhk/IBXFe83j6qeQ@public.gmane.org/denizoglu/43-web2py-turkish
$ web2py-book/sources/43-web2py-turkish-translation-in-progress > git add *.markmin
$ web2py-book/sources/43-web2py-turkish-translation-in-progress > git commit -m "some editing"
$ web2py-book/sources/43-web2py-turkish-translation-in-progress > git push -u origin master
... more commits...

Now I want to push these changes I've done under 43-web2py-turkish-translation-in-progress directory to the web2py book's GitHub repo, BUT while keeping all these editing steps and logs.
So, how can I do that? It seems to me that if I commit from under web2py-book directory now to web2py-book on GitHub, it will be just one huge commit with all the previous editings shown in one big diff (which I do NOT want), am I mistaken?

And I guess if I add book on GitHub as another remote repo under my local 43-web2py-turkish-translation-in-progress directory, and if I commit to GitHub from under 43-web2py-turkish-translation-in-progress, it will create a 43-web2py-turkish-translation-in-progress directory directly under web2py-book directory in GitHub, right?

Most possibly it's really a one-line command to do, but I'm new to that git thing..


--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
olivier hubert | 19 Sep 23:03 2014
Picon

pending registration alert for a new user

how I can detect in a controllers, if a new user pending registration before to use my app?

--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Douglas Campbell | 18 Sep 19:01 2014
Picon

Running a long task with task scheduler multiple times in the same browser

Hello,

I have a process that takes a while to run, up to 30 minutes. If I kick off the process without a task scheduler, all works great and once the tasks returns it redirects to a page with the results. The problem is, I can only do this one at a time in the same browser. While the task is running in Chrome, if I tried to open up another tab with the website it will just spin until the original tasks returns.  I can open up the site and start a new tasks in IE/Firefox/Opera though. 

This is a problem as my users need to be able to kick this process off multiple times in the same browser. It is an internal software build application interfacing with Jenkins and they may need to build 6 different things and do not have 6 different browsers to open up or the time to do 6 sequentially. 

I tried using the Web2Py Task Scheduler to get around this but am running in to the same issue.  After the task is scheduled, I need something to wait for the task to return. If I just sleep and periodically check on the task, than the issue with using the same browser happens. 


Any ideas on how I can get around this? After a scheduled task returns would there be a good way to have the main web2py application redirect the session but not have web2py just spinning waiting for the task to return? 





--
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 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane