Absolute URLs (including domain name)

2008-09-25 Thread Karish
I am using {{ MEDIA_URL }} in my templates for images, CSS and JS. For example, {{ MEDIA_URL }}img/abc.gif I want to do something similar when I need absolute URLs, and I was wondering what approaches exist. For example, I could define SITE_URL = 'http://www.domain.com/' in settings.py, and then

Re: Custom tags and "extends"

2008-09-22 Thread Karish
In short, the question is: How does a custom tag in a parent template access the nodes of the derived template in its render() function? Thanks! On Sep 22, 8:21 am, Karish <[EMAIL PROTECTED]> wrote: > I wrote a very simple custom tag, called oneline, which stips all > newline cha

Custom tags and "extends"

2008-09-22 Thread Karish
I wrote a very simple custom tag, called oneline, which stips all newline characters from whatever is inside it. I want to use it in a base template like this (base.txt): {% load text %}{% oneline %} {% block body %}{% endblock %} {% endoneline %} In the derived template (derived.txt) I just do:

Deleting and creating a model

2008-09-13 Thread Karish
Hi, I have two models in a one-to-one relationship: Phone and Antenna. In other words, within the Phone class I have this field: antenna = models.OneToOneField(Antenna, related_name='phone') What I want to do, given a specific antenna, is to delete its phone and add a different phone: antenna.

Re: Disconnected ORM objects

2008-06-13 Thread Karish
, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Fri, Jun 13, 2008 at 11:01 PM, Karish <[EMAIL PROTECTED]> wrote: > > I want to be able to use my ORM objects (eg, EmailMessage, > > EmailAddress) in some cases without a database. For example, I want to > > wr

Cascading updates/inserts

2008-06-13 Thread Karish
I want to create a bunch of objects that are interconnected in my model (eg, one Book and three Author objects) and then call save() on the Book object to add everything to the database. In other words, I don't want to have to call save() on each and every object (not only will it result in excess

Disconnected ORM objects

2008-06-13 Thread Karish
Hi, I want to be able to use my ORM objects (eg, EmailMessage, EmailAddress) in some cases without a database. For example, I want to write a function like download_email_messages that will download email messages and return an EmailMessage object which has a set of EmailAddress objects (for the