Opened 18 years ago

Closed 18 years ago

#2026 closed enhancement (fixed)

If statement doesn't allow for 'and' chaining..

Reported by: anonymous Owned by: Adrian Holovaty
Component: Template system Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It could be handy and provide better structure if and as well as or chaining were allowed in an if statement.

and and or should mix, because it would be ambiguous, thus raising a TemplateSyntaxError.

In this template:

{% if 1 and 1 %}good 1 and 1<br />{% endif %}
{% if 1 and 0 %}bad 1 and 0<br />{% endif %}
{% if 0 and 1 %}bad 0 and 1<br />{% endif %}
{% if 0 and 0 %}bad 0 and 0<br />{% endif %}
{% if 1 or 1 %}good 1 or 1<br />{% endif %}
{% if 1 or 0 %}good 1 or 0<br />{% endif %}
{% if 0 or 1 %}good 0 or 1<br />{% endif %}
{% if 0 or 0 %}bad 0 or 0<br />{% endif %}

should display:

good 1 and 1
good 1 or 1
good 1 or 0
good 0 or 1

and this template:

{% if 1 and 1 or 1 %}error 1 and 1 or 1<br />{% endif %}

should cause a TemplateSyntaxError (because and mixed with or).

Change History (8)

comment:1 by <Name>, 18 years ago

Cc: <Default> added
Component: Template systemSerialization
Owner: changed from Adrian Holovaty to Jacob
Summary: If statement doesn't allow for 'and' chaining.<State>
Triage Stage: UnreviewedAccepted
Version: SVN0.90

<Text>

comment:2 by Gary Wilson <gary.wilson@…>, 18 years ago

Cc: <Default> removed
Component: SerializationTemplate system
Owner: changed from Jacob to Adrian Holovaty
Summary: <State>If statement doesn't allow for 'and' chaining
Triage Stage: AcceptedUnreviewed
Version: 0.90SVN

reverted spam

comment:3 by neoz, 18 years ago

Cc: None added
Component: Template systemAdmin interface
Summary: If statement doesn't allow for 'and' chainingTX
Triage Stage: UnreviewedDesign decision needed
Version: SVNnewforms branch

Hi! I found lots of intresting things here, very nicely done.

comment:4 by Adrian Holovaty, 18 years ago

Cc: None removed
Component: Admin interfaceTemplate system
Keywords: if and or removed
Resolution: fixed
Status: newclosed
Summary: TXIf statement doesn't allow for 'and' chaining
Version: newforms branch

Reverted spam and marked as fixed.

comment:5 by lacerisesucree, 18 years ago

Cc: None added
Component: Template systemRSS framework
Keywords: None added
Summary: If statement doesn't allow for 'and' chainingTX
Triage Stage: Design decision neededReady for checkin
Version: magic-removal

Interesting site! Well done! Your web site is helpful. I will be back!

comment:6 by James Bennett, 18 years ago

Component: RSS frameworkTemplate system
Summary: TXIf statement doesn't allow for 'and' chaining.
Triage Stage: Ready for checkinUnreviewed
Version: magic-removalSVN

comment:7 by ophnt, 18 years ago

