migration problem from Django0.96 to Django1.0

2008-09-13 Thread vijay
27;WEEKDAYS_ABBR' is not defined Is there any patch available for this? How can i get rid of this problem? Thanks & regards, Vijay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Unable to process my form

2011-03-03 Thread Vijay
Hi All, I am new to django.I am practicing Django using the book "The Definitive Guide to Django" by Jacob and Adrian.I have installed Django on Ubuntu.I tried to process HTML form as directed in that book,then i am getting the following error.Please suggest me a solution for this. Enviro

Training at Hyderabd

2011-03-04 Thread Vijay
Hi All, If anybody belongs to Hyderabad.Can you please provide me training on Dajngo framework.Or atleast guide me. Regards Vijay -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: Unable to process my form

2011-03-04 Thread vijay
Hi Silvio, Still i am getting TemplateDoesNotFound error.Please suggest me Regards Vijay On Thu, Mar 3, 2011 at 6:41 PM, Silvio wrote: > You don't want to pass an absolute path to render_to_response. You > want to pass a relative path. Right now you're pas

TemplateDoesNotExist

2011-03-13 Thread Vijay
When i am practicing Django in chapter 7(forms), I am getting 'TemplateDoesNotExist' error.Here's the error details TemplateDoesNotExist at /search-form/ search_form.html Request Method: GET Request URL:http://127.0.0.1:8000/search-form/ Django Version: 1.2.5 Exception Type:

Re: TemplateDoesNotExist

2011-03-13 Thread vijay
Windows. # Don't forget to use absolute paths, not relative paths. ) Vijay On Sun, Mar 13, 2011 at 5:23 AM, gladys wrote: > Make sure that the TEMPLATE_DIRS is set in your settings.py if you are > putting your templates in a folder other than your_app/templates. > > --

Re: TemplateDoesNotExist

2011-03-13 Thread vijay
Thanks Gladys.Problem solved.Once again thank you so much for quick reply vijay On Sun, Mar 13, 2011 at 5:45 AM, Daniel Roseman wrote: > On Sunday, March 13, 2011 8:40:06 AM UTC-4, Vijay wrote: >> >> Hi Gladys, >> Thanks for quick reply. >> Following content is th

Re: docs.djangoproject.com may be down!

2011-03-15 Thread vijay
Yes,I am also not able access On Tue, Mar 15, 2011 at 11:42 AM, Nathanael Abbotts wrote: > I cannot access http://docs.djangoproject.com/ can anyone else? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email

Re: docs.djangoproject.com may be down!

2011-03-15 Thread vijay
It's working On Tue, Mar 15, 2011 at 11:43 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Confirmed down. > > > On Tue, Mar 15, 2011 at 6:42 PM, Nathanael Abbotts > wrote: > >> I cannot access http://docs.djangoproject.com/ can anyone else? >> >> -- >> Yo

Re: migration problem from Django0.96 to Django1.0

2008-09-14 Thread vijay bhaskar
Hi karen,Thanks for your reply.but the problem is ,there is no definition for WEEK_ABBR in the django.utils.dates.That's the reason its throwing error.How can i get rid of this? Thanks & regards Vijay On Sat, Sep 13, 2008 at 5:39 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: &

Re: migration problem from Django0.96 to Django1.0

2008-09-14 Thread vijay bhaskar
I solved that problem. On Mon, Sep 15, 2008 at 11:09 AM, vijay bhaskar <[EMAIL PROTECTED]> wrote: > > > On Mon, Sep 15, 2008 at 11:07 AM, vijay bhaskar <[EMAIL PROTECTED]> wrote: > >> Hi karen,Thanks for your reply.but the problem is ,there is no definiti

Re: migration problem from Django0.96 to Django1.0

2008-09-25 Thread vijay bhaskar
Hi karen, sorry for the delay,i did not notice this mail.To solve this issue, i have taken the WEEKDAYS_ABBR code from the trunk and added in the django.utils.dates file. Regards & Thank you, Vijay. On Mon, Sep 15, 2008 at 8:09 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Mon,

Django test case execution problem

2009-07-28 Thread vijay kumar
tried to follow this link for the same http://docs.djangoproject.com/en/dev/topics/testing/ with thanks Vijay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Django test case execution problem

