return Version.objects.filter(tree__gt=0).filter(testing=0)
def item_link(self, obj):
- return "https://www.postgresql.org/docs/%s/static/%s" % (obj.tree, obj.relnotes)
+ return "https://www.postgresql.org/docs/%s/static/%s" % (obj.numtree, obj.relnotes)
def item_pubdate(self, obj):
return datetime.combine(obj.reldate,time.min)
def versionstring(self):
return self.buildversionstring(self.latestminor)
+ @property
+ def numtree(self):
+ # Return the proper numeric tree version, taking into account that PostgreSQL 10
+ # changed from x.y to x for major version.
+ if self.tree >= 10:
+ return int(self.tree)
+ else:
+ return self.tree
+
def buildversionstring(self, minor):
if not self.testing:
- return "%s.%s" % (self.tree, minor)
+ return "%s.%s" % (self.numtree, minor)
else:
- return "%s%s%s" % (self.tree, TESTING_SHORTSTRING[self.testing], minor)
+ return "%s%s%s" % (self.numtree, TESTING_SHORTSTRING[self.testing], minor)
@property
def treestring(self):
if not self.testing:
- return self.tree
+ return "%s" % self.numtree
else:
- return "%s %s" % (self.tree, TESTING_SHORTSTRING[self.testing])
+ return "%s %s" % (self.numtree, TESTING_SHORTSTRING[self.testing])
def save(self):
# Make sure only one version at a time can be the current one.
if self.version.tree == 0:
return 'devel'
else:
- return str(self.version.tree)
+ return str(self.version.numtree)
class Meta:
db_table = 'docs'
return getattr(self.__version, name)
def _find_pdf(self, pagetype):
try:
- return os.stat('%s/documentation/pdf/%s/postgresql-%s-%s.pdf' % (settings.STATIC_CHECKOUT, self.__version.tree, self.__version.tree, pagetype)).st_size
+ return os.stat('%s/documentation/pdf/%s/postgresql-%s-%s.pdf' % (settings.STATIC_CHECKOUT, self.__version.numtree, self.__version.numtree, pagetype)).st_size
except:
return 0
(r'^docs/$', 'pgweb.docs.views.root'),
(r'^docs/manuals/$', 'pgweb.docs.views.manuals'),
(r'^docs/manuals/archive/$', 'pgweb.docs.views.manualarchive'),
- (r'^docs/(current|devel|[0-9]+\.\d)/(static|interactive)/(.*).html?$', 'pgweb.docs.views.docpage'),
- (r'^docs/(current|devel|[0-9]+\.\d)/(static|interactive)/$', 'pgweb.docs.views.docsrootpage'),
- (r'^docs/(current|devel|[0-9]+\.\d)/$', 'pgweb.docs.views.redirect_root'),
+ (r'^docs/(current|devel|\d+(?:\.\d)?)/(static|interactive)/(.*).html?$', 'pgweb.docs.views.docpage'),
+ (r'^docs/(current|devel|\d+(?:\.\d)?)/(static|interactive)/$', 'pgweb.docs.views.docsrootpage'),
+ (r'^docs/(current|devel|\d+(?:\.\d)?)/$', 'pgweb.docs.views.redirect_root'),
(r'^community/$', 'pgweb.core.views.community'),
(r'^community/contributors/$', 'pgweb.contributors.views.completelist'),
-{{obj.tree}}.{{obj.latestminor}} is the latest release in the {{obj.tree}} series.
+{{obj.numtree}}.{{obj.latestminor}} is the latest release in the {{obj.numtree}} series.
{%if not obj.supported%}This version is unsupported!{%endif%}
-{{obj.tree}}.{{obj.latestminor}}
+{{obj.numtree}}.{{obj.latestminor}}
<tr{%if forloop.last%} class="lastrow"{%endif%}>
<td class="colMid">
<ul>
- <li><a href="/docs/{{v.tree}}/static/{{v.indexname}}">{{v.treestring}}</a></li>
+ <li><a href="/docs/{{v.numtree}}/static/{{v.indexname}}">{{v.treestring}}</a></li>
</ul>
</td>
<td class="colLast">
<ul>
- {%if v.a4pdf%}<li>Comprehensive Manual: <a href="/files/documentation/pdf/{{v.tree}}/postgresql-{{v.tree}}-A4.pdf">A4 PDF</a> <span class="txtMediumGrey">({{v.a4pdf|filesizeformat}})</span></li>{%endif%}
- {%if v.uspdf%}<li>Comprehensive Manual: <a href="/files/documentation/pdf/{{v.tree}}/postgresql-{{v.tree}}-US.pdf">US PDF</a> <span class="txtMediumGrey">({{v.uspdf|filesizeformat}})</span></li>{%endif%}
+ {%if v.a4pdf%}<li>Comprehensive Manual: <a href="/files/documentation/pdf/{{v.numtree}}/postgresql-{{v.numtree}}-A4.pdf">A4 PDF</a> <span class="txtMediumGrey">({{v.a4pdf|filesizeformat}})</span></li>{%endif%}
+ {%if v.uspdf%}<li>Comprehensive Manual: <a href="/files/documentation/pdf/{{v.numtree}}/postgresql-{{v.numtree}}-US.pdf">US PDF</a> <span class="txtMediumGrey">({{v.uspdf|filesizeformat}})</span></li>{%endif%}
{%if not v.a4pdf and not v4.uspdf%}<li>PDF version not available</li>{%endif%}
</ul>
</td>
If you see anything in the documentation that is not correct, does not match
your experience with the particular feature or requires further clarification,
please use
-<a href="/account/comments/new/{{page.version.tree}}/{{page.file}}/" rel="nofollow">this form</a>
+<a href="/account/comments/new/{{page.version.numtree}}/{{page.file}}/" rel="nofollow">this form</a>
to report a documentation issue.
</p>
</div>
<tr{%if forloop.last%} class="lastrow"{%endif%}>
<td class="colMid">
<ul>
- <li><a href="/docs/{{v.tree}}/static/index.html">{{v.treestring}}</a></li>
+ <li><a href="/docs/{{v.numtree}}/static/index.html">{{v.treestring}}</a></li>
</ul>
</td>
<td class="colLast">
<ul>
- {%if v.a4pdf%}<li>Comprehensive Manual: <a href="/files/documentation/pdf/{{v.tree}}/postgresql-{{v.tree}}-A4.pdf">A4 PDF</a> <span class="txtMediumGrey">({{v.a4pdf|filesizeformat}})</span></li>{%endif%}
- {%if v.uspdf%}<li>Comprehensive Manual: <a href="/files/documentation/pdf/{{v.tree}}/postgresql-{{v.tree}}-US.pdf">US PDF</a> <span class="txtMediumGrey">({{v.uspdf|filesizeformat}})</span></li>{%endif%}
+ {%if v.a4pdf%}<li>Comprehensive Manual: <a href="/files/documentation/pdf/{{v.numtree}}/postgresql-{{v.numtree}}-A4.pdf">A4 PDF</a> <span class="txtMediumGrey">({{v.a4pdf|filesizeformat}})</span></li>{%endif%}
+ {%if v.uspdf%}<li>Comprehensive Manual: <a href="/files/documentation/pdf/{{v.numtree}}/postgresql-{{v.numtree}}-US.pdf">US PDF</a> <span class="txtMediumGrey">({{v.uspdf|filesizeformat}})</span></li>{%endif%}
</ul>
</td>
</tr>
<h2><img src="/media/img/hdr/hdr_latestreleases.png" width="120" height="10" alt="Latest Releases" /></h2>
<div id="pgFrontLatestReleasesWrap">
{%for v in versions %}
- <b>{{v.tree}}.{{v.latestminor}}</b> · {{v.reldate}} · <a href="/docs/{{v.tree}}/static/{{v.relnotes}}">Notes</a>
+ <b>{{v.numtree}}.{{v.latestminor}}</b> · {{v.reldate}} · <a href="/docs/{{v.numtree}}/static/{{v.relnotes}}">Notes</a>
<br />
{%endfor%}
</div>
{%for v in versions%}
<tr {%if forloop.last%}class="lastrow"{%endif%}>
- <td class="colFirst">{{v.tree}}</td>
- <td class="colMid">{{v.tree}}.{{v.latestminor}}</td>
+ <td class="colFirst">{{v.numtree}}</td>
+ <td class="colMid">{{v.numtree}}.{{v.latestminor}}</td>
<td class="colMid">{{v.supported|yesno:"Yes,No"}}</td>
<td class="colMid">{{v.firstreldate|date:"F Y"}}</td>
<td class="colLast">{{v.eoldate|date:"F Y"}}</td>