Edit instance for ModelChoiceField not getting selected selected

2011-06-05 Thread sushanth Reddy
Hi, When i edit a records none of the modelchoicefields are getting selected using form edit form instance. I have gone though below blog, but confusing http://blog.brendel.com/2009/07/setting-initial-value-for-djangos.html *view.py* : def EditTable(request, get_id): detail_data =

ORM Doubts

2011-06-03 Thread sushanth Reddy
Hi, below is model class Employee(models.Model): name = models.CharField(max_length=50, primary_key=True) dep = models.CharField(max_length=10) class Meta(object): db_table = u'employee' class EmpSal(models.Model): emp_name = models.ForeignKey(Employee, db_column='emp_name')

Re: Model filter on date ranges

2011-05-24 Thread sushanth Reddy
Thank you for the response,Let me give a try and let you know. Thanks & Regards sushanth reddy On Tue, May 24, 2011 at 12:30 PM, Ori Livneh <ori.liv...@gmail.com> wrote: > Check out the python-dateutil <http://labix.org/python-dateutil> module > (not in the standard lib,

Model filter on date ranges

2011-05-23 Thread sushanth Reddy
Hi, How to get model filter on date ranges. In my project using employee doj, i need to deign a table. like employee who have joined less than three months , 3-6month, 6-12 months, 12-24 months. Depart < 3month 3-6months 6-12months 12-24months -

Re: My tool to generate django code

2011-05-21 Thread sushanth Reddy
This is awesome Brice, Nice Work -- 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+unsubscr...@googlegroups.com. For

Re: Google motion chart problem in django template

2011-05-17 Thread sushanth Reddy
Hi Tarkeshwar, Thank you for the response,But here i am directly passing list to the template, Can you please help me how to extract that list into that date format. Thanks in advance sushanth -- You received this message because you are subscribed to the Google Groups "Django users"

Re: How to aggreate in html django

2011-03-12 Thread sushanth Reddy
Hi Tom, I given try but not printing any values in html. can you please add some more code -- 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

Re: Sum in html template using template tag

2011-03-12 Thread sushanth Reddy
it worked,thanks aaa ton -- 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+unsubscr...@googlegroups.com. For more

Re: django remove unicode from query result ?

2011-03-11 Thread sushanth Reddy
Hi JAson, Thanks a ton,it 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, send email to django-users+unsubscr...@googlegroups.com. For

Sum in html template using template tag

2011-03-11 Thread sushanth Reddy
Hi , I am trying to sum in HTML,but template tag return 0 , View.py def gen_Report(request): ### query returns below output list=[{'total': 1744, 'user': u'x'}, {'total': 13, 'user': u'y'}, {'total': 126, 'user': u'z'}, {'total': 46, 'user': u'm'}, {'total': 4, 'user':

Re: django remove unicode from query result ?

2011-03-10 Thread sushanth Reddy
I using jplot in my app .if list is in unicode(u) ,it not displaying the charts,thats the reason i want to remove it ... -- 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

django remove unicode from query result ?

2011-03-10 Thread sushanth Reddy
Hi, Django query gives me below output format,but i want below format date=`[{'total': 1744, 'name: u'x'}, {'total': 13, 'name': u'm'}, {'total': 126, 'role': name'n'}]` m=[] for i in m: m.append(i.values()) print m it give me output [[1744,u'x'],

how to log model inserts,updates and deletes

2011-03-10 Thread sushanth Reddy
hi, how to log model inserts,updates and deletes? I am not using django admin,in my app there are multiple tables i just want to records only which model or table name, field name,previous value,who edited,and what time to one log table? Who edited (my app uses SSO,it should pick up remote

Re: how to write data to csv using DictWriter

2011-03-09 Thread sushanth Reddy
thanks you for the link ,KG -- 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+unsubscr...@googlegroups.com. For more

Re: how to write data to csv using DictWriter

2011-03-09 Thread sushanth Reddy
I have gone through to that documentation,but output in wired format ,plz add few lines of codes to undersstand better -- 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

how to write data to csv using DictWriter

2011-03-09 Thread sushanth Reddy
Hi, How to write below data to csv in below output format ? list of dict data=[{'date': datetime.date(2011, 2, 8), 'user': u'xxx', 'status': u'P'}, {'date': datetime.date(2011, 2, 8), 'user': u'yyy', 'status': u'P'}, {'date': datetime.date(2011, 2, 8), 'user': u'zzz', 'status': u'P'},

Re: How to aggreate in html django

2011-03-07 Thread sushanth Reddy
Hi Tom, Can you please add few lines of code example, to make code more efficient?sorry for troubling. -- 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

How to aggreate in html django

2011-03-07 Thread sushanth Reddy
Hi , I want to make total at the end of the each row,i have explained the details in below link. http://stackoverflow.com/questions/5223093/how-to-aggreate-in-html-django Can you please help me Thanks in advance sushanth -- You received this message because you are subscribed to the

django csv header and row format problem

2011-03-07 Thread sushanth Reddy
Hi, I am trying to create csv download ,but results download gives me in different format below is the link which gives the details of the problem http://stackoverflow.com/questions/5222841/django-csv-header-and-row-format-problem -- You received this message because you are subscribed to

error while submitting data in the form django

2011-02-08 Thread sushanth Reddy
I am trying to insert data into db it throws below error,can any please fix this. model.py from django.db import models # Create your models here. class Profile(models.Model): name = models.CharField(max_length=50, primary_key=True) assign = models.CharField(max_length=50) doj

Filtered drop down choice django

2011-01-31 Thread sushanth Reddy
I am trying to create a dynamic filtered drop down choice fields,i gone through below blog but it confusing,can any one suggest easy way to do this in django. http://www.nerdydork.com/dynamic-filtered-drop-down-choice-fields-with-django.html Thanks in advance :) -- You received this message

Issue with Foriegnkey in django

2011-01-31 Thread sushanth Reddy
i AM trying to create a from which is linked with foriegnkey. Model.py enter code here model.py class CreateD(models.Model): id=models.IntegerField(primary_key=True) db = models.CharField(max_length=50, blank=True) iss = models.CharField(max_length=100, blank=True)

Re: How to write joins ?

2011-01-27 Thread sushanth Reddy
Thanks a ton sam... -- 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+unsubscr...@googlegroups.com. For more options,

Re: How to write joins ?

2011-01-27 Thread sushanth Reddy
hi Sam, Here is example model: class Profile(models.Model): name = models.CharField(max_length=50, primary_key=True) assign = models.CharField(max_length=50) doj = models.DateField() dob = models.DateField() class Meta: db_table = u'profile' def

How to write joins ?

2011-01-27 Thread sushanth Reddy
HI, How to write joins in django,i have gone through below django documentation ,but joins are not working for my model http://www.djangoproject.com/documentation/models/many_to_many/ http://docs.djangoproject.com/en/1.2/topics/db/queries/#lookups-that-span-relationships and some blogs My