Hi,
I am having controller as :
@auth.requires_login()
def add():
form = SQLFORM(db.table)
if form.process(formname='test').accepted:
response.flash = 'Database Updated'
elif form.errors:
response.flash = 'Please fill all the required details'
else:
res
Thanks a lot !!
That's what I was looking for.
-Sarbjit
On Friday, July 26, 2013 7:53:28 PM UTC+5:30, Anthony wrote:
>
> isinstance(table[field].requires, IS_IN_SET)
>
> Anthony
>
> On Friday, July 26, 2013 8:56:13 AM UTC-4, Sarbjit singh wrote:
>>
>>
an do field.requires.theset (for the
> values), field.requires.labels (for the labels), or
> field.requires.options() for a list of tuples of values and labels.
>
> You can also create a SELECT object via SQLFORM.widgets.options.widget(field,
> value=field.default).
>
> Anthony
ller default.py
> def index():
> form = SQLFORM(db.persons).process()
> return locals()
>
> #views default/index.html
> {{extend 'layout.html'}}
> {{=form}}
>
>
> Mind we tend to call table names with singular not plural (person, not
> persons). This wil
I have a db where I have set validator IS_IN_SET on a particular field. I
am generating table rows (to be used as form), so I need to check if a
particular field is having IS_IN_SET validator set and I want to retrieve
the set values. Reason I want to do this is that I am generating a dynamic
f
18, 2013 12:36:25 PM UTC+5:30, Sarbjit singh wrote:
>
> Just to be clear on exception (crash) :
>
> On clicking search, pickle error is seen if the url is like :
>
>
> http://127.0.0.1:8000/sampleapp/default/search2/edit/customer/2?_signature=.
> ..
>
> If it is s
edit/view forms are seen on redirection from "results" view back to
"search2".
-Sarbjit
On Thursday, July 18, 2013 9:18:18 AM UTC+5:30, Sarbjit singh wrote:
>
> Thanks guys for the help.
>
> I followed the approach as suggested by Massimo, so I did the foll
gt;> HI,
>>> you can pass results to the next page;
>>> redirect(URL("test",vars=dict(results=results))
>>>
>>> On the next page you can do
>>> return dict(results=request.vars["results"])
>>>
>>> Am Mittwoch, 17. J
rshall/etc).
>
> On Wednesday, 17 July 2013 05:37:24 UTC-5, Sarbjit singh wrote:
>>
>> Hi,
>>
>> I am trying to use "dynamic search form" from
>> http://www.web2pyslices.com/slice/show/1403/dynamic-search. Current
>> implementation shows both the form a
Hi,
I am trying to use "dynamic search form" from
http://www.web2pyslices.com/slice/show/1403/dynamic-search. Current
implementation shows both the form and results on the same page.
I want to display the search results (using GRID) in a new page and wants
to use customized forms for edit/view
I am doing the following steps :
>>> db = DAL('sqlite://storage.db')
>>> db.define_table('person', Field('name'), Field('country'))
>>> db.person.insert(name='John', country='UK')
>>> db.person.insert(name='David', country='US')
>>> query = db.person.name=="David"
>>> SQLFORM.smartgrid(query)
Tr
On Monday, April 26, 2010 7:17:55 AM UTC+5:30, mr.freeze wrote:
>
> Just thought I would share a small slice I made recently. It's creates
> a search form for a table with selectable fields and criteria.
> http://www.web2pyslices.com/main/slices/take_slice/78
>
>
> --
> Subscription settings:
Hi,
I have been trying to use the dynamic search with SMARTGRID. But it is not
working. I modified the code as :
results = db(query).select(*selected)
==MODIFIED TO ==>
results = SQLFORM.smartgrid(query)
With this modification, it is giving the below error :-
"Query" object has no attr
/blob/master/applications/welcome/static/css/web2py.css#L192
> down
>
>
> Il giorno lunedì 15 luglio 2013 10:27:35 UTC+2, Sarbjit singh ha scritto:
>>
>> I am using default searchwidget available in SMARTGRID and want to
>> customize the size of search entry window.
I am using smartgrid to create a grid for the records present in the
database. I have labelled all the database elements as :
db.mytable.myname.label = 'Name'
Now in the grid which is generated does shows "Name" in the table header
and in the drop-down which is used to build search queries. Now
d.custom.widget.name/>.update_form
> .custom.widget.name <http://grid.custom.widget.name/>}}
> {{=grid.update_form.custom.submit}}
> {{=grid.update_form.custom.end}}
> {{else:}}
> {{=grid}}
> {{pass}}
>
> On Sunday, 14 July 2013 23:14:03 UTC-5, Sarbjit singh wrote:
>>
>>
I am using default searchwidget available in SMARTGRID and want to
customize the size of search entry window. I am having a large number of
database options which can be used for searching records from db, so I want
to make my search window long enough (increase both width and height) such
that
Hi,
I am using customized form for adding records into database and using
smartgrid to view/edit the records inserted in the database. Since, I am
using the customized form for adding records into the database, I want to
use the same layout for Edit operation (from SMARTGRID).
To achieve this,
7;s the error_message argument of any validator...
>
> http://web2py.com/books/default/chapter/29/07#Validators
>
> Il giorno venerdì 12 luglio 2013 08:55:08 UTC+2, Sarbjit singh ha scritto:
>>
>> Actually, I am new to web2py and wasn't aware of it. My requirement was
>&g
r: why complicate things when you can use
> form.custom ???
>
> http://web2py.com/books/default/chapter/29/07#Custom-forms
>
> Il giorno venerdì 12 luglio 2013 08:19:35 UTC+2, Sarbjit singh ha scritto:
>>
>>
>> I have defined a model in which some fields were marked as
I have defined a model in which some fields were marked as "IS_NOT_EMPTY",
now when I am using SQLFORM generated form, then if a user clicked on
"submit", then if that particular field is empty, it shows a message in red
color indicating which field is having empty value.
Now since my requirem
Finally, I am able to do it :)
http://www.web2pyslices.com/slice/show/1622/how-to-authorize-users-editing-records-only-for-records-that-were-created-by-tho
On Thursday, July 11, 2013 12:37:53 PM UTC+5:30, Sarbjit singh wrote:
>
> Just to be clear on my requirement :
>
> Taking
Just to be clear on my requirement :
Taking "Image Blog" example provided in web2py manual, I want to achieve
the following functionality :
1) Multiple user's to be able to add images.
2) There should be one "View Records" page which should display all the
records with buttons like edit/delete/
Hi everyone,
Can some one please help me on this issue. I need a working example where
few table entries are editable (only for the user who has entered the
information).
Thanks
Sarbjit
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
Thanks 黄祥,
Can you please share the code.
-Sarbjit
On Tuesday, March 26, 2013 5:10:20 AM UTC+5:30, 黄祥 wrote:
>
> it can, yesterday i've already tested it, i'll share the code when i'm at
> the office.
--
---
You received this message because you are subscribed to the Google Groups
"web2py-
Just one question, were you able to get the results in the grid as :
ROW1 -- Editable (means showing view, delete and edit buttons)
ROW2 -- Non Editable (means showing only view button)
ROW3 -- Non Editable (means showing only view button)
ROW4 -- Editable (means showing view, delete and edit butt
I did added it in grid, my controller is :
@auth.requires_login()
def rent():
grid=SQLFORM.grid(db.company, user_signature=False,
editable = auth.has_permission('edit','auth_user'),
deletable = auth.has_permission('delete','auth_user'))
return
I tried the same, now all the results are non editable, it seems I need to
add user_login to edit permission.
I am doing the below for adding the permission, but not successful.
auth.add_permission('edit','mana...@test.com', 'company', 0)
Just one more question: since this expression will re
thanks for reply.
I tried modifying the controller as per the company model that you provided
earlier. But I am getting following error :
'DAL' object has no attribute 'auth'
Sorry for this basic question, but I am a beginner to web2py. Hope you can
help me to resolve this issue. So my model
Well, I was able to run the code. Problem with this is that in this case if
user is "Manager", then all the rows are editable and if it is other user
including "Admin", then rows are read only.
My requirement is let's say I have a database where each user can insert
some data and at the same ti
@黄祥,
*Its still giving error: *Table has no attribute 'gender' and '*
*'custom_auth_table' not defined.
Db.py
# -*- coding: utf-8 -*-
from gluon.tools import Auth
db = DAL("sqlite://storage.sqlite")
auth = Auth(db)
auth.settings.create_user_groups=True
auth.define_tables(username=False, signatur
@黄祥,
Below is my complete db.py, I am getting error in registration of user
stating gender can't be null.
# -*- coding: utf-8 -*-
from gluon.tools import Auth
db = DAL("sqlite://storage.sqlite")
auth = Auth(db)
auth.settings.create_user_groups=True
auth.define_tables(username=False, signature=T
Thanks Alan. Since, I am a beginner, I will study the mentioned chapters
and would try. In case of any problem, I will revert back.
@ 黄祥, I gave it a quick try, In this case when has_membership is True, all
of the rows in the grid are editable. My requirement is to get few rows of
the grid edi
Hello All,
I am a newbie to web2py and developing my test app. I want to present all
the entries in a db using SQLFORM.grid with the option to edit/delete rows
based on user name.
e.g.
My models are like:
Person table with entries name, userid, address, phone number.
Controller looks like :
te a default display for any data. The next sentence
> provides instruction for customizing the default index.html view for this
> example:
>
> Proceed to create a view for the index action. Return to admin, edit
>> "default/index.html" and replace its content with
clears my doubt
-Sarbjit
On Thursday, March 14, 2013 9:04:31 PM UTC+5:30, Mark wrote:
>
> If you don't have a view (such as index.html), the generic view
> (generic.html) will be used. Isn't it clear?
>
> On Thursday, March 14, 2013 7:54:38 AM UTC-4, Sarbjit singh wrote:
> {{else:}}
> {{=BEAUTIFY(response._vars)}}
> {{pass}}
>
> If theres no content it renders the BEAUTIFY(response._vars) just like the
> generic view, so its not the generic view being rendered but a similar view.
>
>
>
> 2013/3/14 Sarbjit singh >
>
>> In the 5th
e web2py "more capable":
> tell us what's your OS and we can come up with solutions.
>
> On Thursday, March 14, 2013 9:45:38 AM UTC+1, Sarbjit singh wrote:
>>
>> Hi,
>>
>> I have started learning web2py for web development in Python. Initially I
In the 5th edition of web2py manual, for the example of images app, I have
one doubt :-
As per that app code, we create db in models (db.py) and then we write some
code in controller (default.py) as :-
def index():
images = db().select(db.image.ALL, orderby=db.image.title)
return dict(ima
Hi,
I have started learning web2py for web development in Python. Initially I
started with Django, but found on internet that web2py is easy to learn and
provides more features over django. However I have one basic question :-
Can I use default web2py server in production. I want to build an da
40 matches
Mail list logo