gpt-3.5-turbo-0125· OpenAI
WildChat-4.8M (AI2)
Write me this python django url converter to a 12 digit string containing only numbers.…
- User
Write me this python django url converter to a 12 digit string containing only numbers.
class FourDigitYearConverter: regex = "[0-9]{4}"
codedef to_python(self, value): return int(value) def to_url(self, value): return "%04d" % value - Assistant
from django.urls import path from . import views
urlpatterns = [ path('FourDigitYearConverter:year/', views.year_view), ]