Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8478225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:41:15+00:00 2026-06-10T18:41:15+00:00

I have a model in my dJango app called event . I want users

  • 0

I have a model in my dJango app called event. I want users to be able to clone event to create a new one without having to start from scratch — not all the information changes everytime.

When I do this, as it loads the clone event page, I’m getting validation errors on some of the required fields since I’m not copying over all the information from the existing event, only some of the fields. The fields that are not copied and required are throwing validation errors when the page first loads (but the user hasn’t submitted the form yet). Is there a way to make that initial validation not happen?

[EDIT]

Model:
    class Event(models.Model):
        class Meta:
            db_table = 'event'

        type = models.ForeignKey(EventType, default="0")
        title = models.CharField(max_length=150, default='Event')
        location = models.TextField()
        description = models.TextField(max_length=1050)
        start_time = models.DateTimeField()
        end_time = models.DateTimeField()

View and Template:

In the case of clone, I get the event by the event_id to clone from by doing Event.objects.get(id=event_id). Once I get the object, I set the following value for the form by doing:

map = {
    'type': event.type.name,
    'title': event.title,
    'location': event.location,
    'description': event.description,
    'start_time': event.start_time,
    'end_time': event.end_time
}

form = EventForm(map)

The values in the form object are the same name as the ones in the model. In the case of clone, say I get rid of title from the map, and load it into the form, when I show the form on the template, it has a validation error under it…but the user just opened the page…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:41:16+00:00Added an answer on June 10, 2026 at 6:41 pm

    You can do it like so:

    form = EventForm(initial=map)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a single model in my django app that I want to create
I have a model called Activity in my django app. in the admin interface,
Suppose I have a Django app named blog. There's a model called Post and
I'm new to Django. I have created a new App called Directorio and now
I have a failing model.save() in my Django app. How can I see the
I have a simple test case failing in Django: Model (app/models.py): from django.db import
I have a django app with models as follows: A Question model An Answer
I have django model which consist of parent child relationship filed I want to
I have a Django model TimeThingie with two TimeField s called t1 and t2
I have a Django model with separate Datefield and Timefield for an event. Is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.