Opened 3 years ago

Closed 3 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)

patch (1.2 KB) - added by yarula 3 years ago.
local patch which allows to store template files of maximum length

Download all attachments as: .zip

Change History (2)

Changed 3 years ago by yarula

local patch which allows to store template files of maximum length

comment:1 Changed 3 years ago by jezdez

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

Until we have a sensible way to automatically migrate model fields, this is a no go.

Note: See TracTickets for help on using tickets.
Back to Top