Opened 12 years ago
Closed 12 years ago
#18331 closed Bug (wontfix)
flatpages - models.py: template path is limited to 70 chars
Reported by: | yarula | Owned by: | nobody |
---|---|---|---|
Component: | contrib.flatpages | Version: | 1.4 |
Severity: | Normal | Keywords: | flatpages |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
While creating new flatpage object user cannot choose a template which path length is more than 70 chars.
Further local patch helped me :
--- a/django/contrib/flatpages/models.py
+++ b/django/contrib/flatpages/models.py
@@ -1,14 +1,14 @@
from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
-
+import os
class FlatPage(models.Model):
url = models.CharField(_('URL'), max_length=100, db_index=True)
title = models.CharField(_('title'), max_length=200)
content = models.TextField(_('content'), blank=True)
enable_comments = models.BooleanField(_('enable comments'))
- template_name = models.CharField(_('template name'), max_length=70, blank=True,
+ template_name = models.CharField(_('template name'), max_length=os.pathconf('/', 'PC_PATH_MAX'), blank=True,
help_text=_("Example: 'flatpages/contact_page.html'. If this isn't provided, the system will use 'flatpages/default.html'."))
registration_required = models.BooleanField(_('registration required'), help_text=_("If this is checked, only logged-in users will be able to view the p
sites = models.ManyToManyField(Site)
Attachments (1)
Change History (2)
by , 12 years ago
comment:1 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Until we have a sensible way to automatically migrate model fields, this is a no go.
local patch which allows to store template files of maximum length