Re: Getting data from user via HTML

2009-09-15 Thread koranthala
On Sep 15, 9:02 am, Nitin Boladra wrote: > Hi Django users, >                 I am trying to create a simple Django application > wherein I want to run a python function with an argument that is > obtained from text-box whenever I click the button on my web-page. The > problem is passing the va

Re: Updating request.POST

2009-09-13 Thread koranthala
On Sep 13, 6:38 am, koranthala wrote: > Hi, >    I have the following scenario. >    I am creating a custom admin page for one of the models. I am > adding few extra fields. If the extra fields are set, then the user > does not need to set the model fields. An example is given b

Updating request.POST

2009-09-12 Thread koranthala
Hi, I have the following scenario. I am creating a custom admin page for one of the models. I am adding few extra fields. If the extra fields are set, then the user does not need to set the model fields. An example is given below: Model A: val1 models.ForeignKey(A1) val2 models.Fore

How much DB queries is too much?

2009-08-06 Thread koranthala
Hi, I am designing a website with Django and Apache. This is my first foray to web designing, even though I have quite a bit of experience in another area. The logic for the site is somewhat involved - It is better to think of it as more of an application rather than a site. The problem i

Re: Hard linking an image

2009-06-25 Thread koranthala
On Jun 26, 2:21 am, Kevin Teague wrote: > Presumably you already have all of the data required to generate a > chart on the server? If so, then store the chart data in a model, and > just reference it by id. e.g. > > > > (or w/ a pretty URL: ) > > And create a Chart object and store it before

Hard linking an image

2009-06-25 Thread koranthala
Hi, I have a chart which I generate on the fly. Basically, I have hard linked an image. The image src contains GET parameters, which is used to generate the chart image via matplotlib. The resultant image is returned back as 'Content-Type' = 'image/png', and thus the chart is displayed.

Re: Block delete

2009-04-17 Thread koranthala
On Apr 18, 1:26 am, koranthala wrote: > On Apr 18, 1:08 am, Alex Gaynor wrote: > > > > > On Fri, Apr 17, 2009 at 4:05 PM, koranthala wrote: > > > > On Apr 17, 11:57 pm, koranthala wrote: > > > > On Apr 17, 11:51 pm, Alex Gaynor wrote: > > >

Re: Block delete

2009-04-17 Thread koranthala
On Apr 18, 1:08 am, Alex Gaynor wrote: > On Fri, Apr 17, 2009 at 4:05 PM, koranthala wrote: > > > On Apr 17, 11:57 pm, koranthala wrote: > > > On Apr 17, 11:51 pm, Alex Gaynor wrote: > > > > > On Fri, Apr 17, 2009 at 2:47 PM, koranthala > > wrote:

Re: Block delete

2009-04-17 Thread koranthala
On Apr 17, 11:57 pm, koranthala wrote: > On Apr 17, 11:51 pm, Alex Gaynor wrote: > > > > > On Fri, Apr 17, 2009 at 2:47 PM, koranthala wrote: > > > > Hi, > > >    I am facing a problem which I believe should be a usual issue for > > >

Re: Block delete

2009-04-17 Thread koranthala
On Apr 17, 11:51 pm, Alex Gaynor wrote: > On Fri, Apr 17, 2009 at 2:47 PM, koranthala wrote: > > > Hi, > >    I am facing a problem which I believe should be a usual issue for > > everyone. But I cannot find a way to do it in a straightforward > > manner. &g

Block delete

2009-04-17 Thread koranthala
Hi, I am facing a problem which I believe should be a usual issue for everyone. But I cannot find a way to do it in a straightforward manner. I have to select a list of items from table A and delete everyone of them. Now, there are close to 20K elements which I want to delete. So, what I do

Re: signals vs. save()

2009-04-16 Thread koranthala
On Apr 16, 6:41 pm, Alex Gaynor wrote: > On Thu, Apr 16, 2009 at 6:39 AM, koranthala wrote: > > > Hi, > >    I was comparing between signal and save() and came across this > > following mail chain - > > >http://groups.google.com/group/django-users/browse_threa

signals vs. save()

2009-04-16 Thread koranthala
Hi, I was comparing between signal and save() and came across this following mail chain - http://groups.google.com/group/django-users/browse_thread/thread/d0ff6dd3432d25fa/99a92f9f4b343b1e In this it is mentioned that - --- If you want to implement some functionality that operates across

Default items in a template

2009-04-06 Thread koranthala
Hi, I have many pages in my website - and all have the same default header and side bars. The header and sidebar contains ~15 links which are constant every time. While rendering templates for these pages, I always have to send all these links in the context. Since it is unseemly, I am plannin

A confusing output

2009-03-21 Thread koranthala
Hi, Using Django 1.1 I have the following filter p = DB.filter( value_in = values, name__in = names).select_related() I am facing 2 issues in here. 1. Unexpected DB queries I did p = list(p) The total queries was 1 I then did p = list(p) for a in p: pass Now, the total queries is comi

