retain form data when a user session expires while filling a form

2018-04-12 Thread Vijay Shanker
I have to code this scenario: Some user comes to fill a form and while user is at it, session expires; User tries to submit form, as session has expired it will take him to login page after which he is rediredted to form page with a prefilled form with data he filled previously. my propsed

django, multi-tenancy and urls

2014-12-05 Thread vijay shanker
am writing a e-commerce application where different people can have stores with urls like this: www.store-one.saas.com, www.store-two.saas.com, and so on. These domains have to be generated automatically when a user signs up for store. I have read somewhere that www.saas.com/store-one can be

LiveFyre vs disqus Commenting system

2014-03-03 Thread vijay shanker
Hi I was pondering over using livefyre's comment on my site (to have something similar to disqus). I am inquisitive about how it fared for people who had already used it, i.e can i get total comments count, can i collect user information of people who use it to comment upon, what are the pros

Re: Inserting image alongwith text in django's TextField

2013-12-23 Thread Vijay Shanker
g/ > > > Mrinmoy Das > http://goromlagche.in/ > > > On Mon, Dec 23, 2013 at 3:11 PM, vijay shanker <deont...@gmail.com> wrote: > >> Hi >> I am trying to insert images in between of text (basically an article >> with images interspersed in b

Inserting image alongwith text in django's TextField

2013-12-23 Thread vijay shanker
Hi I am trying to insert images in between of text (basically an article with images interspersed in between) with django's TextField so that i can add and position the image in the TextField box in admin.I tried tinymce's tinymce_models.HTMLField() for body field of my Article model but it did

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 #

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

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 > from django

Issue in User authentication

2013-07-04 Thread vijay shanker
ks for me.* * * kind suggestions are welcome. Regards Vijay Shanker -- 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-users+unsubscr...@googlegro

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

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 <deont...@gmail.com> 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 AddArt

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

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

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

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 nam

Re: chained selectboxes with simpleJson call

2013-02-12 Thread vijay shanker
: self.cleaned_data['model_attribute'] = self.data['model_attribute'] del self._errors['model_attribute'] return self.cleaned_data just like that ;) On Tuesday, February 12, 2013 5:09:51 PM UTC+5:30, vijay shanker wrote: > > hey all > > I have a

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

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

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

Re: Any good books for learning django?

2013-02-11 Thread vijay shanker
. Drop us a note at <their@email> 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 ? >>> will u

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 > <deon...@gmail.com> > wrote: > > do u have the pdf ? > > will u share it at some place (or please mail it to me > &

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

Re: A small bug for dynamic choices

2013-02-11 Thread vijay shanker
, 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 > > def get_all_models(

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

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

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 >

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: 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: 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

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: 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 Evan

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 > <deon...@gmail.com> > wrote: > > Hi > > I am using django version 1.4.3 > > I am using two signals in

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

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

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

2013-02-07 Thread vijay shanker
lation 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 > i want to do som

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)

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)

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

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

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:

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

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

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

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

2012-06-08 Thread vijay shanker
> Note: I have 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 <vshanker...@gmail.com> wrote: > > hi > > is ther

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

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

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,

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

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

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

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

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