Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolutize filter #4

Merged
merged 2 commits into from
Jul 30, 2015
Merged

Conversation

selectnull
Copy link
Contributor

I've added absolutize as filter along with template tags. README has been updated with examples and reason why sometimes filter works where tag doesn't.

@acatton
Copy link
Contributor

acatton commented Jul 30, 2015

Good catch @selectnull !

I don't see any reason why absolutize should be tag and not a filter. Could you add a deprecation warning on the tag. We will remove it in the future.

Thanks ;) .

@acatton acatton added this to the v1.2.0 milestone Jul 30, 2015
@selectnull
Copy link
Contributor Author

Actually, I'm against deprecating absolutize as a tag. What's more, I would propose that it be extended to support as tags, eg:

{% absolutize someobject.get_absolute_url as url %}

and then you can use url as variable.

@selectnull
Copy link
Contributor Author

Anyway, it works both as tag and filter, why deprecate it? :)

@acatton acatton merged commit 31289c0 into fusionbox:master Jul 30, 2015
@acatton
Copy link
Contributor

acatton commented Jul 30, 2015

@selectnull The zen of python says There should be one – and preferably only one – obvious way to do it.

  • If you have a tag and a filter, now there are two ways to do the same thing.
  • One of them should go away
  • The filter works everywhere in {% if url|absolutize %} and so on...
  • Why not remove the tag, it doesn't add any value whatsoever?

@acatton
Copy link
Contributor

acatton commented Jul 30, 2015

See e61be2b

@selectnull selectnull deleted the absolutize-filter branch July 31, 2015 12:21
@selectnull
Copy link
Contributor Author

@acatton What about One shall not break backward compatibility when software version is greater than 1

Oh wait, Python 3... ;)

Never mind, since you've already decided, it's ok. When do you plan to upload to pypi?

@acatton
Copy link
Contributor

acatton commented Aug 12, 2015

@selectnull for now can you install from source. We might do a new release within the next month.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants