Re: Is it possible to use custom template tag inside another tag?

2009-10-04 Thread AmanKow
> custom tag is a function  - cant you just assing its return in view > into variable and send this variable to template? The usual way to go about this would be to modify your tag to take an optional "as var_name". When the tag has the optional portion, you would update the value into the varia

Re: Display Data From Multiple Tables

2009-07-02 Thread AmanKow
On Jul 2, 10:25 am, The Danny Bos wrote: > DR. > Bingo!! > > Thanks man, > And thanks for the tip on "_set" being for ForeignKeys. > > d > > On Jul 3, 12:23 am, Daniel Roseman wrote: > > > On Jul 2, 3:20 pm, The Danny Bos wrote:> Daniel, > > > > {% for author in review.item.author_set.all %} >

Re: PyDev users: how do you manage tabs?

2009-07-01 Thread AmanKow
> I have the same problem in Komodo Edit - although I the whole filename > does show up in the window title I never think to look there. Anyway, > I partially solved it by adding a comment at the top of the file for > what app the file is for, so I'll see what I'm working on right there > in the e

Re: Django deployment

2009-06-04 Thread AmanKow
On Jun 3, 4:16 am, vishy wrote: > Hi, > > I am developing an application on windows. I decided to upload it on > webfaction n see how deployment goes. The issues I faced was with > paths given - > for templates - I had given absolute path of directory on windows, > for database(using sqlite) -

Re: simple model problem

2009-03-05 Thread AmanKow
On Mar 4, 8:57 pm, Malcolm Tredinnick wrote: > On Wed, 2009-03-04 at 10:43 -0800, arbi wrote: > > Hello, > > I am new to Django and programming... > > I have a model similar to this one : > > > class myModel : > >   attribute 1 = models.ForeignKey(myModel2, primary_key = True) > >   attribute 2 =

Re: extending admin change_form template

2009-03-04 Thread AmanKow
On Mar 3, 10:50 am, Jon Reck wrote: > I'm a novice Python and Django programmer so please don't assume a lot of > knowledge here. > I'm trying to place a link on an admin change form to a label printing > function. I'd like to pass the id of the current record to the function. If > I hardwire it

Re: Passing HTML Table to a Template

2009-02-26 Thread AmanKow
On Feb 26, 11:20 am, tyler kunter wrote: > thanks eric...I was able to fgure that out after a lil frustration thank you > for your response. > > On Thu, Feb 26, 2009 at 1:32 AM, Eric Abrahamsen wrote: > > > On Feb 26, 2009, at 4:30 PM, tykun...@gmail.com wrote: > > > > Hi I am trying to pass a

Re: Postgresql v MySQL

2009-02-08 Thread AmanKow
I started with mysql and moved to postgres. My main reasons: 1) If you ever need to dumpdata/loaddata, you may find that postgres (correctly) defers checking of fk constraints until after the a transaction is complete. MySQL checks the constraints as each record is added, even inside of a trans

Re: Logout- Back Button

2008-11-13 Thread AmanKow
use javascript to clear the history On Nov 12, 1:05 pm, jai_python <[EMAIL PROTECTED]> wrote: > hi.. i tried with logout_then_login method. But i am still facing that > back button after logout issue.. any other suggestion? --~--~-~--~~~---~--~~ You received this m

Re: Limit choices by object, not model

