<commit_before>from django.contrib.admin.widgets import AdminSplitDateTime, AdminDateWidget
from django.contrib.admin.checks import ModelAdminChecks
from django.contrib import admin
from django.db import models
from django import forms
from django.contrib.admin.templatetags.admin_static import static



    #necessary right now because of the error about exclude not being a tuple since we are using @property to dynamicall
    #change it
class VAdminChecks(ModelAdminChecks):
    def _check_exclude(self, cls, model):
        return []







class DateTimeForm(forms.Form):
    def __init__(self, request, *args, **kwargs):
        field_name = kwargs.pop('field_name')
        super(DateTimeForm, self).__init__(*args, **kwargs)
        self.request = request
        self.fields['%s_as_of' % field_name] = forms.SplitDateTimeField(
            label='',
            widget=AdminSplitDateTime(
                attrs={'placeholder': ('as of date and time')}
            ),
            localize=True,
            required=True
        )


    @property
    def media(self):
        try:
            if getattr(self.request, 'daterange_filter_media_included'):
                return forms.Media()
        except AttributeError:
            setattr(self.request, 'daterange_filter_media_included', True)

            js = ["calendar.js", "admin/DateTimeShortcuts.js"]
            css = ['widgets.css']
<commit_msg>24 hour time and HH:MM am/pm are usable in the filter<commit_after>from django.contrib.admin.widgets import AdminSplitDateTime, AdminDateWidget
from django.contrib.admin.checks import ModelAdminChecks
from django.contrib import admin
from django.db import models
from django import forms
from django.contrib.admin.templatetags.admin_static import static



    #necessary right now because of the error about exclude not being a tuple since we are using @property to dynamicall
    #change it
class VAdminChecks(ModelAdminChecks):
    def _check_exclude(self, cls, model):
        return []







class DateTimeForm(forms.Form):
    def __init__(self, request, *args, **kwargs):
        field_name = kwargs.pop('field_name')
        super(DateTimeForm, self).__init__(*args, **kwargs)
        self.request = request
        self.fields['%s_as_of' % field_name] = forms.SplitDateTimeField(
            label='',
            input_time_formats=['%I:%M %p', '%H:%M:%S'],
            widget=AdminSplitDateTime(
                attrs={'placeholder': ('as of date and time')}
            ),
            localize=True,
            required=True
        )


    @property
    def media(self):
        try:
            if getattr(self.request, 'daterange_filter_media_included'):
                return forms.Media()
        except AttributeError:
            setattr(self.request, 'daterange_filter_media_included', True)

            js = ["calendar.js", "admin/DateTimeShortcuts.js"]
            css = ['widgets.css']

{'fraction_non_alphanumeric': 0.09696142027995903, 'fraction_numerical': 0.0006828269033799932, 'mean_word_length': 2.770913770913771, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5728613', 'n_tokens_mistral': 820, 'n_tokens_neox': 784, 'n_words': 213}