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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:30:13+00:00 2026-05-23T11:30:13+00:00

I have this Datetime field in Django update_date = models.DateField() But I want the

  • 0

I have this Datetime field in Django

update_date     = models.DateField()

But I want the Calendar to pop up. In docs, they say to write this

class CalendarWidget(forms.TextInput):
    class Media:
        css = {
            'all': ('pretty.css',)
        }
        js = ('animations.js', 'actions.js')

Now I have a few problems:

  1. Where to declare this class and how to use it
  2. I don’t have pretty.css , animation.css , how can get it
  3. Do I need to do programming for it??
  • 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-23T11:30:14+00:00Added an answer on May 23, 2026 at 11:30 am

    The files ‘pretty.css’, ‘animations.js’ and ‘actions.js’ are not included with Django, this code in the docs is an example only. It is your duty to write the code for fancier widgets – personally I like jQuery widgets (see the reference links bellow). From the docs:

    Which JavaScript toolkit?
    Many JavaScript toolkits exist, and many of them include widgets (such as calendar widgets) that can be used to enhance your application. Django has deliberately avoided blessing any one JavaScript toolkit. Each toolkit has its own relative strengths and weaknesses – use whichever toolkit suits your requirements. Django is able to integrate with any JavaScript toolkit.

    Supposing you got all the css and js defined for your fancy widget, in the ModelForm you have to override the field widget like this:

    class SomeForm(forms.ModelForm):
        ...
        update_date = forms.CharField(widget=CalendarWidget)
        ...
    

    Don’t forget to display the form media at the template header.

    Look these answers:

    1. What's the cleanest, simplest-to-get running datepicker in Django?
    2. https://groups.google.com/group/django-users/browse_thread/thread/8bd4675ba642ebcb?pli=1
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a procedure with this structure but it doesn't work for datetime
I have a table describing files with a datetime field. I want to somehow
i have this code from t he django sample tutorial from django.db import models
I have the following python code: from django.db import models from datetime import datetime
I'm a Django newbie who needs your help Have this database model: class Record(models.Model):
I have 2 django models like this: class UserProfile(models.Model): user = models.OneToOneField(User) organisation =
I have this: var date = new DateTime(2009, 12, 5); ... ... and need
I have this table: ID(INT) DATE(DATETIME) Under the DATE column there are a lot
datetime.datetime.utcnow() Why does this datetime not have any timezone info given that it is
In mysql database i have this column called: Name: Date Type: datetime I have

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.