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 6008191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:47:23+00:00 2026-05-23T01:47:23+00:00

Working on a Calendar app, and would like each Event model instance to have

  • 0

Working on a Calendar app, and would like each Event model instance to have one of the {allday|start,end} fields filled out. That is, either the allday field entered, or the start+end fields, but not both.

How can I model this and have it work correctly in the admin app? I’d like one of the group to be required.

  • 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-05-23T01:47:23+00:00Added an answer on May 23, 2026 at 1:47 am

    Create your model with all 3 fields, and override the clean method (called when validating the model) to check on your conditions:

    def clean(self):
        if not self.allday: # allday not present
            if not self.start or not self.end: # start and/or end not present
                raise ValidationError('error message...')
        else:
            if self.start or self.end:     # allday present but also start and/or end
                raise ValidationError('error message...')
    

    More information on clean: Model.clean()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working with the PHP api for google Calendar, and have been getting
Actually I need to create an event in Google Calendar using my app. Every
I need to build a simple app, A calendar with notes, working with a
I am working on an alarm app. I followed the Android AlarmController tutorial word
I'm implementing a calendar as part of my app, it shows the selected date
I'm having an issue when working with javascript date objects, specifically, when trying to
Hey, I was wondering if there's any source codes out there for an iPhone
I am trying to use a JSON feed to render events in fullCalendar. Here
I know, WinFax Pro is so 1998. (note: this is not WinFax.dll, which is
What is the best way to create a view for a single control that

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.