Giter Site home page Giter Site logo

Comments (2)

BuhtigithuB avatar BuhtigithuB commented on July 26, 2024

I can apply you PR if you guarrantee me that you made some test and it works properly... You have to know (if you don't already know it) that CRUD is "deprecated" we leaving there, but it not maintain anymore and the core team has no intention to maintaining it in the future. At some point it will disapear... The only usage a developer should have of it is rapid prototyping as proof of concept, but even so, there is not so much advantage not using SQLFORM knowing that you will have to refactoring it if your demonstration is validated... The extra mile involve in using SQLFORM from the start doesn't worth the extra work you will have to refactor you code...

Also in your example I doubt that someone who intent to use next with URL('index') would ever pass the ID of the created record with crud.create() except if your form would be inside your index page controller function, which is not the case in the following example you showed us...

So maybe with :
­

def people():
    form = crud.create(db.person, next=URL('people/[id]'),
                       message=T("record created"))

It would make some sens... But I am curious what the default behavior of :

form crud.create(db.person, message=T("record created"))  # without specifiying the "next" argument

from web2py-book.

dartg avatar dartg commented on July 26, 2024

I didn't know CRUD is not maintained anymore. However I don't see what needs testing here, it is just a side note in the documentation. I've noted this issue while using a CRUD form in an old application a year ago and solved it using url_encode=False.

Also, URL("index") is just an example. It is logical to redirect to the record once created, then you need to know its ID. I can edit the issue and put next=URL("show_the_just_created_record/[id]") so it is self-explanatory.

from web2py-book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.