I'm having trouble creating models

2005-09-08 Thread jocknerd
Just updated Django to revision 632. Hadn't done anything with django in a couple of weeks. I started a new project with 'django-admin.py startproject projectname'. Added my database settings to it and ran 'django-admin.py init'. Everything working so far. Then created my app with 'django-adm

Re: I'm having trouble creating models

2005-09-08 Thread Maniac
jocknerd wrote: Just updated Django to revision 632. Hadn't done anything with django in a couple of weeks. The model syntax has changed some time ago: http://www.djangoproject.com/weblog/2005/aug/25/modelsyntax/

Can't figure out file upload

2005-09-08 Thread Maniac
I can't figure out a very simple file upload. I have a simple model with one-to-many relation: class Dashboard(meta.Model): name=meta.CharField(maxlength=20) class Thumbnail(meta.Model): dashboard=meta.ForeignKey(Dashboard) image=meta.ImageField(upload_to='...') 1. First problem is that D

Re: Can't figure out file upload

2005-09-08 Thread Dagur
I've been throught this too :) First of all, you need to use both {{ form.image}} and {{ form.image_file }} this will create the hidden file and the file input field. Also, if you forgot like I did, you need to put enctype="multipart/form-data" into the form tag. Thirdly, in the view, do this

Re: How to generate fieldsets from a ForeignKey ?

2005-09-08 Thread Sebastien Fievet
Well, maybe i'm not clear or there is no solution. Perhaps my solution would be in writing some GenericViews(http://www.djangoproject.com/documentation/generic_views/)...

Re: I'm having trouble creating models

2005-09-08 Thread jocknerd
Thanks. I saw that in the latest tutorial but I was using some old code. I'll make the adjustments.

Re: Django on Dreamhost

2005-09-08 Thread Adrian Holovaty
On 9/7/05, Eugene Lazutkin <[EMAIL PROTECTED]> wrote: > The only piece I need for true happiness with Django is caching. Dreamhost > doesn't provide memcached:. simple: is, well, too simple because it is not > thread-safe. If only we had mysql:, or file: cache option... Nudge, nudge, > wink, wink,

Sorted list of objects

2005-09-08 Thread Achim Domma
Hi, I'm just started to play with Django and it looks very promissing to me. For a small test app I would like to store sorted lists of items. In pure (Pseudo-)SQL I would do it like this: create table itemlists ( int unique_id, int name, ... ) create table items ( int unique_id

Re: Multiple Sites under One Database

2005-09-08 Thread [EMAIL PROTECTED]
That's great. So, the views don't, by default, consider SITE_ID then. Thanks much, A.

Re: Sorted list of objects

2005-09-08 Thread Jacob Kaplan-Moss
On Sep 8, 2005, at 8:56 AM, Achim Domma wrote: I'm just started to play with Django and it looks very promissing to me. For a small test app I would like to store sorted lists of items. In pure (Pseudo-)SQL I would do it like this: create table itemlists ( int unique_id, int name,

Re: Can't figure out file upload

2005-09-08 Thread Maniac
Dagur wrote: First of all, you need to use both {{ form.image}} and {{ form.image_file }} Ah! This did it. Thank you very much!

Re: Ticket #461 (enhancement) - Support use of pypgsql instead of psycopg

2005-09-08 Thread Carlo C8E Miron
2005/9/5, Tristan Lawrence <[EMAIL PROTECTED]>: > Well, my first problem was that blastwave.org does not have a psycopg package > for Solaris. But then I did a source install only to have it keep coredumping > on me :( hi tristan sorry for the late reply. have you seen the following post (and the

Re: User Authentication - What's the best way?

2005-09-08 Thread [EMAIL PROTECTED]
Documentation on authentication is still very much needed. The interim solution suggested earlier in this thread entails far too much code duplication when Django already has an auth system. Here's hoping it will be simple for apps to take advantage of the auth framework without having to (re)wr

Packaging django apps

2005-09-08 Thread Jason F. McBrayer
Hi. I've more-or-less finished a django app that might be useful to other people --- it's a feed reader similar to feedonfeeds, except that it is multiuser, supports categories, and is more tolerant of invalid feeds (thanks to the wonderful feedparser -- feedparser.org). It's basically functiona

Re: auto-generated template for generic views

2005-09-08 Thread Rachel Willmer
Following up on my original question, now I've read a bit more about it, the answer is of course to just use the admin interface. :-) If you run django-admin.py adminindex , it will auto-generate a copy of the guts of the index page needed to display the admin interface. You can copy that into yo

Re: Name in admin for Foreign Key's

2005-09-08 Thread Robert Wittams
Milton Waddams wrote: > I'm trying to associate multiple users with a team and each user having a > specific role within that team. > > eg. not my situation though easiest way to make it clear what I'm attempting > to achieve... > CEO = meta.ForeignKey(User) > CFO = meta.ForeignKey(User) > > w

Dealing with long operations in views

2005-09-08 Thread Jason F. McBrayer
Suppose a view, handling a POST, has to perform some task that can be reasonably expected to take a lot of time, long enough that it will often cause a timeout somewhere in the chain (between browser and webserver, between webserver and fastcgi server, etc). Suppose the view (as naively implement

Re: Name in admin for Foreign Key's

2005-09-08 Thread Adrian Holovaty
On 9/8/05, Robert Wittams <[EMAIL PROTECTED]> wrote: > I think this is a bug, but you can work around it using > > CEO = meta.ForeignKey(User, verbose_name="CEO" ) > CFO = meta.ForeignKey(User, verbose_name="CFO" ) > > I don't know why the name of the class is used in preference to the name > of

Re: RDBMS knowledge required?

2005-09-08 Thread Jakub Labath
Are you familiar with any sort of database? (think of RDBMS as if it was fancy version of Excel). The django itself doesn't force you to know anything about SQL. Perhaps the only exception is that you will need to know how to create and delete databases in (postgresql/mysql/sqllite/whichever you u

Re: Name in admin for Foreign Key's

2005-09-08 Thread Milton Waddams
perfect, thanks :)On 9/8/05, Robert Wittams <[EMAIL PROTECTED]> wrote: I think this is a bug, but you can work around it usingCEO = meta.ForeignKey(User, verbose_name="CEO" )CFO = meta.ForeignKey(User, verbose_name="CFO" )I don't know why the name of the class is used in preference to the name of t

Re: Packaging django apps

2005-09-08 Thread Jason Huggins
Jason F. McBrayer wrote: > Hi. I've more-or-less finished a django app that might be useful to > other people > I'd like to package this for other people in a way that is as convenient > for them as possible, while not requiring too much work from me. So, > what do people expect from a third-pa

Re: RDBMS knowledge required?

2005-09-08 Thread Jimmie Houchin
Hello Jakub, Thanks for the reply. Jakub Labath wrote: > Are you familiar with any sort of database? (think of RDBMS as if it > was fancy version of Excel). The django itself doesn't force you to > know anything about SQL. Perhaps the only exception is that you will > need to know how to create

Re: RDBMS knowledge required?

2005-09-08 Thread Adrian Holovaty
On 9/8/05, Jimmie Houchin <[EMAIL PROTECTED]> wrote: > I am familiar with and understand the above terms. I have gone half way > thru the Practical SQL Handbook. I just wanted to make sure I didn't > have to finish Joe Celko, and C.J. Date before proceeding. :) In that case, you should be fine. N