2009-07-28 Thread vijay kumar
Hello Karen, Thanks for the correcting my mistake. On Jul 28, 6:27 pm, Karen Tracey wrote: > On Tue, Jul 28, 2009 at 9:11 AM, vijay kumar wrote: > > > Hi, > > >   I am running testcase from django when I run them from models.py it > > run. > &g

Re: Django model register for admin section

2009-08-18 Thread vijay kumar
Hi, I tried it but ended up with some problem . Let me try it once again with Thanks Ajay On Tue, Aug 18, 2009 at 1:59 PM, Alex Gaynor wrote: > > On Tue, Aug 18, 2009 at 3:28 AM, ajay wrote: > > > > Hi , > > To register model in admin section we need to Register individual > > class > >

Re: Need help in User log in, someone please help

2022-02-22 Thread vijay chourey
Hi Raj, Error is showing due to the blank value in user name, please try to print username before registration if it's blank please check form fields. Once done you can directly login your account with "auth.login(request,user) On Wed, 23 Feb, 2022, 12:22 pm Antonis Christofides, < anto...@ant

Re: Help to implement custome user login

2022-08-05 Thread vijay chourey
Even you can extend your user modle and can store your extra fields and OTP verification field. It's posible to change your email to phone based login. On Fri, 5 Aug, 2022, 7:29 pm Rinki Prasad, wrote: > Hi team , > Actually i want to implement custom model in Django Like i want that the > user

Re: Why do we need Django rest framework when our conventional django do what we want?

2022-08-26 Thread Vj Vijay
Api can make your website versatilewhat I mean by that is that your website can communicate with all type of users easily with the help of API almost most of the production ready applications front end and backend are built seperately so you need API to communicate On Fri, Aug 26, 2022, 8:48

Re: ModuleNotFoundError: No module named 'tutorial.quickstart'

2022-09-03 Thread Vj Vijay
It should be from tutorial import views On Fri, Sep 2, 2022, 12:51 PM Pooja Kumari wrote: > Hello team, > please help me with this error. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving

Unable to migrate Django migration using docker container.

2022-09-26 Thread Vijay Arora
migrations then last container overwrite the old migrations. Thank you Vijay A. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-user

passing '&' in url

2012-02-28 Thread vijay shanker
i need to pass " & " as query e.g q=larsen & turbo urlencode does not works as finally its as good as without it for above eg. please suggest. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@goog

is doing text manipulations in django-template fater than doing same in views

2012-03-29 Thread vijay shanker
i have to do basic text manipulations at times .. which is a better way.. to do so in template or return a result only after doing so from views ?? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users

is doing text manipulations in django's template faster than doing same in views

2012-03-29 Thread vijay shanker
which one is faster or considered better in terms of performance ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+un

two versions of django onsame machine .. django and django-norel

2012-05-16 Thread vijay shanker
i have installed django 1.4 previously and want to install django- norel now.. should i unisntall django 1.4 first .. is it necessary -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.

sqlall fails silently

2012-05-31 Thread vijay shanker
hi i defined three models and put them in /appname/models/ a.py, b.py, c.py. and a __init__.py in which i import all classes defined inside a.py/b.py/c.py. when i try to do a ./manage.py sqll appname at prompt , it simply passes of without any output. what could be possibly done to debug it .. i

App inside another app or nesting in django apps

2012-05-31 Thread vijay shanker
can we write one app inside some another django-app . please suggest any reference or articles -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, se

limit number of related instance for m2m field in django-admin

2012-06-07 Thread vijay shanker
hi is there any way to limit the number of instances that can be attached to a m2m field. e.g author = models.manytomany(Book) i want to limit the max number of book objects that can be attached to author. How to go about this. -- You received this message because you are subscribed to the Googl

how to have a foreign key to a field of same model which in turn is foreign key to another model ..

2012-06-07 Thread vijay shanker
hi how can i have this: client_groups = models.ForeignKey(User, to_field="groups") it din worked -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group,

Re: limit number of related instance for m2m field in django-admin

2012-06-08 Thread vijay shanker
ave very limited experience customizing the Admin application and > have only used this method through a normal Form. > > > > > > > > On Thu, Jun 7, 2012 at 7:56 AM, vijay shanker wrote: > > hi > > is there any way to limit the number of instances that can be a

