On Thu, Jun 7, 2012 at 2:12 PM, Anthony abasta...@gmail.com wrote:
I'm not sure if this is in stable, but in trunk you can specify dictionaries
of args to pass to SQLFORM, including separate dictionaries for create,
edit, and view
forms:
Hello,
I've got simple question, to which I cna't find simple answer.
I formatted View of my entries, showing fields I want to show, hidin
those I don't want to show.
When I get page with view of the row of my datable, it starts with
form: - how do I remove this?
thanks in advance,
Marian
hi, how to display in sqlform.grid - viewhtml formated text?
i mean: *someText lazy** fox* instead ofbsomeText lazy
ifox/i/b
Two questions re SQLFORM.grid sorting.
1. Is it possible to specify the initial sort order?
2. I'm displaying a table that includes a foreign field. When I click on
the header to sort by that field, it sorts by the field id rather than by
the (displayed) foreign field. Can I sort by the
You can specify the sort order using the orderby parameter. But, I
don't know how you get it to sort by the displayed value of a foreign
key column.
Ex:
orderby = [~db.asset.acquiredOn, db.asset.assetTag, db.asset.description]
~ orders descending.
-Jim
On 5/21/2012 2:23 PM, Keith
foreign key. You can do a join.
On Monday, 21 May 2012 14:49:06 UTC-5, Jim S wrote:
You can specify the sort order using the orderby parameter. But, I
don't know how you get it to sort by the displayed value of a foreign
key column.
Ex:
orderby = [~db.asset.acquiredOn,
Thanks Jim, I somehow missed the 'orderby' parameter to SQLFORM.grid
On Mon, 21 May 2012 13:11:31 -0700 (PDT), massimo.dipie...@gmail.com said:
foreign key. You can do a join.
Thanks Massimo; however, that's a little cryptic. Could you explain how a
join can be used to determine the sort order
Massimo - Is there a way to do it with a .smartgrid. I know the
question wasn't on .smartgrid, but I'm using that extensively and too
would like some sort of solution.
-Jim
On 5/21/2012 3:11 PM, Massimo Di Pierro wrote:
foreign key. You can do a join.
On Monday, 21 May 2012 14:49:06
something like this?
SQLFORM.grid(db.table1.field1==db.table2.id,fields=db.table1.ALL,orderby=db.table2.field2)
smartgrid cannot do this.
On Monday, 21 May 2012 15:24:23 UTC-5, backseat wrote:
Thanks Jim, I somehow missed the 'orderby' parameter to SQLFORM.grid
On Mon, 21 May 2012 13:11:31
It'd be convenient, I think, to have an SQLFORM.grid import button that
imported what the export button exports (csv). Granted that the admin interface
can be used for this, but for a couple of my tables it'd be handy to be able to
enable an import button if, say, the table is empty.
I see a couple ways to handle it.
1. Using a custom view, wrap the button html with an if statement
testing to see if request.args(1) == 'edit'. If so, then you are in the
edit form for the grid.
2. Specify a custom view based on request.args(1) == 'edit' and then
code the entire thing using
I have a SQLFORM.grid, and I want to add a button to the form used to edit
records (as called from the grid). Is that possible?
--
You can have everything in life you want if you help enough other people
get what they want - Zig Ziglar.
Who did you help today?
Hello there follow web2py users,
First of all, Massimo, thanks for the great work you have done to get
web2py to this high level of functionality.
I recently started using it for a project and was faced with a challenge:
in SQLFORM.grid, when a table has many fields, the users have to scroll
Based on this:
links = [lambda row: INPUT(_name='qty', _value='1'), lambda row: A('+',
callback=URL('cart_callback',vars=dict(id=row.id,action='add',qt=request.
vars.qty)))]
Is there a way to grab the value of the INPUT to pass them to another
function???
qt=request.vars.qty does not cut it.
I have a SQLFORM.grid that says 67 records found, and shows the first 20
(as I would expect). At the bottom, there are four buttons for the pages
(1-4). If I click on any of 2, 3 or 4, I get No records found.
Looking deeper, the URL of the first page is
Is there any reason not to have a col3 argument to SQLFORM.grid, and pass it to
the create/edit SQLFORMs? Likewise comments. Or maybe just an sqlform argument
dict to be passed as additional kwargs?
I guessed it was something like that :-)
Thanks Massimo I am going to test it.
On 03/30/2012 10:51 AM, Massimo Di Pierro wrote:
You have to pass it
SQLFORM.grid(...,field_id=db.lvdisksetup.id,)
else it does not know what table to use.
On Thursday, 29 March 2012 19:58:52 UTC-5, Gwayne
After testing
form = SQLFORM.grid(query,
fields=fields,
field_id=db.lvdisksetup.id,
---
orderby=['lvdisksetup.lunid'],
csv=False,
create = True,
maxtextlength=45
)
It worked like a
When you say I want to manipulate db.lvdisksetup but in stead it
manipulates db.lvdisk what do you mean by manipulates?
On Wednesday, 28 March 2012 22:58:31 UTC-5, Gwayne aka Mike Veltman wrote:
Gentle people,
I have the following grid:
query = ( (db.lvdisksetup.lvgroupname_id ==
On 03/30/2012 12:01 AM, Massimo Di Pierro wrote:
When you say I want to manipulate db.lvdisksetup but in stead it
manipulates db.lvdisk what do you mean by manipulates?
That when I delete a record or do add a record it gives me the db.lvdisk
table and not the db.lvdisksetup table.
So I
You have to pass it
SQLFORM.grid(...,field_id=db.lvdisksetup.id,)
else it does not know what table to use.
On Thursday, 29 March 2012 19:58:52 UTC-5, Gwayne aka Mike Veltman wrote:
On 03/30/2012 12:01 AM, Massimo Di Pierro wrote:
When you say I want to manipulate db.lvdisksetup but
Gentle people,
I have the following grid:
query = ( (db.lvdisksetup.lvgroupname_id == usedlvdisksetup)
(db.lvgroupname.id == usedlvdisksetup) (db.lvdisksetup.lvdisk_id ==
db.lvdisk.id) )
fields = [db.lvdisksetup.id, db.lvgroupname.lvgroupnamedesc ,
db.lvdisk.lvdiskdesc,
Gentle people,
I have the following grid:
query = ( (db.lvdisksetup.lvgroupname_id == usedlvdisksetup)
(db.lvgroupname.id == usedlvdisksetup) (db.lvdisksetup.lvdisk_id ==
db.lvdisk.id) )
fields = [db.lvdisksetup.id, db.lvgroupname.lvgroupnamedesc ,
db.lvdisk.lvdiskdesc,
Hello,
Is it possible to select and delete multiple rows with one button click
using SQLFORM.grid ? (instead of clicking delete on each row)
I tried the selectable property but this doesn't help to delete.
I searched the archive of this group / mailing-list without success
Thanks for your help
Is it possible to show the referenced name field, instead of the id
when showing a grid of a many2many table?
my model:
tsmadm.define_table('report_contact',
Field ('report_id', db.reports,
requires=IS_IN_DB(db, db.reports.id,'%(name)s') ),
Field ('contact_id',
Hello,
I just discovered SQLForm.grid ! Waow, geat job !!
I'd like to customize some columns in the generated table.
Example use case :
- Use the pretty date formatting instead of displaying the raw date
(yesterday, etc ...)
- Use an icon instead of a status flag.
Is it possible ? How to
Hi all
I can't perform search operations on SQLFORM.grid forms. If I remove the
@auth.requires_signature() part, it does work.
In the webserver-logfile I noticed that the edit page is signed, while the
search page isn't.
EDIT:
When using the following grid:
query = ((db.akb_authors.id.belongs(ids))
(db.akb_authors_article_link.author == db.akb_authors.uuid)
(db.akb_authors_article_link.article == db.akb_articles.uuid)
(db.akb_journal.uuid == db.akb_articles.journal))
left
As I have commented before, sqlform.grid has a particular way of
searching. Its combination of search and 'queries' is very powerful.
However the search does not really work in the way a casual web user
might expect. If entered - Bob Dylan - in the search box and clicked
search, then one get
anybody .. please .. pretty please :)..
On Feb 21, 10:20 am, whowhywhat mads...@gmail.com wrote:
I need a web2py SQLFORM.grid to accept and process based on some
conditions, which need to be triggered based on some check boxes. I
have inserted these checkboxes into the form by doing something
wrote:
anybody .. please .. pretty please :)..
On Feb 21, 10:20 am, whowhywhat mads...@gmail.com wrote:
I need a web2py SQLFORM.grid to accept and process based on some
conditions, which need to be triggered based on some check boxes. I
have inserted these checkboxes into the form
the dict
if form[0].process(onvalidation=add_my_field)
On Feb 21, 10:09 am, whowhywhat mads...@gmail.com wrote:
anybody .. please .. pretty please :)..
On Feb 21, 10:20 am, whowhywhat mads...@gmail.com wrote:
I need a web2py SQLFORM.grid to accept and process based on some
I need a web2py SQLFORM.grid to accept and process based on some
conditions, which need to be triggered based on some check boxes. I
have inserted these checkboxes into the form by doing something like :
In the controller -
def my_grid():
form = SQLFORM.grid()
if len(request.args)1
SQLFORM.grid's search box seems to only work with single word search
terms. Has anyone looked into it working with multiple words, working
as if they are 'and'ed together?
Suppose you have a table:
db.define_table('book', Field('author', 'string'), Field('title',
'string'), Filed('description', 'text'))
you can search like this:
author is cormac mccarthy and title contains horses
mic
2012/2/4 peter peterchutchin...@gmail.com:
SQLFORM.grid's search box seems
I've a couple of questions about SQLFORM.grid:
- Is it possible to position the buttons/links created by the 'links'
argument somewhere other than the end of the row? It feels as if the
'fields' argument should be able to do this, but I can't see how.
- Is it possible for the 'search' box to
Hello,
I have defined two tables related between each other, I have defined
a SQLFORM.grid with this two tables and works ok, but when I try to
add a new button with the id parameter it fails, but when I use other
field like name works correctly.
db.define_table('course',
Hello,
I have a question about SQLFORM.grid order of the fields in the table
represented?
Is there any way to modify the order of these fields in a
SQLFORM.grid?
Thanks
Miguel
On 16 January 2012 23:03, Miguel miguel.mori...@gmail.com wrote:
Hello,
I have a question about SQLFORM.grid order of the fields in the table
represented?
Is there any way to modify the order of these fields in a
SQLFORM.grid?
The initial order can be determined in orderby = fieldname.
Can I first say that SQLFORM.grid is great and a massive productivity
gain, thanks Massimo the rest of the web2py team.
My question is around formatting a column when the display value
depends on other non-visible columns (or other related tables). We're
using the links parameter and a lambda
Hello!
When I pass the 'ignore_rw=True' to SQLFORM.grid(), not all the fields are
displayed in the grid. The fields that are set to 'readable=False' are not
displayed in the grid.
Is this the correct behavior? If so, how can I modify it?
Thanks!
When doing this the assignee, summary and dependencies columns are
trunc [shortened]. How can I prevent this to happen?
This is the code:
db.buglist.insert(bug_id=bugid,dependencies=deps,sev=severity,
prio=priority, assignee=assigned_to, status=bug_status,
summary=short_desc)
I have a problem using SQLFORM.grid and a query from a FORM:
Here is my controller
def synthese():
ListeFamille=db(db.ATPOSTE.id0).select(orderby=db.ATPOSTE.PS_FAMI)
selection=FORM(TABLE(TR(
TD('Début',INPUT(_name='Deb',id=1,_class=date, requires
=
Hello,
I would like to have images instead of text (or text AND image) in
each label for row, when I click edit in form generated by
SQLFORM.grid. How to do this in easiest way ?
Regards
brushek
How can I get rid of the id-column when editing one row of a grid?
Regards, Martin
I am using SQLFORM.grid. I have a boolean field todo.
If I select this in query, and select True as the value, nothing happens.
If I click 'query' it simply resets the query. If I click 'search', it too
clears the query, and finds all the records. How can I get it to find only
the records with
try this :
,links = [lambda row:
A(
SPAN(_class='icon magnifier')
,'View Post'
,_class='button',_title='View Post'
,_href=URL(args=[view, db.person, row.id])
)
]
On Monday, November 21, 2011, Rahul wrote:
Hi Johann,
That is correct but I just wanted to
hi,
is it possible for sqlform.grid and sqlform.smartgrid use the archive
table for record versioning?
i tried to use the sqlform.grid and sqlform.smartgrid with record
versioning but returned an error :
AttributeError: 'DIV' object has no attribute 'process'
my controller is :
def index():
Hi All,
Can anyone let me know how to use SQLForm.grid properly or tell
me what I am missing. I have not installed any jquery plugin for the
same (assuming that it is part of 1.99.2 by default). I cannot see the
complete grid, just some buttons and data as per my query below. Also
the links
here are a few thoughts...
1. Make sure you create this test in a new app. If you're updating or
adding functionality to an already existing app, then your layout and
base.css need to be updated.
2. If using jquery-ui, then you need to download jquery-ui and include
it in your layout.html
I stand corrected on the 'columns' comment. Massimo added it back in
this morning.
-Jim
On 11/14/2011 8:45 AM, Jim Steil wrote:
here are a few thoughts...
1. Make sure you create this test in a new app. If you're updating
or adding functionality to an already existing app, then your
Ok, columns are gone again...
Might just be best to stick with using fields.
-Jim
On 11/14/2011 8:47 AM, Jim Steil wrote:
I stand corrected on the 'columns' comment. Massimo added it back in
this morning.
-Jim
On 11/14/2011 8:45 AM, Jim Steil wrote:
here are a few thoughts...
1.
I want to show the reference field value ('Name' in Model table) on
the grid instead of the original value (Model_ID in Product table).
Is there easy way to do it ?
Controller
---
def admin():
db.Product.id.readable = False
products =
Here's what I would do.
(not tested)
db.define_table('Model',
Field('Name'),
Field('Unit'),
format='%(name)s')
-Jim
On 11/14/2011 4:55 PM, Omi Chiba wrote:
I want to show the reference field value ('Name' in Model table) on
the grid instead of the original value (Model_ID in
Hi
I just updated my web2py from trunk today and noticed that the columns
arg in SQLFORM.grid is gone. I was using it to specify which fields to
display in my grid. Can the 'fields' arg be used the same as columns?
-Jim
Here is the change I made in my code to accommodate:
Old code:
columns=['assetType.name']
New code:
fields=[db.assetType.name]
Other than that, seems like they work the same. Can anyone provide a
deeper explanation of the differences?
-Jim
On 11/10/2011 9:17 AM, Jim Steil wrote:
Hello,
I would like to know I can control generated form with SQLFORM.grid...
I use to do extensively :
If user and group and permission and row field value:
crud.table.field.readable =\
crud.table.field.writable =False
form = crud.create, read or update(db.table)
And I customize my
Here is a sample of one of my controllers.
@auth.requires_permission('select', db.priceTemplate)
def priceTemplates():
response.view='list.html'
table = db.priceTemplate
response.title = '%s - %s' % (response.section, table['_plural'])
columns = ['priceTemplate.name',
Thank a lot Jim I will play a bit with your example... Pretty helpful...
I would like to know more about the difference between grid and
smartgrid... I just start to read the sqlhtml.py to understand better new
grid and smartgrid...
Thanks again.
Richard
On Wed, Nov 9, 2011 at 4:07 PM, Jim
From what I can gather, smartgrid is the same as grid except that it
will also display/work with related tables. Grid works with one table
only (please correct me if I'm wrong).
-Jim
On 11/9/2011 3:14 PM, Richard Vézina wrote:
Thank a lot Jim I will play a bit with your example...
Hello,
I have something like:
selection=FORM(TABLE(TR(
TD('Début',INPUT(_name='Deb'),_class=date, requires =
IS_DATE(error_message=T('Doit être de la forme -MM-JJ !'))),
TD('Fin',INPUT(_name='Fin',_class=date, requires =
IS_DATE(error_message=T('Doit
Hello,
I have something like:
selection=FORM(TABLE(TR(
TD('Début',INPUT(_name='Deb'),
_class=date, requires = IS_DATE(error_message=T('Doit être de la forme
-MM-JJ !'))),
TD('Fin',INPUT(_name='Fin',_class=date, requires =
IS_DATE(error_message=T('Doit
If you wish to use the icons from the CSS templates just add:
SPAN(_class='check icon')
like this custom button:
links = [lambda row: A(SPAN(_class='check icon')
,'Byte Me'
,_class='button'
,_title='Byte Me'
,_href=URL(args=[view, db.person, row.id])
)]
Read the
On Saturday, October
Hello list.
My question is this, I have a join in my query to the database, you
need to show the columns belonging to tables and routes accountcode,
here is my code:
left =
Nick
I'm use the attribute _class to make a button
A('Detalle',_class='button',_href='index/detalle/%s' % row.id)
This class render a button, same a the buttons on grid.
On Fri, Oct 28, 2011 at 11:08 PM, Nik Go nikolai...@gmail.com wrote:
It mentions: If you use jqueryui then the links
I have to tables
db.define_table( 'wdirs',
Field( 'name', type = 'string',
requires = IS_NOT_EMPTY()),
*(a)* *format='%(name)s %(id)s'*
)
db.define_table( 'files',
Field( 'wdirs_id', db.wdirs,
requires = IS_IN_DB( db, db.wdirs.id, %(name)s
It mentions: If you use jqueryui then the links are rendered as buttons.
am still trying to find an answer about how to use icons for your custom
buttons.
On Friday, October 28, 2011, Cliff wrote:
I'll try to keep an eye on it.
On Oct 27, 1:47 pm, Massimo Di Pierro
I experience the same unexpected behavior.
On Friday, October 28, 2011, szimszon wrote:
I have to tables
db.define_table( 'wdirs',
Field( 'name', type = 'string',
requires = IS_NOT_EMPTY()),
*(a)* *format='%(name)s %(id)s'*
)
db.define_table( 'files',
Johan, we're you able to specify your own icons for your custom buttons? If
so, may I know how you did it?
On Thursday, October 27, 2011, Johann Spies wrote:
On 26 October 2011 19:15, Cliff cjk...@gmail.com javascript:_e({},
'cvml', 'cjk...@gmail.com'); wrote:
So you need a column on the
That's nice Peter. Good work!
Thanks for sharing.
On Wednesday, October 26, 2011, peter wrote:
I am using and enjoying sqlform.grid. I have the latest version of
web2py, however, I think that the css files within my application have
become out of date.
If I have ten pages, then the page
If one clicks on 'data modified' in a windows folder, the files are
ordered with the most recent first.
In SQLFORM.grid if one has a column with a date in it, and one clicks
on the heading, they are sorted with the oldest first.
See www.ukjazz.net/store/albums
It would be nice if SQLFORM.grid
Hello Bruno,
I am giving a ride to new SQLFORM.grid actually... And I wonder if there is
a way to have a scroll bar for big table (large table)? Do I have to use
jQuery UI?
If so is there a predefined way of doing it?
Richard
On Tue, Oct 25, 2011 at 4:53 PM, Bruno Rocha rochacbr...@gmail.com
On Thu, Oct 27, 2011 at 5:51 PM, Richard Vézina ml.richard.vez...@gmail.com
wrote:
Hello Bruno,
I am giving a ride to new SQLFORM.grid actually... And I wonder if there is
a way to have a scroll bar for big table (large table)? Do I have to use
jQuery UI?
If so is there a predefined way
Many thanks Bruno I was digging into the appadmin trying to get the overflow
stuff and putting it into my test view function.
With Datatables I didn't use overflow since a wild...
Thanks again.
Richard
On Thu, Oct 27, 2011 at 4:04 PM, Bruno Rocha rochacbr...@gmail.com wrote:
On Thu, Oct
using 1.99.2
SQLFORM.grid...
I don't see the need for this statement...
line 1641: if not searchable and not rows: return DIV(T('No records
found'))
If it was removed a user would see an empty grid rather than just a
div, no matter what the value of 'searchable' was.
An empty grid allows the
SQLFORM.grid is amazing. Many thanks Massimo, Bruno, Martin and
everyone involved.
Is there a way to replace the contents of the h2 tag at the top of
the view? All the pages show Index. This is okay for the index
view, but I would like to change it to Edit, View and so on.
Do the design,
You can find a digest of posts about SQLFORM.grid here:
https://docs.google.com/document/d/1p-OXDn75Nt2qmXQ0lvjqr4tYIf2PTIQx6hPegT1AV1Q/edit
I know it is not complete, but it may help you get started.
Also there is some good information in the source file: gluon/
sqlhtml, Just looking at the
using 1.99.2
in gluon.sqlhtml.SQLFORM.grid:
line 1489: return ondelete(table,request.args[-2],ret)
I think it should be: return ondelete(table,request.args[-1],ret)
As it is now, ondelete gets (table, table, ret), whereas I believe it
should get (table, record_id, ret) to work properly...
I
I am using and enjoying sqlform.grid. I have the latest version of
web2py, however, I think that the css files within my application have
become out of date.
If I have ten pages, then the page numbers appear vertically rather
than horizontally at the bottom of the table.
What css files do I need
The grid css is in base.css, but if you do not want to mess your own css,
open the file and copy only the grid part. it is commented.
On Tue, Oct 25, 2011 at 6:46 PM, peter peterchutchin...@gmail.com wrote:
I am using and enjoying sqlform.grid. I have the latest version of
web2py, however, I
I have a few questions regarding the grids.
1. Is SQLFORM.grid the implementation of Powergrid? meaning, does
SQLFORM.grid has all the features of Powergrid?
2. Is there an option to edit a value on the fly rather than using an
edit button? sort of like edit in place pyslice.
3. Is search as
FYI - Created a whole new install of web2py from trunk and my problem
went away. Sorry for the noise...
-Jim
On 10/6/2011 3:25 PM, Jim Steil wrote:
Hi
I installed the latest from trunk today and am now getting the following.
Traceback(most recent call last):
Hi
I installed the latest from trunk today and am now getting the following.
Traceback(most recent call last):
FileC:\dev\web2py\gluon\restricted.py,line194,inrestricted
execccodeinenvironment
FileC:/dev/web2py/applications/FoodPantry/controllers/default.py
The following commit has caused an error when columns/fields are not
specified:
http://code.google.com/p/web2py/source/detail?r=48e6f24a4ed36bb35bcd3f37e9ebc955dc9868a1
I have been trying to figure out where this error has been coming from and
finally narrowed it down. Here is the code I have
For example, I have a field which has 'abcab' and 'bcabc' data.
If I provide 'ab' in the search box, I want to just pull the first one
('abcab') and exclude second one ('bcabc'). Can we do this ?
models/db.py
-
db.define_table('Product',
Field('Part_Number'))
This is a very cool feature! However, I don't think regular users will know
how to use this. For one, you have to know the field names. You have to know
that First Name is actually first_name and that E-mail is actually
email. Is there a way to make these queries easier for users? Maybe a help
Is it possible that this is a bug? (I don't have the
expertise/confidence to say it is definitely a bug).I duplicated
your example and can reproduce your results. But, if I go through
appadmin and list out my table the owner name does appear.
-Jim
On 9/12/2011 9:51 PM, Simon Ashley
Have a Model as follows:
from gluon.tools import Auth
auth=Auth(db)
auth.define_tables()
db.define_table('person',Field('name'),format='%(name)s')
db.define_table('dog',Field('name'),Field('owner',db.person))
db.dog.owner.requires = IS_IN_DB(db, 'person.id', db.person._format)
and a controller:
301 - 388 of 388 matches
Mail list logo