Giter Club home page Giter Club logo

Comments (4)

hellysmile avatar hellysmile commented on May 21, 2024

https://github.com/brack3t/django-braces/blob/master/braces/views.py#L546
https://github.com/django/django/blob/master/django/views/generic/edit.py#L204
https://github.com/django/django/blob/master/django/views/generic/edit.py#L163

you need something like
https://docs.djangoproject.com/en/dev/topics/class-based-views/generic-display/#adding-extra-context

and

    success_url = reverse_lazy('foos:list')

here is no sense for lazy

from django-braces.

AntelopeSalad avatar AntelopeSalad commented on May 21, 2024

Hmm, so I'm better off not using braces?

I was just trying to make a view that responds to both a normal post request and an ajax post request. The code example I linked to from the django site works well but it's pretty verbose if I want to manually include only a white list of fields.

from django-braces.

kennethlove avatar kennethlove commented on May 21, 2024

post_ajax, by default, just calls super on post. Your example completely overrides what happens in post in a CreateView so, yes, it throws an error about self.object not existing because you haven't instantiated anything.

You're probably best off either duplicating what happens in CreateView.post or calling super on post_ajax so you have an instance hanging around that you can use in your custom view.

We'll create a ticket to expand the documentation on the AJAX Response mixin.

from django-braces.

Joshua-Swain avatar Joshua-Swain commented on May 21, 2024

Can we get a link to some of that Ajax Response documentation?

from django-braces.

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.