Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How to use the CRUD functions?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Gary  
View profile  
 More options Apr 23, 5:55 pm
From: Gary <gary.k.ma...@gmail.com>
Date: Thu, 23 Apr 2009 14:55:19 -0700 (PDT)
Local: Thurs, Apr 23 2009 5:55 pm
Subject: How to use the CRUD functions?
This seems so elementary, but it's been bugging me for days.  I tried
to find more information in the documentation, in the book, searched
this group and even read the source (as best I could),  but I'm
stymied.

When I use the function:

http://localhost:8001/myapp/default/data/update/person/1

the form is displayed as expected, but after the update, the resulting
screen is (redirected to):

http://localhost:8001/myapp/default/data/tables

and I cannot figure out how to change that behavior, for example call
index.

Am I missing something fundamentally simple?  Also, what is the best
way to modify the SQLForm that is used in the display.  Is there a
better description on how to use the CRUD functions?

Thanks in advance.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Álvaro Justen [ Turicas ]  
View profile  
 More options Apr 23, 6:03 pm
From: Álvaro Justen [Turicas] <alvarojus...@gmail.com>
Date: Thu, 23 Apr 2009 19:03:49 -0300
Local: Thurs, Apr 23 2009 6:03 pm
Subject: Re: [web2py:20382] How to use the CRUD functions?

By default, web2py have in gluon/tools.py, class Crud:
        self.settings.create_next = URL(r=request)
        self.settings.update_next = URL(r=request)
        self.settings.delete_next = URL(r=request)

So, if you have:
mycrud = Crud(globals(), db)
you can change URLs with:

mycrud.settings.create_next = URL(r=request, f='myfunction', args='...')
Same for update_next and delete_next.

--
 Álvaro Justen
 Peta5 - Telecomunicações e Software Livre
 21 3021-6001 / 9898-0141
 http://www.peta5.com.br/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary  
View profile  
 More options Apr 23, 6:17 pm
From: Gary <gary.k.ma...@gmail.com>
Date: Thu, 23 Apr 2009 15:17:37 -0700 (PDT)
Local: Thurs, Apr 23 2009 6:17 pm
Subject: Re: How to use the CRUD functions?
Thank you Alvaro.

Is there a document that details the properties and methods of the
CRUD classes or is it necessary to read the source?

Is there and equally easy fix for replacing the SQLForm used in the
update/add controller function?

Thanks again for the quick response.

On Apr 23, 6:03 pm, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Álvaro Justen [ Turicas ]  
View profile  
 More options Apr 23, 6:28 pm
From: Álvaro Justen [Turicas] <alvarojus...@gmail.com>
Date: Thu, 23 Apr 2009 19:28:58 -0300
Local: Thurs, Apr 23 2009 6:28 pm
Subject: Re: [web2py:20387] Re: How to use the CRUD functions?

On Thu, Apr 23, 2009 at 7:17 PM, Gary <gary.k.ma...@gmail.com> wrote:
> Thank you Alvaro.

> Is there a document that details the properties and methods of the
> CRUD classes or is it necessary to read the source?

You can access web2py epydoc:
http://localhost:8000/examples/static/epydoc/index.html
And inside this, you can browse source of funtions/classes.

You also can learn with Auth and Crud examples at:
http://localhost:8000/examples/default/tools

> Is there and equally easy fix for replacing the SQLForm used in the
> update/add controller function?

http://www.web2py.com/AlterEgo/default/show/205

> Thanks again for the quick response.

You're welcome.

--
 Álvaro Justen
 Peta5 - Telecomunicações e Software Livre
 21 3021-6001 / 9898-0141
 http://www.peta5.com.br/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary  
View profile  
 More options Apr 24, 2:27 pm
From: Gary <gary.k.ma...@gmail.com>
Date: Fri, 24 Apr 2009 11:27:42 -0700 (PDT)
Local: Fri, Apr 24 2009 2:27 pm
Subject: Re: How to use the CRUD functions?
OK.  So I've studied a little more and tried some stuff like a custom
form, which loses the ability to enforce restrictions and read the
source code, which is beyond my newbie comprehension and downloaded
Wing IDE to step through the code hoping that it would be easier to
understand what's happening.  But, I'm still stumped regarding the the
substitution of a modified SQLFORM.  For example, what if I only
wanted to display a subset of fields in the 'read' function.

Looking at the code, it appears that there is no parameter to replace
the 'form' variable and trying to affect it in a similar fashion to
the the 'settings.create_next' (I tried crud.form = SQLFORM(...))
doesn't seem to work (although I could be using the wrong syntax).

Once again, help would be greatly appreciated.

Thanks in advance.

On Apr 23, 6:28 pm, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mdipierro  
View profile  
 More options Apr 24, 4:10 pm
From: mdipierro <mdipie...@cs.depaul.edu>
Date: Fri, 24 Apr 2009 13:10:13 -0700 (PDT)
Local: Fri, Apr 24 2009 4:10 pm
Subject: Re: How to use the CRUD functions?

On Apr 24, 1:27 pm, Gary <gary.k.ma...@gmail.com> wrote:

> OK.  So I've studied a little more and tried some stuff like a custom
> form, which loses the ability to enforce restrictions and read the
> source code, which is beyond my newbie comprehension and downloaded
> Wing IDE to step through the code hoping that it would be easier to
> understand what's happening.  But, I'm still stumped regarding the the
> substitution of a modified SQLFORM.

I do not understand. who said that ?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary  
View profile  
 More options Apr 24, 5:19 pm
From: Gary <gary.k.ma...@gmail.com>
Date: Fri, 24 Apr 2009 14:19:46 -0700 (PDT)
Local: Fri, Apr 24 2009 5:19 pm
Subject: Re: How to use the CRUD functions?
Massimo,

I'm not sure what you are referring to by 'said that'.  I'm just
confused.  Could you please review the entire thread and see if you
could help?

Thanks so much,
Gary

On Apr 24, 4:10 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google