Re: ImageField Validation Error

2007-11-12 Thread drackett
I'm running into this exact same issue. Very few images I try are "valid" even though I can work with them in PIL by hand. On Nov 4, 1:27 pm, Matt <[EMAIL PROTECTED]> wrote: > I've got a model with an ImageField. But, when I attempt to add an > image via the Admin interface, I receive the error m

Trying to get unicode data into database from XML file

2007-09-21 Thread drackett
getting pretty frustrated, so I thought I would see if anyone had any ideas of what I might be doing wrong. here is my current code: import urllib import elementtree.ElementTree as ET try: tree = ET.parse(urllib.urlopen("http://ws.audioscrobbler.co

Re: get the latest # of objects

2007-04-22 Thread drackett
lice it: > entry_list[:5] > > just bear in mind that slicing will actually query the database, so > you need to do it when working with the data (e.g. not in urls.py when > providing parameters for generic views) > > On 4/22/07, drackett <[EMAIL PROTECTED]> wrote: &

get the latest # of objects

2007-04-22 Thread drackett
I love the ability to get the latest object in a collection.. entry_list.latest() and was curious if there is a way to get more than 1 object. For example, if I want the last 5 entries of a blog, is there something like entry_list.latest(5) I know that doesn't work, but is there an easy way to

Re: filtering by if a date field is empty

2007-04-22 Thread drackett
yep, thanks! On Apr 22, 1:38 pm, "Honza Král" <[EMAIL PROTECTED]> wrote: > On 4/22/07, drackett <[EMAIL PROTECTED]> wrote: > > > > > I am trying to grab objects from a model only if they are not complete > > using a context processor. This is the

filtering by if a date field is empty

2007-04-22 Thread drackett
I am trying to grab objects from a model only if they are not complete using a context processor. This is the code I have right now, but it doesn't work. Is there an easy way to filter by if a date field is empty/null? def event_open(request): from app.events.models import Event return {'

reverse relationships with ForeignKey?

2007-04-21 Thread drackett
I have an app that I'm building and I've run into a problem. I have 2 models "Entries" and "Updates" which points to "Entries" with a ForeignKey. The idea is that an entry can be updated at multiple times and I track the date and other meta information of the update within the update model. When

Re: check if a list contains a single item in a template

2007-04-20 Thread drackett
n/templates/#length-is > > There's also: > > {% ifequal list|length "2" %} > Two here! > {% endifequal %} > > http://www.djangoproject.com/documentation/templates/#length > > On 4/20/07, drackett <[EMAIL PROTECTED]> wrote: > > > > > Is

check if a list contains a single item in a template

2007-04-20 Thread drackett
Is there an easy way in djangos tempaltes to do any sort of counting? I want to check if a list of objects only has a single object, and if so display something. I could also see this being helpful for any number of things using differnt count values. Is this possible? --~--~-~--~~--

moving apps into a subfolder?

2007-04-20 Thread drackett
I would like to move my apps from the root folder of my site to a subfolder (apps.) I tried to match what I saw in the source for the django site, changing my settings.py from: INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib

Re: running into wall doing templates part of tutorial

2007-04-07 Thread drackett
thanks, that did it. The line above was indented with spaces, and the line below with a tab. That seems to have fixed it. On Apr 7, 4:43 pm, "Ian Clelland" <[EMAIL PROTECTED]> wrote: > On 4/7/07, drackett <[EMAIL PROTECTED]> wrote: > > > I have the followi

running into wall doing templates part of tutorial

2007-04-07 Thread drackett
I have the following code in my view: from django.shortcuts import render_to_response from warner.actions.models import ActionItem def index(request): action_list = ActionItem.objects.all().order_by('-start_date') return render_to_response('actions/index.html', {'action_list': action

dynamic FileFIeld path?

2007-04-05 Thread drackett
Can I use something dynamic (such as the post title, post date) in the part for uploaded files in the model? I'm guessing this isn't possible, but I thought it was worth asking anyways. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

common model

2007-03-30 Thread drackett
If I have multiple items that I want to use a common model, is there a way to do this? currently I have: class Link(models.Model): author = models.ForeignKey(User) link = URLField() description = TextField(blank=True) entry_date = models.DateTimeField(default=datet

Re: trying to setup field sets in admin, keep getting error

2007-03-30 Thread drackett
I see.. if there were more than one item in there, the last comma isn't necessary anymore, correct? ('more', { 'classes': 'collapse', 'fields' : ('entry_date', 'entry_something') }), On Mar 30, 2:50 pm, "James Bennett"

trying to setup field sets in admin, keep getting error

2007-03-30 Thread drackett
I am trying to setup field sets on my first project, however, when I add the admin section below, I get the error "My_blog has no field named 'e' " This error goes away if I remove the "fields=" from below. I got the code straight from the documentation, what am I doing wrong? :\ Thanks! class M

trying to setup field sets in admin, keep getting error

2007-03-30 Thread drackett
I am trying to setup field sets on my first project, however, when I add the admin section below, I get the error "My_blog has no field named 'e' " This error goes away if I remove the "fields=" from below. I got the code straight from the documentation, what am I doing wrong? :\ Thanks! class M