Giter Club home page Giter Club logo

Comments (6)

WayneLambert avatar WayneLambert commented on May 18, 2024

The form now posts successfully with changes reflected in the database and the success URL being implemented.

Due to the form spanning across both Django's User model and my custom Profile model, the controls relating to the Profile form do not seem to be instantiating with the model's value.

from portfolio.

WayneLambert avatar WayneLambert commented on May 18, 2024

The form now pre-populates the current image being used in the custom Bootstrap file field. When the form is instantiated, it displays the image being used according to the model. Upon using the input picker, it displays the image selected from the hard drive.

from portfolio.

WayneLambert avatar WayneLambert commented on May 18, 2024

The form now GETs and POSTs successfully instantiating the fields as expected. I had to resolve the issue using a function-based view because it was proving challenging validating multiple forms within the UpdateView.

At a later stage, I may choose to rewrite the view with a class-based view. I believe it may need a parent class writing too which will include a function that validates multiple forms.

from portfolio.

WayneLambert avatar WayneLambert commented on May 18, 2024

Profile updates successfully. Issue resolved for now. At a later date, an aspirational item may be to change the view from function-based to class-based.

from portfolio.

WayneLambert avatar WayneLambert commented on May 18, 2024

This Django package may be able to assist in converting the profile_update view from function-based to class-based.

https://github.com/kennethlove/django-shapeshifter

from portfolio.

WayneLambert avatar WayneLambert commented on May 18, 2024

Used Django Shapeshifter to use a CBV approach to the UserUpdateForm and ProfileUpdateForm.

Updated tests.

from portfolio.

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.