m2m_changed signal can not distinguish between existing and newly added instances

2012-06-08 Thread vijay shanker
hi i have this model Client_Order i want to do some manipulation each time a new pakg is added to this field. i used m2m_changed signal, but it cant distinguish between existing instances attached and the newly added ones. both post_add and pre_add show the same number of instances .. i.e if a.b w

how to exclude some field from BaseInlineFormSet

2012-06-12 Thread vijay shanker
hi i am trying to do this: class PakageInfoForm(BaseInlineFormSet): class Meta: model = PakageInfo exclude = ['client_sda',] this doesn works .. how to exclude any field from BaseInlineFormSet .. -- You received this message because you are subscribed to the Google Groups "Dj

advantages and disadvantages of Raw sql queries in django

2012-06-29 Thread vijay shanker
hi i want to know pros and cons associated with running raw sql queries over django's ORM . googled it out but couldn find many useful links. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googl

Reverse for 'app_list' with arguments '()' and keyword arguments '{'app_label': ''}' not found.

2012-09-08 Thread vijay shanker
hi i tried overriding change_form to add a extra button along side history button in django admin section.. on local machine it works fine but on server it gives me this error. I have no clear idea what went wrong and how to fix it . Environment: Request Method: GET Request URL: http://108.16

Reverse for 'app_list' with arguments '()' and keyword arguments '{'app_label': ''}' not found.

2012-09-08 Thread vijay shanker
hi i have this model called charity ___ from django.db import models from settings import DEFAULT_CHARITY_NAME as deafult_charity_name class GetDefaultInstance(models.Manager): def get_default_instance(self): return super(Charity,self).get_quer

Re: Class Views

2011-10-06 Thread Vijay Khemlani
It should be "render_to_response", not "render_to_reponse", a spelling problem maybe? On Thu, Oct 6, 2011 at 12:53 PM, CrabbyPete wrote: > I have the following class defined > > class TeamView(TemplateResponseMixin, View): >template_name = 'team.html' > >def get(self, request): >

Facebook Authentication: Client side vs. Server side

2011-10-18 Thread Vijay Khemlani
Hello, I'm just starting with a project that requires users to be able to authenticate directly using their Facebook accounts. I know this is an old problem, but I noticed there are two quite distinct ways to solve it, and I wanted to ask for the group's opinion 1. Using FB JavaScript SDK ==

Django ForeignKey versus ManyToManyField

2013-02-05 Thread vijay shanker
Hi I have two models, a Customer model and a WishListItem model (which stores products). I have option of either having a ManyToManyField in Customer to WishListItem, or I can have a customer ForeignKey to customer for each WishListItem. Which one will be more efficient ? Thanks -- You recei

Is there any way to stop foreignkey being attached to a django model depending upon some constraint ?

2013-02-07 Thread vijay shanker
Hi I have these two models Cart and CartItem, class Cart(models.Model): cart_id = models.CharField(max_length=50, null=False) customer= models.ForeignKey(Customer,null=True,blank=True) cartitems = models.ManyToManyField(CartItem,null=True) applied_

Is there any way to apply a constraint on ForeignKey/OneToOneField being attached to any model based on some condition ?

2013-02-07 Thread vijay shanker
Hi I have these two models Cart and CartItem, class Cart(models.Model): cart_id = models.CharField(max_length= 50, null=False) customer= models.ForeignKey(Customer,null=True,blank=True) cartitems = models.ManyToManyField(CartItem,null=True) applied

Re: m2m_changed signal can not distinguish between existing and newly added instances

2013-02-07 Thread vijay shanker
er*the relation is cleared. m2m_changed calls the handle_something function with different kwargs['action'] value which can help you differentiate between them. On Friday, June 8, 2012 7:24:34 PM UTC+5:30, vijay shanker wrote: > > hi > i have this model Client_Order &

post_save signal handler gets called twice !

