Re: Add a custom language for internationalization/localization

2016-07-22 Thread Sonu Kumar
After lots of debug and digging inside local middleware I have fixed this. To solve this I had to add LOCALE_PATH in settings file. On Friday, July 22, 2016 at 6:41:44 PM UTC+5:30, Sonu Kumar wrote: > > Hi there, > I would like to add a custom language to support for i18n. You can che

Add a custom language for internationalization/localization

2016-07-22 Thread Sonu Kumar
Hi there, I would like to add a custom language to support for i18n. You can check my question here http://stackoverflow.com/questions/38511925/add-custom-language-for-localization-in-django-app. I have followed all the steps mentioned here

Re: Implement page view count without using database for Hit

2016-02-08 Thread sonu kumar
Thanks James, We have consider database and updated sites using django-visits. Building such a full proof system will take longer time. Regars, Sonu On Monday, February 8, 2016 at 2:29:46 PM UTC+5:30, James Schneider wrote: > > > On Feb 7, 2016 7:03 PM, "sonu kumar"

Implement page view count without using database for Hit

2016-02-07 Thread sonu kumar
Hi all, We have develop a site where we need to maintain page view count like SO, Quora,YouTube etc. Current approach is based on number of retrieval using view this leads to problem to user that they are seeing that when a page is reloaded then count get's incremented see here

Re: Why counter tag is not working as expected in django?

2016-01-21 Thread sonu kumar
gt; On Wed, Jan 20, 2016 at 8:00 PM, sonu kumar <sonunit...@gmail.com> wrote: > >> SO link: >> http://stackoverflow.com/questions/34894964/why-counter-tag-is-not-working-as-expected-in-django >> >> I am using two for loop one is for main question and another one

Re: Why counter tag is not working as expected in django?

2016-01-20 Thread sonu kumar
than one questions so one outer for loop is running for main question and another one is sub questions. On Thursday, January 21, 2016 at 3:33:42 AM UTC+5:30, James Schneider wrote: > > > > On Wed, Jan 20, 2016 at 6:14 AM, sonu kumar <sonun...@gmail.com > > wrote: > >&

Why counter tag is not working as expected in django?

2016-01-20 Thread sonu kumar
https://djangosnippets.org/snippets/2619/ According to above snippet if we access {{ counter_var }} in template after initializing it should return previous count. But in my case it does not return anything. template code Q{% counter %}. ...var no_of_questions={{ counter_var }} Template

JSON serializer is not working for subset of fields.

2016-01-05 Thread sonu kumar
Models class Country(models.Model): country = CountryField() class City(models.Model): name = models.CharField(max_length=1000) country = models.ForeignKey(Country) country = request.POST['country'] country = get_object_or_404(Country, country=country) cities =

Re: JSON serializer is not working for subset of fields.

2016-01-05 Thread sonu kumar
country = request.POST['country'] country = get_object_or_404(Country, country=country) On Tuesday, January 5, 2016 at 6:02:28 PM UTC+5:30, sonu kumar wrote: > > Models > > class Country(models.Model): > country = CountryField() > > class City(models.Model): >

JSON serializer is not working for subset of fields.

2016-01-05 Thread sonu kumar
Models class Country(models.Model): country = CountryField() class City(models.Model): name = models.CharField(max_length=1000) country = models.ForeignKey(Country) cities = serializers.serialize("json", country.city_set.all(), fields=('name', 'id')) In this it should return

JSON serializers not workinf for some of subset of fields.

2016-01-05 Thread sonu kumar
cities = serializers.serialize("json", country.city_set.all(), fields=('name', 'id')) In this it should JSON object with only name and id field but it returns [{"fields": {"name": "Chennai"}, "model": "job.city", "pk": 1}] where as it should return [{"name": "Chennai", "id": 1}]. How to

Re: Safe tag is working differently for different view.

2015-11-06 Thread sonu kumar
wrote: > > Hello, > > Are you sure they're using the same template? (If you change something > does it actually affect both views?) > > Is one of the views using mark_safe? > > Collin > > On Tuesday, October 27, 2015 at 9:29:02 PM UTC+1, sonu kumar wrote: >> >

Re: Error: The response content must be rendered before it can be accessed.

2015-11-04 Thread sonu kumar
, November 5, 2015 at 2:44:22 AM UTC+5:30, Daniel Roseman wrote: > > On Wednesday, 4 November 2015 20:51:53 UTC, sonu kumar wrote: >> >> class based views are as below >> >> class TagList(TemplateView): >> >> def get_context_data(self, **kwargs

Error: The response content must be rendered before it can be accessed.

2015-11-04 Thread sonu kumar
class based views are as below class TagList(TemplateView): def get_context_data(self, **kwargs): ... qlist = QueList.as_view()(self.request, **kwargs) print qlist ... class QueListView(ListView): def get_context_data(self, **kwargs):

Safe tag is working differently for different view.

2015-10-27 Thread sonu kumar
I am having two views both are extending from same base.html and both of them have loaded same template tags, but one is escaping string using safe and other is not what could be Code view 1 {% extends 'base.html' %} {% load inplace_edit mezzanine_tags rating_tags keyword_tags comment_tags

Overriding template view function in Django app.

2015-10-08 Thread sonu kumar
I have installed third party app(Mezzanine) whose urls are configured to use their view functions not View Class. Source code from mezzanine.blog.urls urlpatterns = patterns("mezzanine.blog.views",16