2008-10-16 Thread AmanKow
> Wouldn't it make more sense to limit them in the admin or the forms > instead of limiting them right in the models? The act of selecting an > activity topic in a form is form specific, the models don't (and > probably don't need to) have any knowledge of that. I'm not sure what you're driving

Limit choices by object, not model

2008-10-16 Thread AmanKow
I need to limit choices dynamically by an object, not a class: class CertType(models.Model): name = models.CharField(max_length=128) class ActivityTopic(models.Model): cert_types = models.ManyToMany(CertType) class Participation(models.Model): activity_topic = models.ForeignKey(acti

Re: Stupid noob question - admin link

2008-09-10 Thread AmanKow
> Summary : You could simply copy the file base_site.html from admin > templates to a directory called "admin" in your own template directory > and add a link to your own pages in {% block branding %} so you would > have access to the link on every admin page. Actually, there is an empty block de

Re: How to subclass a model class?

2008-09-07 Thread AmanKow
Clarification: > Now just go to town accessing it just like a field when you need it. That is , you can now use it just like a field in templates and the admin. It would be a method call in python code, including your view. You could of course define it as a property to make it 'fieldy' there as

Re: How to subclass a model class?

2008-09-07 Thread AmanKow
Monkey patching attributes to the instances would not be the correct django idiom for adding a calculated field. There is a simple and straight forward django idiom for expressing calculated fields in the model. In your car model, create a method named 'comment' returning the required informatio

Is it possible to collapse stacked or table inline in newforms-admin?

2008-06-26 Thread AmanKow
I don't want to collapse the individual items, but the whole stack or table. Anyone know how to go about this? Thanks Wayne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Collapse an inline in newforms-admin

2008-06-25 Thread AmanKow
Is there anyway to collapse an inline edited model in the newforms- admin? --~--~-~--~~~---~--~~ 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 un

Re: Why PostgreSQL?

2008-06-19 Thread AmanKow
u, Jun 19, 2008 at 12:01 PM, AmanKow <[EMAIL PROTECTED]> wrote: > > > On Jun 18, 8:48 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> > > wrote: > > > If I came off sounding accusatory, please forgive me, > > it was not my intent. > > No pro

Re: Why PostgreSQL?

2008-06-18 Thread AmanKow
Hi, Russell! On Jun 18, 8:48 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > Lets be clear here - the problem you are describing is fundamentally > MySQL's problem, not Django's. MySQL doesn't interpret the standard > right, and doesn't provide for an easy workaround. There isn't much > Dj

Re: Why PostgreSQL?

2008-06-18 Thread AmanKow
I have to disagree that Django supports these backends equally well. I've just been bitten badly by the 'dumpdata ' 'loaddata ' problems with MySQL and innodb. I originally decided to go with MySQL (familiarity, for the most part). Using MyIsam tables is not an option for me, I need the transact

Re: multiple children in multitable inheritance

2008-05-01 Thread AmanKow
I've been trying to keep away from the idea of using MTI (multitable inheritance) for my Person->Student|Faculty|Manager needs, but damn! The sugar is just too sweet! I understand the objection to wanting the inheritance to look as much like python as possible, but I'm not sure it applies here.

Re: a question about model inheritance after qs-rf

2008-05-01 Thread AmanKow
I did the following, it works fine: from django.db import models class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) def __unicode__(self): return self.name # you can call this on any model object def object_as_dict(mo

Re: a question about model inheritance after qs-rf

2008-05-01 Thread AmanKow
Whoops... get should be filter existing_ct_as_dict=ContentType.objects.filter(pk=ct_pk).values()[0] On Apr 30, 9:04 am, AmanKow <[EMAIL PROTECTED]> wrote: > Assuming ACT is your class name: > > ct = #... get the content type instance to extend here, or obtain the >

Re: a question about model inheritance after qs-rf

2008-04-30 Thread AmanKow
Hmmm... this seems to be a common issue... extending already existing records Would be nice if there were a way to create the child, specify the pk and do a "save child only" On Apr 30, 9:04 am, AmanKow <[EMAIL PROTECTED]> wrote: > Assuming ACT is your class name: > >

Re: a question about model inheritance after qs-rf

2008-04-30 Thread AmanKow
Assuming ACT is your class name: ct = #... get the content type instance to extend here, or obtain the pk in whatever way ct_pk= ct.pk existing_ct_as_dict=ContentType.objects.get(pk=ct_pk).values()[0] act = ACT(**existing_ct_as_dict #, your extended keyword vars) act.save() You must fetch and s

Re: multiple children in multitable inheritance

2008-04-28 Thread AmanKow
lications needs. Ah, the intricacies of ORM. It makes my head hurt! Thanks again, Wayne On Apr 28, 1:15 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-04-27 at 21:43 -0700, AmanKow wrote: > > Thanks for the reply, Malcolm. > > > Between what you wrote

Re: multiple children in multitable inheritance

2008-04-27 Thread AmanKow
Thanks for the reply, Malcolm. Between what you wrote above and just creating the models and looking at the tables and indexes generated clarified the whole thing for me... My purposes are similar to what I was attempting with the above example, with people instead of places (they can be any or

multiple children in multitable inheritance

2008-04-27 Thread AmanKow
Thanks so much for qsrf, my excitement is off the charts! I have a question about whether I am going about the following the right way. I would like to have a model that is subclassed several time, where it is possible for a child to point at the same parent as another child in another subclass.

Re: Head swimming - JavaScript libraries

2008-02-17 Thread AmanKow
My $0.02: jquery is the way to go. The interface is very simple and clean, it is very simple to extend, the ui is limited but getting better and there are a lot of third party plugins for it from a very active and helpful community. A real bonus is the dom manipulation. Sooner or later we all

Re: Templates with multiple repeating blocks

2008-01-17 Thread AmanKow
On Jan 16, 3:41 am, stryderjzw <[EMAIL PROTECTED]> wrote: > Thanks, everyone. > > I like this idea. That really helped. I hope this gets considered. > > Cheers, > Justin Ok, as soon as I get a chance, I'll get some docs and tests done and post a ticket with a patch. That should greatly improve

Re: Templates with multiple repeating blocks

2008-01-03 Thread AmanKow
I posted a diff on dpaste: http://dpaste.com/hold/29777/ This is for a change to django/template/loader_tags.py This change would add an explicit reuse_block tag. {% block menu %} ... {% endblock %} ... {% reuse_block menu %} This change will actually reuse the parsed block. It does not cr

Re: Do away with django's support for python 2.3?

2007-12-01 Thread AmanKow
Thanks for the response, Malcolm! On Dec 1, 3:54 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2007-12-01 at 12:25 -0800, AmanKow wrote: > > I am curious as to whether the django community cannot comfortably do > > away with support for python 2.3 in the effo

Do away with django's support for python 2.3?

2007-12-01 Thread AmanKow
I am curious as to whether the django community cannot comfortably do away with support for python 2.3 in the effort towards django 1.0. There were significant changes made between python 2.3 and 2.4, and continuing support of 2.3 in the django code base is a significant restriction. As django 1.