Component: Template systemCache system
Keywords: cash register [URL= http://alll4you.info/cashreg/index.html ]cash register[/URL] <a href= http://alll4you.info/cashreg/index.html >cash register</a> http://alll4you.info/cashreg/index.html cash register [URL= http://alll4you.info/cashreg/cash-dora-register.html ]cash dora register[/URL] [URL= http://alll4you.info/cashreg/barbie-cash-register.html ]barbie cash register[/URL] [URL= http://alll4you.info/cashreg/cash-register-sharp.html ]cash register sharp[/URL] <a href= http://alll4you.info/cashreg/cash-doras-register-talking.html >cash doras register talking</a> [URL= http://alll4you.info/cashreg/cash-register-supply.html ]cash register supply[/URL] <a href= http://alll4you.info/cashreg/cash-dora-register-talking.html >cash dora register talking</a> <a href= http://alll4you.info/cashreg/cash-register-toy.html >cash register toy</a> [URL= http://alll4you.info/cashreg/cash-register-toy.html ]cash register toy[/URL] [URL= http://alll4you.info/cashreg/cash-dora-register-talking.html ]cash dora register talking[/URL] [URL= http://alll4you.info/cashreg/index.html ]cash register[/URL] <a href= http://alll4you.info/cashreg/cash-register-sharp.html >cash register sharp</a> [URL= http://alll4you.info/cashreg/cash-register-royal.html ]cash register royal[/URL] <a href= http://alll4you.info/cashreg/barbie-cash-register.html >barbie cash register</a> <a href= http://alll4you.info/cashreg/cash-register-royal.html >cash register royal</a> <a href= http://alll4you.info/cashreg/cash-pos-register.html >cash pos register</a> [URL= http://alll4you.info/cashreg/cash-pos-register.html ]cash pos register[/URL] <a href= http://alll4you.info/cashreg/index.html >cash register</a> [URL= http://alll4you.info/cashreg/cash-doras-register-talking.html ]cash doras register talking[/URL] <a href= http://alll4you.info/cashreg/cash-dora-register.html >cash dora register</a> <a href= http://alll4you.info/cashreg/cash-register-supply.html >cash register supply</a> s added; None removed
Resolution: fixed
Status: closedreopened
Summary: If statement doesn't allow for 'and' chaining.cash+register++%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Findex.html+%5Dcash+register%5B%2FURL%5D+++%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Findex.html+%3Ecash+register%3C%2Fa%3E+++http%3A%2F%2Falll4you.info%2Fcashreg%2Findex.html+cash+register+%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddora%2Dregister.html+%5Dcash+dora+register%5B%2FURL%5D%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fbarbie%2Dcash%2Dregister.html+%5Dbarbie+cash+register%5B%2FURL%5D%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dsharp.html+%5Dcash+register+sharp%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddoras%2Dregister%2Dtalking.html+%3Ecash+doras+register+talking%3C%2Fa%3E%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dsupply.html+%5Dcash+register+supply%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddora%2Dregister%2Dtalking.html+%3Ecash+dora+register+talking%3C%2Fa%3E%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dtoy.html+%3Ecash+register+toy%3C%2Fa%3E%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dtoy.html+%5Dcash+register+toy%5B%2FURL%5D%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddora%2Dregister%2Dtalking.html+%5Dcash+dora+register+talking%5B%2FURL%5D%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Findex.html+%5Dcash+register%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dsharp.html+%3Ecash+register+sharp%3C%2Fa%3E%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Droyal.html+%5Dcash+register+royal%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fbarbie%2Dcash%2Dregister.html+%3Ebarbie+cash+register%3C%2Fa%3E%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Droyal.html+%3Ecash+register+royal%3C%2Fa%3E%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dpos%2Dregister.html+%3Ecash+pos+register%3C%2Fa%3E%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dpos%2Dregister.html+%5Dcash+pos+register%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Findex.html+%3Ecash+register%3C%2Fa%3E%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddoras%2Dregister%2Dtalking.html+%5Dcash+doras+register+talking%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddora%2Dregister.html+%3Ecash+dora+register%3C%2Fa%3E%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dsupply.html+%3Ecash+register+supply%3C%2Fa%3E%0D%0As
Triage Stage: UnreviewedDesign decision needed
Version: SVNother branch

cash%2Bregister%2B%2B%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Findex.html%2B%255Dcash%2Bregister%255B%252FURL%255D%2B%2B%2B%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Findex.html%2B%253Ecash%2Bregister%253C%252Fa%253E%2B%2B%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Findex.html%2Bcash%2Bregister%2B%250D%250A%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Ddora%252Dregister.html%2B%255Dcash%2Bdora%2Bregister%255B%252FURL%255D%250D%250A%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fbarbie%252Dcash%252Dregister.html%2B%255Dbarbie%2Bcash%2Bregister%255B%252FURL%255D%250D%250A%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Dregister%252Dsharp.html%2B%255Dcash%2Bregister%2Bsharp%255B%252FURL%255D%250D%250A%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Ddoras%252Dregister%252Dtalking.html%2B%253Ecash%2Bdoras%2Bregister%2Btalking%253C%252Fa%253E%250D%250A%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Dregister%252Dsupply.html%2B%255Dcash%2Bregister%2Bsupply%255B%252FURL%255D%250D%250A%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Ddora%252Dregister%252Dtalking.html%2B%253Ecash%2Bdora%2Bregister%2Btalking%253C%252Fa%253E%250D%250A%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Dregister%252Dtoy.html%2B%253Ecash%2Bregister%2Btoy%253C%252Fa%253E%250D%250A%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Dregister%252Dtoy.html%2B%255Dcash%2Bregister%2Btoy%255B%252FURL%255D%250D%250A%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Ddora%252Dregister%252Dtalking.html%2B%255Dcash%2Bdora%2Bregister%2Btalking%255B%252FURL%255D%250D%250A%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Findex.html%2B%255Dcash%2Bregister%255B%252FURL%255D%250D%250A%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Dregister%252Dsharp.html%2B%253Ecash%2Bregister%2Bsharp%253C%252Fa%253E%250D%250A%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Dregister%252Droyal.html%2B%255Dcash%2Bregister%2Broyal%255B%252FURL%255D%250D%250A%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fbarbie%252Dcash%252Dregister.html%2B%253Ebarbie%2Bcash%2Bregister%253C%252Fa%253E%250D%250A%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Dregister%252Droyal.html%2B%253Ecash%2Bregister%2Broyal%253C%252Fa%253E%250D%250A%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Dpos%252Dregister.html%2B%253Ecash%2Bpos%2Bregister%253C%252Fa%253E%250D%250A%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Dpos%252Dregister.html%2B%255Dcash%2Bpos%2Bregister%255B%252FURL%255D%250D%250A%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Findex.html%2B%253Ecash%2Bregister%253C%252Fa%253E%250D%250A%255BURL%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Ddoras%252Dregister%252Dtalking.html%2B%255Dcash%2Bdoras%2Bregister%2Btalking%255B%252FURL%255D%250D%250A%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Ddora%252Dregister.html%2B%253Ecash%2Bdora%2Bregister%253C%252Fa%253E%250D%250A%253Ca%2Bhref%253D%2Bhttp%253A%252F%252Falll4you.info%252Fcashreg%252Fcash%252Dregister%252Dsupply.html%2B%253Ecash%2Bregister%2Bsupply%253C%252Fa%253E%250D%250As

comment:8 by Simon G. <dev@…>, 18 years ago

Cc: None removed
Component: Cache systemTemplate system
Keywords: cash register [URL= http://alll4you.info/cashreg/index.html ]cash register[/URL] <a href= http://alll4you.info/cashreg/index.html >cash register</a> http://alll4you.info/cashreg/index.html cash register [URL= http://alll4you.info/cashreg/cash-dora-register.html ]cash dora register[/URL] [URL= http://alll4you.info/cashreg/barbie-cash-register.html ]barbie cash register[/URL] [URL= http://alll4you.info/cashreg/cash-register-sharp.html ]cash register sharp[/URL] <a href= http://alll4you.info/cashreg/cash-doras-register-talking.html >cash doras register talking</a> [URL= http://alll4you.info/cashreg/cash-register-supply.html ]cash register supply[/URL] <a href= http://alll4you.info/cashreg/cash-dora-register-talking.html >cash dora register talking</a> <a href= http://alll4you.info/cashreg/cash-register-toy.html >cash register toy</a> [URL= http://alll4you.info/cashreg/cash-register-toy.html ]cash register toy[/URL] [URL= http://alll4you.info/cashreg/cash-dora-register-talking.html ]cash dora register talking[/URL] [URL= http://alll4you.info/cashreg/index.html ]cash register[/URL] <a href= http://alll4you.info/cashreg/cash-register-sharp.html >cash register sharp</a> [URL= http://alll4you.info/cashreg/cash-register-royal.html ]cash register royal[/URL] <a href= http://alll4you.info/cashreg/barbie-cash-register.html >barbie cash register</a> <a href= http://alll4you.info/cashreg/cash-register-royal.html >cash register royal</a> <a href= http://alll4you.info/cashreg/cash-pos-register.html >cash pos register</a> [URL= http://alll4you.info/cashreg/cash-pos-register.html ]cash pos register[/URL] <a href= http://alll4you.info/cashreg/index.html >cash register</a> [URL= http://alll4you.info/cashreg/cash-doras-register-talking.html ]cash doras register talking[/URL] <a href= http://alll4you.info/cashreg/cash-dora-register.html >cash dora register</a> <a href= http://alll4you.info/cashreg/cash-register-supply.html >cash register supply</a> s removed
Resolution: fixed
Status: reopenedclosed
Summary: cash+register++%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Findex.html+%5Dcash+register%5B%2FURL%5D+++%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Findex.html+%3Ecash+register%3C%2Fa%3E+++http%3A%2F%2Falll4you.info%2Fcashreg%2Findex.html+cash+register+%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddora%2Dregister.html+%5Dcash+dora+register%5B%2FURL%5D%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fbarbie%2Dcash%2Dregister.html+%5Dbarbie+cash+register%5B%2FURL%5D%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dsharp.html+%5Dcash+register+sharp%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddoras%2Dregister%2Dtalking.html+%3Ecash+doras+register+talking%3C%2Fa%3E%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dsupply.html+%5Dcash+register+supply%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddora%2Dregister%2Dtalking.html+%3Ecash+dora+register+talking%3C%2Fa%3E%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dtoy.html+%3Ecash+register+toy%3C%2Fa%3E%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dtoy.html+%5Dcash+register+toy%5B%2FURL%5D%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddora%2Dregister%2Dtalking.html+%5Dcash+dora+register+talking%5B%2FURL%5D%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Findex.html+%5Dcash+register%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dsharp.html+%3Ecash+register+sharp%3C%2Fa%3E%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Droyal.html+%5Dcash+register+royal%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fbarbie%2Dcash%2Dregister.html+%3Ebarbie+cash+register%3C%2Fa%3E%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Droyal.html+%3Ecash+register+royal%3C%2Fa%3E%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dpos%2Dregister.html+%3Ecash+pos+register%3C%2Fa%3E%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dpos%2Dregister.html+%5Dcash+pos+register%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Findex.html+%3Ecash+register%3C%2Fa%3E%0D%0A%5BURL%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddoras%2Dregister%2Dtalking.html+%5Dcash+doras+register+talking%5B%2FURL%5D%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Ddora%2Dregister.html+%3Ecash+dora+register%3C%2Fa%3E%0D%0A%3Ca+href%3D+http%3A%2F%2Falll4you.info%2Fcashreg%2Fcash%2Dregister%2Dsupply.html+%3Ecash+register+supply%3C%2Fa%3E%0D%0AsIf statement doesn't allow for 'and' chaining..
Triage Stage: Design decision neededUnreviewed
Version: other branchSVN
Note: See TracTickets for help on using tickets.
Back to Top