2013-02-07 Thread vijay shanker
Hi I am using django version 1.4.3 I am using two signals in my models.py one is m2m_changed, so i can have a counter field (numcounter) of number of m2m fields attached, and another is post_save so i can decide whether to have a OneToOneField (cartrule, is to be applied only if there are more t

post_save signal getting called twice !

2013-02-07 Thread vijay shanker
Hi I am using django version 1.4.3 I am using two signals in my models.py one is m2m_changed, so i can have a counter field (numcounter) of number of m2m fields attached, and another is post_save so i can decide whether to have a OneToOneField (cartrule, is to be applied only if there are more t

Re: post_save signal getting called twice !

2013-02-07 Thread vijay shanker
Thanks Evans.That was helpful. :) On Thursday, February 7, 2013 7:54:36 PM UTC+5:30, Tom Evans wrote: > > On Thu, Feb 7, 2013 at 1:54 PM, vijay shanker > > > wrote: > > Hi > > I am using django version 1.4.3 > > I am using two signals in my models.py > &

Re: post_save signal getting called twice !

2013-02-08 Thread vijay shanker
further, i tried putting a sender argument in receiver, but the sender , i found (by set_trace) is Cart_cartitems, how can i import this when its only a intermediary model that django's creating. On Friday, February 8, 2013 11:26:47 AM UTC+5:30, vijay shanker wrote: > > Thanks Eva

Re: Any good books for learning django?

2013-02-08 Thread vijay shanker
do u have the pdf ? will u share it at some place (or please mail it to me deont...@gmail.com) On Thursday, February 7, 2013 11:40:01 PM UTC+5:30, Mayukh Mukherjee wrote: > > I'd recommend two scoops of django. > It's a little more intermediate level but it's a gem. > > Sent from my iPhone > > On

Re: Set db connections manually for each request.

2013-02-08 Thread vijay shanker
write a custom manager and use it whenever you want to do use other database: https://docs.djangoproject.com/en/1.3/topics/db/multi-db/#using-get-query-set-with-multiple-databases On Thursday, February 7, 2013 7:08:40 PM UTC+5:30, girishms wrote: > > Hi All, > Is it possible to set db connectio

Re: Is there any way to apply a constraint on ForeignKey/OneToOneField being attached to any model based on some condition ?

2013-02-08 Thread vijay shanker
handled the case there itself thanks tran. :) On Thursday, February 7, 2013 2:33:46 PM UTC+5:30, Huu Da Tran wrote: > > You could overwrite the save() method... or if you are populating from a > form, overwrite the clean() method. > > On Thursday, February 7, 2013 3:23:54 AM UTC-5

Re: post_save signal getting called twice !

2013-02-08 Thread vijay shanker
yes that was it. thanks a ton. ;) On Friday, February 8, 2013 5:21:19 PM UTC+5:30, Martin J. Laubach wrote: > > further, i tried putting a sender argument in receiver, but the sender , i >> found (by set_trace) is Cart_cartitems, how can i import this > 'shoppingcart.models.Cart_cartitems'> when

Re: delete obsolete content type entries...

2013-02-10 Thread vijay shanker
we can delete all obsolete ContentType entries manually. >>>for each in ContentType.objects.filter(app_label=appname): each.delete() thanks On Friday, May 4, 2007 8:42:51 PM UTC+5:30, Jens Diemer wrote: > > > I have delete some app models. So, in the internal django tables > "django_content_type

change select choices in django admin on select of another field

2013-02-11 Thread vijay shanker
Hi I have a model called Place, which is like this: class Place(models.Model): state = models.CharField(max_lengh=50, choices=STATE_CHOICES) city = models.Charfield(max_length=50) I want to populate select choices for repective city for state in admin, when the user selects t

A small bug for dynamic choices

