Re: how to design URL pattern to get the field value using request.query_params.get in the view

2016-09-05 Thread Siddharth Ghumre
If I understand it correctly, for this view your url must correspond to http://www.mysite.com/xyz?year=2015 Here as per standard url protocol, anything you pass after the "?" (question mark) is passed as a request.query_params to the views. Hope this helps. Sid On Sun, Sep 4, 2016 at 10:03

Re: How to add logo to django header

2016-07-28 Thread Siddharth Ghumre
Hi, Please follow the documentation on https://docs.djangoproject.com/en/1.9/ref/contrib/admin/#overriding-vs-replacing-an-admin-template The file you are looking for is base_site.html which you need to override to change the default 'Django Administrator' heading to your company logo. Hope

Re: It is possible to somehow fill the database data as soon as all applications will be loaded?

2016-07-26 Thread Siddharth Ghumre
For Django version 1.7 and above use migrations to load initial data as South is inbuilt included in these versions. Prior to version Django 1.7 (1.6 and below) use fixtures to load initial data. https://docs.djangoproject.com/en/1.8/howto/initial-data/ Hope this helps. -Sid On Tue, Jul 26,

Re: Installation de Django dans un environnement virtuel.

2016-07-25 Thread Siddharth Ghumre
I think "*sudo* pip install django" is the problem here as when you so sudo it installs it in the host machine not in virtualenv so the thumb rule says - dont use sudo when you are working in vitrual env. I guess pip install Django==1.X.X would solve the problem. Suggestion - use pip freeze to

Re: Django Admin on Microsoft Visual Studio Problem

2016-07-25 Thread Siddharth Ghumre
To access Django's admin site, your admin url should look like url( r'^admin/', include(admin.site.urls)) which says whenever u hit rather http://127.0.0.1:8000/admin would include admin urls from "admin.site.urls" rather than "polls.views" unless you have all the admin login there in

Re: Django - Query

2013-05-05 Thread Siddharth Ghumre
Hi, get the length of object by using len(movieObject) if len(movieObject)==1: #you can get along with get query if len(movieObject)>1: #use filter query and access each element by using for loop for i in movieObject: -Siddharth On Mon, May 6, 2013 at 1:54 AM, Shawn

Re: Modifying a field in another model

2013-05-01 Thread Siddharth Ghumre
Hi, Though its not the perfect solution for your query, please refer the link for ModelAdmin to include conditional formatting in admin interface. https://docs.djangoproject.com/en/dev/ref/contrib/admin/ -Siddharth On Mon, Apr 22, 2013 at 10:35 PM, Vittorio wrote: > My

Re: How to create a temporary table in Django use ORM

2013-05-01 Thread Siddharth Ghumre
Hi If you are interested in using multiple order by in django's ORM then use TABLE.objects.order_by('column_A','column_B') On Tue, Apr 23, 2013 at 11:18 AM, teddy wang wrote: > CREATE TEMPORARY TABLE TEMP (SELECT * FROM TABLE ORDER BY COLUMN_A); > SELECT * FROM TEMP

Re: ManyToMany relationship and raw sql queries