Re: Aggregation Questions

2009-03-16 Thread koranthala
On Mar 16, 11:44 pm, Alex Gaynor wrote: > On Mon, Mar 16, 2009 at 11:52 AM, koranthala wrote: > > > On Mar 16, 8:14 pm, Alex Gaynor wrote: > > > On Mon, Mar 16, 2009 at 11:07 AM, koranthala > > wrote: > > > > > Hi, > > > >

Re: Aggregation Questions

2009-03-16 Thread koranthala
On Mar 16, 8:14 pm, Alex Gaynor wrote: > On Mon, Mar 16, 2009 at 11:07 AM, koranthala wrote: > > > Hi, > >    I downloaded Django 1.1 due to aggregation support. > >    But I am facing one issue which I cannot seem to overcome. > >    I have two fields which

Aggregation Questions

2009-03-16 Thread koranthala
Hi, I downloaded Django 1.1 due to aggregation support. But I am facing one issue which I cannot seem to overcome. I have two fields which represents two different times. I want to get the sum of difference of times - and I am unable to do so. Basically, I want to do as follows: SE

Re: Overriding UserManager

2009-03-12 Thread koranthala
On Mar 11, 8:42 pm, koranthala wrote: > On Mar 11, 8:34 pm, Alex Gaynor wrote: > > > > > On Wed, Mar 11, 2009 at 10:32 AM, koranthala wrote: > > > > Hi, > > >    I have created an Identity Mapper for my website - which is as > > > follows:

Re: Overriding UserManager

2009-03-11 Thread koranthala
On Mar 11, 8:34 pm, Alex Gaynor wrote: > On Wed, Mar 11, 2009 at 10:32 AM, koranthala wrote: > > > Hi, > >    I have created an Identity Mapper for my website - which is as > > follows: > > > class IdentityMap(object): > >    def __getattr__(self, name

Overriding UserManager

2009-03-11 Thread koranthala
Hi, I have created an Identity Mapper for my website - which is as follows: class IdentityMap(object): def __getattr__(self, name): if not hasattr(self, name): setattr(self, name, {}) return getattr(self, name) MAP = IdentityMap() class MapManager(models.Man

Re: opposite of icontains

2009-03-06 Thread koranthala
On Mar 6, 9:15 pm, Jeff FW wrote: > Clearly, you get to work on cooler projects than I :-)  I had thought > of the keywords/phrases case, but the other ones are far more > interesting.  Thanks for the explanation! > > -Jeff > > On Mar 5, 7:02 pm, Malcolm Tredinnick > wrote: > > > On Thu, 2009-

Re: opposite of icontains

2009-03-04 Thread koranthala
Thank you very much Jeff and Malcolm for the extremely helpful replies. Jeff, the substring match is not based on spaces. Rather, the string can start anywhere and end anywhere. So, I cannot think of a way to do it, as Malcolm said. I had also done the same thing as Malcolm, i.e. pulled every tupl

opposite of icontains

2009-03-04 Thread koranthala
Hi, How do I implement a substring query? Please find the example below. >From Django Documentation: Entry.objects.get(headline__icontains='Lennon') => This matches the headline 'Today lennon honoured' My query is the opposite: I have the string 'Lennon' inside my DB, and I have

Django - spanning relations

2009-03-01 Thread koranthala
Hi, This is my first Django/DB project, so pardon for the naivete of the question. I have one relation in my DB which I cannot - whatever I think of - seem to do it in a single DB check. Since I have around 5 other separate SQL statements in that same view, I am worried about the performa

Django Transaction Management

2009-02-26 Thread koranthala
Hi, Django Reference suggests that we use Transaction Middleware in the web applications. What is the usual practice followed here? Do we use Transaction Middleware most of the time? The reason why I am asking is due to the following reason: In my code, I at many places do the followi

Re: Extract values from form fields in templates

2009-02-20 Thread koranthala
On Feb 18, 11:33 pm, Karen Tracey wrote: > On Wed, Feb 18, 2009 at 8:52 AM, koranthala wrote: > > > Hi, > >    I am unable to extract values from form fields inside templates. > >    For example: > >      I have mutiple text fields in which one field says whethe

Extract values from form fields in templates

2009-02-18 Thread koranthala
Hi, I am unable to extract values from form fields inside templates. For example: I have mutiple text fields in which one field says whether the second field is X or not and the second field containing the actual data. (These are initial values which I send from server to client)

Some questions on using Django

2009-02-11 Thread koranthala
Hi all, Please excuse me if this is a naive question. I am a developer/ programmer who is now into web development for the first time. I have read through Django tutorial and I have a moderate understanding of how Django works. I have two major questions, which is bugging me quite a lot.