joestump / django-ajax

A simple framework for creating AJAX endpoints in Django.
http://github.com/joestump/django-ajax
BSD 3-Clause "New" or "Revised" License
260 stars 53 forks source link

allowed to change "pk" by "id", by convenience of developer #22

Closed rmaceissoft closed 12 years ago

rmaceissoft commented 12 years ago

initially, I was using tastypie as backend for ajax calls, and my javascript templates (with mustache), looks like

<script id="article-item" type="text/html">
{{#article}}
<a id="article-{{id}}" href="{{url}}">{{title}}</a>
created at {{date_created}}
{{/article}}
</script>

so, after, I decided migrate to django-ajax, and I want to avoid override all my javascript templates (id by pk), I love to change things with the less amount of modifications as possible.

joestump commented 12 years ago

I'm going to merge this in, but I'm going to change the setting name to be prefixed with AJAX. I doubt yours will collide, but most apps do this and it seems a bit safer.

joestump commented 12 years ago

Added in 43e8fccbc20832ff483ab1a2b9cbee7368cd0df3.

rmaceissoft commented 12 years ago

I'm with you, thanks for having me in mind.