2013-05-01 Thread Siddharth Ghumre
Hi , Did you try python psycopg2. A simple deomostration. Ex:- import psycopg2 conn=psycopg2.connect("dbname='xxx' user='xxx' host='localhost' password='xxx'") cur = conn.cursor() query="""SELECT * FROM bookmarkmanager_bookmark b ' 'LEFT JOIN bookmarkmanager_bookmark_tags bt

Re: Admin shows all users as staff and super user

2013-05-01 Thread Siddharth Ghumre
Hi, I could not replicate your error here. I am also adding users via admin interface and the "Staff status" and "Superuser status" are unchecked by default. I am running django 1.4 on ubuntu 12.04 with postgresql. Can you just try switching to postgresql and see. -Siddharth On Wed, May 1,

Re: Admin shows all users as staff and super user

2013-05-01 Thread Siddharth Ghumre
Hi Thomas, Can you paste the code snippet where you add the user in your auth table (not the admin). It might help in understanding the problem. -Siddharth On Tue, Apr 30, 2013 at 11:45 PM, Thomas De Reyck < thomas%dereyck...@gtempaccount.com> wrote: > Hi everyone, > > My very first question

Re: django development server timeout too quick

2013-04-25 Thread Siddharth Ghumre
Hi Hadi, I am using sessions.middleware.SessionIdleTimeout in my app which takes care of the session management https://pypi.python.org/pypi/django-session-idle-timeout/1.0.1 Its clean and easy way to handle session timeouts. -Siddharth On Wed, Apr 24, 2013 at 11:57 AM, Hadi Sunyoto

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-25 Thread Siddharth Ghumre
hi Sachin, Please use django's form clean method in order to validate your phone_num field. You can also override the django's clean method by using your own clean_phone_field method. Please refer the link:- https://docs.djangoproject.com/en/dev/ref/forms/validation/ I am sure that a small

Re: (1242, 'Subquery returns more than 1 row')

2013-04-01 Thread Siddharth Ghumre
Hi As per my view your client query is returning more than one rows from your database. Suppose your job = 1 which you are getting from your Report table and the query ( Job.objects.all().filter( client=job)..)fetches two or more than two records from your 'job' table. Now there can be two

Re: Data Structure - Orders and multiple items

2013-04-01 Thread Siddharth Ghumre
Sorry for the half response...please ignore the previous message. class order(models.Model): order_id = models.IntegerField(unique=True) customer_id = models.ForeignKey('Customer') item_id = models.ForeignKey('Item') qty = models.IntegerField() This will you give the provision to

Re: Data Structure - Orders and multiple items

2013-04-01 Thread Siddharth Ghumre
Hi As per my view you can modify your models as follows:- class order(models.Model): order_id = models.IntegerField(unique=True) customer_id = models.ForeignKey('Customer') item_id = models.ForeignKey('Item') On Mon, Apr 1, 2013 at 10:30 AM, Lachlan Musicman

Re: how can i prevent a user from viewin a page without using the django @login decorator

2013-01-28 Thread Siddharth Ghumre
Hi Are you storing the user data in some database table? If yes, then you can search for the logged in user with the user data present in database table. If you dont find a match then you can send to some error page or re-login page. -Siddharth On Mon, Jan 28, 2013 at 8:32 AM, Okorie Emmanuel

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

2012-12-13 Thread siddharth ghumre
Hey Chris Thanks for the replybut i figured it out what was wrong. :) -Siddharth On Thu, Dec 13, 2012 at 6:09 PM, Chris Cogdon wrote: > How are you populating the choices in the ChoiceField? Remember, you need to > do this on BOTH the POST AND the non-POST versions of

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

2012-12-11 Thread siddharth ghumre
Hi, I am facing problem in handling modelform and ajax together. The situation is:- I am using modelform to get display the form as ul in the template. I have 3 ChoiceFields (country, state,city). On select of a country from the dropdown, the valid states dropdown gets populated and on select of

Re: sqlsync help

2012-11-16 Thread siddharth ghumre
Hi Friend, It would be really helpful if you paste the entire error msg. No one can figure out what went wrong by looking at your previous mail. On Tue, Nov 13, 2012 at 2:56 AM, Dennis Lee Bieber wrote: > On Mon, 12 Nov 2012 01:47:17 -0800 (PST), hardik juneja >

Re: transfer one django app to another server

2012-11-15 Thread siddharth ghumre
You can just copy your app from your local machine to server. Just keep in mind to do the necessary changes in the settings.py file. Enjoy :) On Thu, Nov 15, 2012 at 8:24 PM, Lewis wrote: > Hello, > > In order to transfer the app from local machine to another server.