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.
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?
On Thu, Apr 23, 2009 at 6:55 PM, Gary <gary.k.ma...@gmail.com> wrote:
> 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.
> 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?
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.
> On Thu, Apr 23, 2009 at 6:55 PM, Gary <gary.k.ma...@gmail.com> wrote:
> > 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.
> > 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?
> 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.
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:
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.
> 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).
> 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 ?
> > 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.