Git Product home page Git Product logo

Comments (2)

MrEvertide avatar MrEvertide commented on June 27, 2024

Hi!

I would like to help out with this issue, would it be possible to list the particular forms I need to update? From what I can see it's all in the users/templates directory, right?

I assume we wouldn't want to do anything with passwords or sensitive information.

Thanks,

from affordable_water.

mpbrown avatar mpbrown commented on June 27, 2024

Hi Cédric, glad to hear you'd like to help out!

I believe most of it can be done right in pathways/views.py. Since we're using Django class-based views and specifically FormView, we can override the get_initial function and pass in sessions values if they exist.

Here's what I came up with for overriding it in HouseholdView

class HouseholdView(FormView):
    template_name = 'pathways/apply/household-size.html'
    form_class = forms.HouseholdForm
    success_url = '/apply/household-benefits/'

    def get_initial(self):
        initial = super(HouseholdView, self).get_initial()
        if 'household' in self.request.session:
            initial['household'] = self.request.session['household']
        return initial

Let me know if you come across any parts of the repo that are unclear and could do with some additional documentation.
Thanks!

from affordable_water.

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.