2013-02-11 Thread vijay shanker
hi i wrote a function for producing tuples of all model names, which is this: from django.contrib.contenttypes.models import ContentType from django.db.models.loading import get_model def get_all_models(): return tuple([(each.__module__+'.'+each.__name__,each.__name__) for each in [each.mode

Re: A small bug for dynamic choices

2013-02-11 Thread vijay shanker
pening. On Monday, February 11, 2013 4:29:44 PM UTC+5:30, vijay shanker wrote: > > hi > i wrote a function for producing tuples of all model names, which is this: > from django.contrib.contenttypes.models import ContentType > from django.db.models.loading import get_model > >

ContentType's model_class is NoneType

2013-02-11 Thread vijay shanker
Hi I have few models in a app called shoppingcart. I can find contenttypes associated with this model with this: >>>ct = ContentType.objects.filter(app_label='shoppingcart') >>>ct [, , , ] but when i try ct[0].model_class() it returns the model class on shell but gives me a NoneType when i try

Re: Any good books for learning django?

2013-02-11 Thread vijay shanker
yes u right .. my bad On Friday, February 8, 2013 6:28:20 PM UTC+5:30, Tom Evans wrote: > > On Fri, Feb 8, 2013 at 10:13 AM, vijay shanker > > > wrote: > > do u have the pdf ? > > will u share it at some place (or please mail it to me > > deon...@gmail.com)

Re: Any good books for learning django?

2013-02-11 Thread vijay shanker
d you a free copy. Drop us a note at and >>> we'll get it to you within 72 hours. >>> >> Best regards, >> >> W. >> >> Dne pátek, 8. února 2013 11:13:11 UTC+1 vijay shanker napsal(a): >>> >>> do u have the pdf ? >>>

Re: Modelform and Ajax (Select a valid choice..... Error)

2013-02-12 Thread vijay shanker
hey siddhartha i have similar problem, i created dynamic option with ajax calls and getting the same error "select a valid choice. xyz is not available choices , how did you solved it?" On Tuesday, December 11, 2012 5:09:48 PM UTC+5:30, siddharth56660 wrote: > > Hi, > > I am facing problem in h

Chained Select Boxes using SimpleJson Call

2013-02-12 Thread vijay shanker
hey all I have a model which is as such: *in models.py* class ConditionSet(models.Model): model_name =models.CharField(max_length=50) model_attribute =models.CharField(max_length=50) operator =models.CharField(max_length=50, choices=OPERATORS) val

chained selectboxes with simpleJson call

2013-02-12 Thread vijay shanker
hey all I have a model which is as such: *in models.py* class ConditionSet(models.Model): model_name =models.CharField(max_length= 50) model_attribute =models.CharField(max_length=50) operator =models.CharField(max_length=50, choices=OPERATORS) val

Re: chained selectboxes with simpleJson call

2013-02-12 Thread vijay shanker
super(ConditionSetAdminForm,self).clean() if 'model_attribute' in self._errors: self.cleaned_data['model_attribute'] = self.data['model_attribute'] del self._errors['model_attribute'] return self.cleaned_data jus

Re: A small bug for dynamic choices

2013-02-14 Thread vijay shanker
code is getting executed when Django validates it's models. Hence, Cartprobably has not been validated yet and it's model class is None. On Monday, February 11, 2013 4:29:44 PM UTC+5:30, vijay shanker wrote: > > hi > i wrote a function for producing tuples of all model n

Django Shopping Cart

2013-02-27 Thread vijay shanker
hey, i want to write a shopping cart app, please provide some inputs, useful information, suggestions etc for doing it right . thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from

error and django forms

2013-04-21 Thread vijay shanker
hi i have a django form like this: class AddArtistForm(forms.Form): fname = forms.CharField() lname = forms.CharField() profession = forms.CharField() dob = forms.DateField() i want to display errors as this {% for field in form %} {{field}} # error associated with ab

Re: error and django forms

2013-04-21 Thread vijay shanker
On Sunday, April 21, 2013 10:58:47 PM UTC+5:30, vijay shanker wrote: > > hi > > i have a django form like this: > > class AddArtistForm(forms.Form): > fname = forms.CharField() > lname = forms.CharField() > profession = forms.CharField() > dob = f

Re: error and django forms

2013-04-21 Thread Vijay Shanker
yess that does it. thanks On Sun, Apr 21, 2013 at 11:57 PM, vijay shanker wrote: > > > On Sunday, April 21, 2013 10:58:47 PM UTC+5:30, vijay shanker wrote: >> >> hi >> >> i have a django form like this: >> >> class AddArtistForm(forms.Form):

Re: forloop breaking

2013-06-26 Thread vijay shanker
You are looking for "break" On Wednesday, June 26, 2013 8:39:58 PM UTC+5:30, Harjot Mann wrote: > > What are the methods to break forloop? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emai

Issue in User authentication

2013-07-04 Thread vijay shanker
}} Logout {% else %} Login Signup {% endif %} *the problem i am facing are:* * * *1. when the user signs up, password stored are not encrypted, ( though i am overriding save() to do so above)* *2. though i provide correct password, request.user.is_authenticated doe

Re: Issue in User authentication

2013-07-06 Thread vijay shanker
On Thursday, July 4, 2013 11:30:06 PM UTC+5:30, vijay shanker wrote: > > *Hi* > *I am using django 1.5 and created my own user model by AUTH_USER_MODEL= > 'account.User' in settings.* > > *my user model is like this:* > > from django.db import models > f

Django-Ajax Issue

2013-07-14 Thread vijay shanker
Hey all I am trying to make a simple ajax call to show items retrieved from database. I am displaying bunch of fields like a text input for keyword and radio button for filter in a form like this: {% csrf_token %} Search

FormView and django-formset Issue

2013-09-13 Thread vijay shanker
Hi i used formsets in generic FormView like this: class RequestRecommendationView(FormView): template_name = "account/stepfour.html" form_class = formset_factory(StepFourForm) def form_valid(self,form): print form.is_valid() cleaned_data = form.cleaned_data # r

Re: Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Vijay Katam
Seems legit to me. Some documentation could help get more usage. On Tuesday, September 24, 2013 12:59:27 PM UTC-5, Warren Smith wrote: > > On occasion, I've used the following technique in my django templates: > > # parent.html > > {% block someblock %} > …stuff… > {% if cool_optional_feature_i

Re: Seeking reviewers for a "Guide to Idiomatic Django Deployment"

2013-11-05 Thread Vijay Khemlani
Wouldn't it be better to publish the book the same way as the Django Book ( http://www.djangobook.com/, https://github.com/jacobian/djangobook.com) instead of looking for private reviewers? On Tue, Nov 5, 2013 at 9:34 PM, George London wrote: > Hi All! > > As a fairly recently self-taught Django

Re: New data field in models.py "does not exist".

2015-01-12 Thread Vijay Khemlani
u should also try running syncdb again. It should be an idempotent >> operation, assuming that you haven't made any other changes to your model >> code, so you can run it as many times as you want. >> >> -James >> On Jan 12, 2015 11:40 AM, "Vijay Khemlani"

Re: filter

2015-01-15 Thread Vijay Khemlani
in your view new_leave and a are QuerySet objects, and then you are comparing them to a string ("True") not a bolean (True without quotes), so it's always False. Even if you change "True" to True it won't work, try it like this if new_leave.exists() and a.exists(): return ... On Thu, Jan 15,

Re: filter

2015-01-15 Thread Vijay Khemlani
} > {{a.authorization_date}} > > > {%endfor%} > > > > > view.py > > > def FMKD1_leave_to_authorize(request): > new_leave > =newleave.objects.filter(department_head_authorization="Approved" ) > new_leave = newleave.objects.filter(department=

Re: How to check appname via Django commands?

2015-01-17 Thread Vijay Khemlani
What problem are you having exactly? Also I'm not sure what do you mean by "hierarchy" of the project folders, do you mean the order the apps appear in the INSTALLED_APPS setting? On Sat, Jan 17, 2015 at 6:38 AM, Sugita Shinsuke wrote: > Hi there. > > I use Django 1.6 version. > > The database

Re: Using jquery ajax POST method with django

2015-01-17 Thread Vijay Khemlani
Maybe it's triggering the CSRF validation? What error message are you getting exactly from the server? On Sat, Jan 17, 2015 at 10:37 AM, Erwin Sprengers wrote: > Hello, > > POST works fine for me, I use the following django code : > > at the end of the view : > > return HttpResponse(simplejson.

Re: Best way to test handle optional FKs in model __str__?

2015-01-17 Thread Vijay Khemlani
I don't think there is a way in Python to do that directly you could have a utility method that catches the exception, for example def get_fk_field(obj, fk_field): try: return getattr(obj, fk_field) except AttributeError: return None so that your call would be return _(u

Re: How to subclass django-contact-form to create custom contact form?

2015-01-19 Thread Vijay Khemlani
Right now the "reportForm" variable is pointing to the RequestForm class, not to an object, so you need to do it like this reportForm = ReportForm()# Take note of the parenthesis In your template, your form tag need an action attribute (well, it's not mandatory but it is highly advised). In t

Re: How to subclass django-contact-form to create custom contact form?

2015-01-19 Thread Vijay Khemlani
OK, I read a little of the library documentation, and this is what you have to do I think 1. subclass the ContactForm (you already have that) 2. subclass the ContactFormView from the library, at least with this: class ReportFormView(ContactFormView): form_class = ReportForm 3. Map this view

Re: Desperately need Django help!

2015-01-19 Thread Vijay Khemlani
For single page applications I highly recommend this tutorial, it answers the typical questions regarding single page apps. https://thinkster.io/brewer/angular-django-tutorial/ (assuming you are using angularJS) On Mon, Jan 19, 2015 at 5:08 AM, wrote: > Hi, I am trying to build a single page,

Re: can't install the pillow library on my first attempt to add an ImageField to my model

2015-01-21 Thread Vijay Khemlani
You need to install the development python package for your distro For example, in Ubuntu sudo apt-get install python-dev in Fedora sudo yum install python-devel On Wed, Jan 21, 2015 at 10:44 AM, aseds wrote: > hi, > this is the first time i tried and added an ImageField to my model. then >

Re: can't install the pillow library on my first attempt to add an ImageField to my model

2015-01-21 Thread Vijay Khemlani
, aseds wrote: > thank you Vijay, the error has changed. now i've got > > error: could not create '/usr/local/lib/python2.7/dist-packages/PIL': > Permission denied > > > Cleaning up... > > Command /usr/bin/python -

Re: login_required in urlpatterns TypeError 'tuple' object is not callable

2015-01-23 Thread Vijay Khemlani
I may be mistaken, but I don't think you can decorate an entire "include" call On Fri, Jan 23, 2015 at 8:51 PM, Neto wrote: > Hi, I'm using login_required in url patterns but it does an error: > > urls.py > > from django.conf.urls import patterns, include, url > from django.contrib.auth.decorato

Re: How to properly set the initial value for a Form ChoiceField

2015-01-23 Thread Vijay Khemlani
It could be a number of things, but the main thing that caught my attention was this part self.fields['images'].initial = str(selected_image) self.fields['images'].initial = str(selected_flavor) shouldn't it be self.fields['images'].initial = str(selected_image) s

Re: Help in Django-contact-form

2015-01-27 Thread Vijay Khemlani
And I'm not following, contact_form does not provide a ContactForm model, but you are providing one it seems, but it's on the same contact_form package as the library itself? Also, the fact that the model class has the same name as the form class does not help much. On Tue, Jan 27, 2015 at 10:45

Re: Best way to get ForeignKey Related Objects?

2015-01-29 Thread Vijay Khemlani
"answers" seems to be a method on the AudioQuestionPair class, so your call should be: for answer in pair.answers(): print answer and "pair.answers.get.all()" does not make sense sinse "answers" is a method. If you don't want to use a specific method, you can do this: answers = pair.answer_

Re: Best way to get ForeignKey Related Objects?

2015-01-29 Thread Vijay Khemlani
AM, Tobias Dacoir wrote: > Damn, you are right. pair.answers() works. I'm wondering why I didn't get > a syntax error when calling it without the parenthesis (), because print > still worked. > > On Thursday, January 29, 2015 at 2:59:56 PM UTC+1, Vijay Khemlani wrote: >>

Re: When do I have to call save() on a Model Instance?

2015-01-29 Thread Vijay Khemlani
You could pass the user as an optional parameter to function2. Whether you should save the user or not in each of the methods depends on the logic of your application, or you can add a parameter to the method (True to save the object, False otherwise) On Thu, Jan 29, 2015 at 1:43 PM, Tobias Dacoi

Re: When do I have to call save() on a Model Instance?

2015-01-29 Thread Vijay Khemlani
yep, it's safe to do so On Thu, Jan 29, 2015 at 3:40 PM, Tobias Dacoir wrote: > Thanks for answering all my questions. > > So it's perfectly save to call the save method at a later time? As long as > I keep the object and a pointer to it in memory I can freely modify it in > several Functions be

Re: Do Signals block Django process?

2015-01-30 Thread Vijay Khemlani
The number of threads is determined by the number of workers in your process that is serving the application, not Django itself. For example, if you are using uWSGI to serve the application, then you have a parameter "workers" in its initialization file that sets the number of process to spawn and

Re: How to get hold of a session after getting signaled?

2015-01-30 Thread Vijay Khemlani
As far as I can tell on the project source, the only place the "badge_awarded" signal is triggered is in the "award_to" method in the Badge class, which does not handle a request object. If you are calling something like "badge.award_to(user)" in one of your views, then you can modify the request

Re: incorrect syntax of django core management __init.py file (reported on windows powershell)

2015-01-31 Thread Vijay Khemlani
Django 1.3 only works with python 2, not python 3 On Sat, Jan 31, 2015 at 2:31 PM, Akshit Arora wrote: > hey, I am working on this project that requires django with apache > > https://github.com/nbproject/nbproject > > it's installation guide is here : > > https://github.com/nbproject/nbproject/

Re: Initial stages of django

2015-01-31 Thread Vijay Khemlani
Did you take a look at the official tutorial? https://docs.djangoproject.com/en/1.7/intro/tutorial01/ On Sat, Jan 31, 2015 at 5:02 PM, Sreenivasarao Pallapu < sreenivas.eng...@gmail.com> wrote: > Hi, >I'm new to django. I know basic python. I heard that django is nothing > but python. I've i

Re: PermissionError with open()

2015-02-02 Thread Vijay Khemlani
Your call to ".format(file_name)" does nothing as the original string does not have the positional arguments ("{0}" for example) You could just append the filename with "+". On Mon, Feb 2, 2015 at 3:32 AM, John wrote: > Hello everyone, > > I am trying to run this code inside view.py, to make

Re: ListView and Deleteview

2015-02-02 Thread Vijay Khemlani
Hmmm... Try and post your urls.py and views.py (the correct one) On Mon, Feb 2, 2015 at 5:20 PM, Dan Gentry wrote: > This is a bit of a stumper! > > I don't see any big glaring issues. A couple of housekeeping things: Is > there data in the table? Are you certain that you are using the correct

Re: Writing your first Django app, part 1 - Django 1.7 - # Make sure our __str__() addition worked.

2015-02-04 Thread Vijay Khemlani
The method is called "__str__" (note the double underscore at both ends) On Wed, Feb 4, 2015 at 2:29 PM, Gavin Patrick McCoy < gavin.mcc...@mail.dcu.ie> wrote: > Hi, > > Just started learning Django today. I got down to the last grey box of > code on > https://docs.djangoproject.com/en/1.7/intro/

Re: Writing your first Django app, part 1 - Django 1.7 - # Make sure our __str__() addition worked.

2015-02-04 Thread Vijay Khemlani
Don't worry :) On Wed, Feb 4, 2015 at 7:00 PM, Gavin Patrick McCoy < gavin.mcc...@mail.dcu.ie> wrote: > Sorry about that. Thanks a million for your reply. > > On Wednesday, 4 February 2015 17:38:16 UTC, Vijay Khemlani wrote: >> >> The method is called "__

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Vijay Khemlani
I'm not following, in the Django settings there is no "HOST" entry (other than the one used to connect to the database) https://docs.djangoproject.com/en/1.7/ref/settings/ If you're talking about "ALLOWED_HOSTS", then that one is only a whitelist of allowed domains. Try and describe your problem

Re: models, peeking to next record - maybe

2015-02-07 Thread Vijay Khemlani
The direct solution would be something like this in your view events = Event.objects.order_by('event_date') event_tuples = [] last_date_seen = None for event in events: if last_date_seen: date_difference = event.date - last_date_seen else: date_difference = None even

Re: Contact form and sending confirmation an page.

2015-02-08 Thread Vijay Khemlani
One way would be to render the page after the submit and scroll down to the form. Other would be submitting the form by ajax. On Sun, Feb 8, 2015 at 6:30 PM, inoyon artlover KLANGRAUSCH < inoyonartlo...@googlemail.com> wrote: > Hi there! > > I got one page. On the page is a contact form. > After

  1   2   3   4   5   >