45. Setup form initial values inside HorillaFormView | Free & Open Source HR Software | Free HRMS

Horilla · Intermediate ·👥 HR, People Management & Leadership ·11mo ago

Key Takeaways

Sets up form initial values inside HorillaFormView

Full Transcript

Hi all, welcome to new video of Horilla development series. In this video, we will cover how we can set up initial value for our Hora forms. Okay, when you check the created Hora form view. Here we can see there is already some default initial value for employee request date till date. Okay. Uh it's because it's already configured inside the Horella form. So let's see how we can uh set up some initial value inside hora form class view. Okay to do that inside hurl there is a function called get uh get initial. So the get initial will uh return written a dictionary dictionary of uh key with the field and value of the initial value. So let's see how we can set up it inside form class view. So we simply have to write get def um get initial then let's store this into a variable like called um initial then return the initial okay uh for the purpose of video uh I'm going to provide a initial value for the description and also for the requested till date. Okay. Okay, initial will be I can provide uh the field li will be description and uh the value for the initial like okay and for the uh requested till okay let's confirm the field name here is the shift request model requested date um yeah requested till Okay, for the requested field, I'm going to uh provide the next date. So to do that, I'm going to import date time from date time import date time also for the also the time delta time. Then uh the requested till will be date time dot today. So it will return current date. Then we will uh add a single day to do that time delta of day equal to 1. Okay. Now let's restart the ser server. Okay. Once the server is restarted when you check it inside the hurilla uh for inside the hella and open the form here you can see uh the initial value for the description and the requested till uh initial value is showing over here. So I hope you understood this video. If you any doubt queries you you can ask it inside the comments. Thank you for watching.

Original Description

In this tutorial, we will explore how to configure initial values in a form using the get_initial method provided by the HorillaFormView class. This feature allows developers to pre-populate form fields with default values before rendering them to the user, improving the user experience and streamlining form interactions. Connect With Us: ————————————— ➡️ Website: https://www.horilla.com/ ➡️ Email: info@horilla.com ➡️ Twitter: https://twitter.com/horillahrms ➡️ LinkedIn: https://www.linkedin.com/company/horilla/ ➡️ Facebook: https://www.facebook.com/people/Horilla/100091947807253/ ➡️ Instagram: https://www.instagram.com/horillahrms/ ➡️ YouTube: https://www.youtube.com/channel/UCvD8feLT7EKmXHaPKnWZT-w ➡️ Pinterest: https://in.pinterest.com/horillahrms/ ➡️ GitHub: https://github.com/horilla-opensource/horilla/ ➡️ Horilla Android Mobile App: https://play.google.com/store/apps/details?id=com.cybrosys.horilla_project ➡️ Horilla iOS Mobile App: https://apps.apple.com/in/app/horilla-mobile-app/id6744724397
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

📰
We Cut Employee Onboarding Time Without Hiring More Trainers. Here's What Changed.
Reduce employee onboarding time without hiring more trainers by implementing efficient processes and tools
Dev.to · Saifuddin Tipu
📰
UK Spouse Visa 2026: Financial Thresholds, Eligibility Logic, and What HR & Compliance Systems Need to Handle
Learn how to handle UK Spouse Visa 2026 requirements in HR and compliance systems, including financial thresholds and eligibility logic
Dev.to · ImmigrationGPT
📰
HRM: Simplifying Complex Payroll & Salary/Benefits Configurations at Scale
Learn how to simplify complex payroll and salary/benefits configurations at scale using HRM solutions, which is crucial for efficient business operations
Medium · UX Design
📰
Organizational Culture and Enduring Impact
You'll learn how organizational culture drives enduring impact and why it matters for long-term success
Medium · Startup
Up next
5 Big Mistakes People Often Make When Hiring Virtual Assistants
Grow with Will - SEO, Sales & Entrepreneurship
Watch →