Outputing an integer value in a template, but with some calculation done on it

2009-09-03 Thread Neeraj
Hello people. This may seem like a very simple question, and for that I apologize. I am trying to output a variable page_no to a template, but I want to output page_no + 1 and page_no - 1. How do I do that? I tried to do something like {{ page_no + 1 }} and that failed. Tried {% and %} as well, b

Serializing with not just the query data but also some additional columns

2009-09-03 Thread Neeraj
Hello. I am trying to serialize a queryset but for each row I want supplementary data that is appropriate to the context I am doing the serialization in. I might want to add a column to each row in one situation which is some calculate value, etc, etc, etc. It seems that serialization only really

Re: wbd

2021-11-07 Thread Neeraj pal
Yes ofcourse On Sun, Nov 7, 2021, 7:30 PM Henry Ji wrote: > > I am a beginner too! > On Friday, October 29, 2021 at 12:37:09 AM UTC+8 emmanueltwi...@gmail.com > wrote: > >> hello everyone,I'm the beginner to use django can you teach me >> > -- > You received this message because you are subscrib

Issues with validation

2012-09-18 Thread neeraj dhiman
I am using two models in my app and different form for each model, when I tried to validate these two forms , one model is validated but other is not. model.py from django.db import models from django.contrib.auth.models import User class Customer(models.Model): user

Issues with validation of multiple forms

2012-09-18 Thread neeraj dhiman
I am using two models in my app and different form for each model, when I tried to validate these two forms , one model is validated but other is not. model.py from django.db import models from django.contrib.auth.models import User class Customer(models.Model): user

Re: Django MPTT Admin

2014-11-11 Thread Neeraj Sharma
*How to use Django Mttp Admin as an Inline in admin.py* *?* On Thursday, 26 February 2009 15:12:15 UTC+5:30, Matthias Kestenholz wrote: > > Hey, > > A topic which comes up on this list from time to time is an automatic > admin interface for django-mptt. I'd like to advertise a piece of code > we h

Re: Django MPTT Admin

2014-11-11 Thread Neeraj Sharma
Thanx for your quick response Matthias Kestenholz, but i actually i want to use MPTT Admin as an inline form, code you have written will work as a normal admin. On Thursday, 26 February 2009 15:12:15 UTC+5:30, Matthias Kestenholz wrote: > > Hey, > > A topic which comes up on this list from time

Re: Django MPTT Admin

2014-11-11 Thread Neeraj Sharma
Thanx for your quick response Matthias Kestenholz, but i actually i want to use MPTT Admin as an inline form, code you have written will work as a normal admin form On Thursday, 26 February 2009 15:12:15 UTC+5:30, Matthias Kestenholz wrote: > > Hey, > > A topic which comes up on this list from t

override django mptt admin querset

2014-11-18 Thread Neeraj Sharma
Hi, I want to override django mptt admin queryset, i want to filter the the queryset. I also tried the following method in admin.py but its not working. def queryset(self, request): qs = super(DataField_NEWAdmin, self).queryset(request) qs.filter(game_event__id=request.GET.get

Ovreeride django mptt admin queryset

2014-11-18 Thread Neeraj Sharma
Hi, I want to override django mptt admin queryset, i want to filter the the queryset. I also tried the following method in admin.py but its not working. def queryset(self, request): qs = super(DataField_NEWAdmin, self).queryset(request) return qs.filter(game_event__id=10)

Override Django Mptt Admin Queryset

2014-11-18 Thread Neeraj Sharma
Hi, I want to override django mptt admin queryset, i want to filter the the queryset. I also tried the following method in admin.py but its not working. def queryset(self, request): qs = super(DataField_NEWAdmin, self).queryset(request) return qs.filter(game_event__id=10)

Re: Django API CSRF Issues - Need Help

2016-06-01 Thread Neeraj Gahlot
Hi Chris, You will have to pass csrf token in http request header while making request using AJAX This can be done by adding following prior to your ajax request. var csrftoken = $.cookie('csrftoken'); $.ajaxSetup({ headers: { "X-CSRFToken": csrftoken } }); On Saturday, May 21, 2016 at 7:06:

Django Memcached Session Management

2019-03-04 Thread NEERAJ KUMAR
wo Django applications(DRF) are running on two separate ports 8001 and 8000 with same host localhost. I am using memcached to store the sessions. Both the application share the sessions from the memcache. when i try to access pages using second application after logining in using first I am get

I am having trouble finding any example of setting a task_id with my own task_id

2019-04-10 Thread inet . neeraj
def testview1(request): for i in xrange(0,1000): result = add.delay( i, 4,task_id = i) print result.task_id #i want to display here i value return HttpResponse("Done") @task()def add(task_id, x, y): print add.task_id print str(x+y) return x + y -- Y

Re: field for html

2020-08-03 Thread neeraj garg
nd an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CACMwF3VTKYF3Zjm9fQMFwtjvxYXdsUA1JV6mXFTrD0XBW5bDdw%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CACMwF3VTKYF3Zjm9fQMFwtjvxYXd

Re: Problem in user creation

2020-08-04 Thread neeraj garg
You could use django signals which will keep the models in sync. On Tue, Aug 4, 2020, 9:16 PM sonam pankaj wrote: > > > Hi, > there is a problem when doing profile model using contrib.auth , > sometimes profile is created without user so they went out of sync. How to > make sure

Re: Python-django project

2020-08-05 Thread neeraj garg
Hi Guys, Could you please give me a clue what kind of project you are planning to build? On Wed, Aug 5, 2020, 8:23 PM jhabar singh wrote: > Sapna, Can you tell me something about your project? > > On Wed 5 Aug, 2020, 5:22 PM yammunap...@gmail.com, > wrote: > >> Dear I am interested to join wit

Re: Security issue in django.db.models

2020-08-07 Thread neeraj garg
It basically sets a null value i.e. "" for the fields that you don't pass while creating an object in shell. And "" it acceptable value. If you want to restrict "" then add some validations. On Fri, Aug 7, 2020, 5:16 PM Juan D. wrote: > I've created a model with null and blank set to False in ro

Re: Dynamic Serial Number

2020-08-15 Thread neeraj garg
You can put loop counter. On Sun, Aug 16, 2020, 9:29 AM kushal@gmail.com wrote: > Greeting all, I want to put Serial Number instead of ID. How can i make > dynamic SN in view. Thanks. > > [image: Capture.PNG] > > -- > You received this message because you are subscribed to the Google Groups

Django User authentication OR Custom Model For the Situation

2020-11-23 Thread Neeraj Rana
I am trying to create two different types of users, prime and one prime with that it also consist of email verification and custom username. Now, my question is should I use the user auth model, and django.forms and extend the form for email, phone no or should i build a completely new model and

Re: Django User authentication OR Custom Model For the Situation

2020-11-23 Thread Neeraj Rana
/cons of the different > approaches to your problem. > > On Mon, 23 Nov 2020 at 08:41, Neeraj Rana > wrote: > >> I am trying to create two different types of users, prime and one prime >> with that it also consist of email verification and custom username. >> Now, my ques