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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:42:41+00:00 2026-06-03T21:42:41+00:00

I have a custom form as follows class ticketform( BootstrapForm ): class Meta: layout

  • 0

I have a custom form as follows

class ticketform( BootstrapForm ):
    class Meta:
        layout = ( 
            Fieldset( "", "project", "manager", "cc_to", "urgency", "deadline", "subject", "steps", "result", "desc", "file" ),
        )

    project = forms.CharField( max_length = 100, label = "Project", help_text = "Project this request is related to" )
    manager = UserModelChoiceField( queryset = User.objects.filter( is_active = True ).order_by( 'first_name' ), label = "Manager",
                                   help_text = "Immediate superior or project manager", required = True )
    cc_to = UserMultipleSelectField( queryset = User.objects.filter( is_active = True ).order_by( 'first_name' ), label = "CC To",
                                    widget = widgets.FilteredSelectMultiple( "Users", is_stacked = True ), required = False )
    OPTIONS = ( 
              ( 'Critical', 'Critical' ),
              ( 'Major', 'Major' ),
              ( 'Minor', 'Minor' ),
              )
    urgency = forms.ChoiceField( choices = OPTIONS, label = "Urgency", help_text = "Urgency of the request" )
    deadline = forms.CharField( widget = widgets.AdminSplitDateTime(), label = "Deadline",
                               help_text = "When should this ticket be completed", required = True )
    subject = forms.CharField( max_length = 100, label = "Subject", help_text = "Ticket Subject" )
    steps = forms.CharField( widget = forms.Textarea, label = "Steps", help_text = "Reproducible error/feature Steps" )
    result = forms.CharField( widget = forms.Textarea, label = "Result", help_text = "Expected Result" )
    desc = forms.CharField( widget = forms.Textarea, label = "Description", help_text = "Detailed Description" )
    file = forms.FileField( label = "File", help_text = "Attach File Max size 10MB", required = False )

i have the following code in my view to populate the form for view

def view_ticket( request, ticket_id ):
    ticket = Ticket.objects.filter( pk=ticket_id )[0]
    dict = {'project' : ticket.project,
            'manager' : ticket.manager.pk,
            'urgencry': ticket.urgency,
            'deadline': ticket.deadline,
            'subject' : ticket.subject,
            'steps'   : ticket.steps,
            'result'  : ticket.result,
            'desc'    : ticket.detailed_disc,
            'file'    : ticket.attachments,
            'cc_to'   : ticket.cc_to.all()
            }

    form = ticketform( dict )

    return render_to_response( 'form/request.html', {'form':form,
                                                         },
                                  mimetype="text/html", context_instance=RequestContext( request ) )

now what is happening is that the deadline field is not being populated (all other fields gets populated just fine). all though i pass it the values in dictionary. Is there a way to pre-populated the AdminSplitDateTime() field on the form ?

  • 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-03T21:42:43+00:00Added an answer on June 3, 2026 at 9:42 pm

    setting the initial value for the form worked as pointed out by jpic

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

Sidebar

Related Questions

I have a custom class declared as follows (in vb.net) <Serializable()> Public Class NumInfo
Currently have a custom Form Element View: class Apply_View_Helper_JQueryUiFormRadio extends Zend_View_Helper_FormElement My form is
I have a custom form type for a Rating entity in my Symfony2 project.
Let's say you have a custom form MyForm : Form and want to run
I have a client that wants to have a custom form added as a
My problem is similar to Django Passing Custom Form Parameters to Formset Ive have
I have a custom jQuery plugin which binds a change event to a form
I have a custom control that can be added multiple times to a form.
I have a list within Sharepoint, using a custom new form I have added
I am using jquery validation plugin for form validation. I have added a custom

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.