FileField not working, however ImageField is.

2008-05-17 Thread Rodrigo Culagovski
I have a FileField in a model that's not working. When I try to upload a file via the admin site, nothing is uploaded and I get a validation error (as if I hadn't filled in the field). In the same application but different model, I have ImageFields that work fine. I changed the 'upload_to' paramet

Re: Image upload not working in newforms admin?

2008-05-17 Thread Graham Dumpleton
On May 17, 5:18 am, mw <[EMAIL PROTECTED]> wrote: > I'm having nothing but tons of trouble right now with the image field > upload.  I don't know what the problem is for sure, yet, but yeah I > think that I'm willing to say that the ImageField isn't as easy to get > working as it should be :-/ > >

How to add custom user fields to UserCreationForm?

2008-05-17 Thread matimba
I am already using UserCreationForm in my view to register users -- all OK. Now I want to add custom user fields in my Profile model to my registration form. I already created a Profile model linked and linked it to User model. What do I need to do to get the Profile fields in my template? B

Get table name at runtime

2008-05-17 Thread mwebs
Hi, is there any possibility to get the db table name of a model instance at runtime (news.get_table_name())? Thanks, Toni --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Re: Get table name at runtime

2008-05-17 Thread Matthias Kestenholz
Hi, On Sat, 2008-05-17 at 00:44 -0700, mwebs wrote: > Hi, > > is there any possibility to get the db table name of a model instance > at runtime > (news.get_table_name())? Yes: News._meta.db_table and news_object._meta.db_table both work. I think that _meta is an implementation detail however

Re: Get table name at runtime

2008-05-17 Thread mwebs
Perfect! that is what I was searching for!!! Thanks, Toni On 17 Mai, 09:50, Matthias Kestenholz <[EMAIL PROTECTED]> wrote: > Hi, > > On Sat, 2008-05-17 at 00:44 -0700, mwebs wrote: > > Hi, > > > is there any possibility to get the db table name of a model instance > > at runtime > > (news.get_t

ForeignKey information at runtime

2008-05-17 Thread mwebs
Hi, is there any possibility to get the field from a model instance that speciefies a foreignkey-relationship. something like this: news.__foreignKey__ # returns 'category' Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: How to add an object with relations to other objects

2008-05-17 Thread jabbercat
Hello, the answer for question 1 I already find out, thank you. According to question 2, I'm not meaning without a relation between A and B. There must be a relation between them. So I describe my problem again in a more understandable way, I hope. I have two models A and B with an one(A)-to-ma

Re: Problem with : Updating multiple objects at once

2008-05-17 Thread Russell Keith-Magee
On Sat, May 17, 2008 at 12:10 AM, mwebs <[EMAIL PROTECTED]> wrote: > > News.objects.filter(sequence__gt = msequence).update(sequence = > sequence-1) ... > Is there any possibility to solve this problem without iterating over > all results with News.objects.filter(sequence__gt = msequence) and >

Re: Add column to generated ManyToMany table and access from admin

2008-05-17 Thread Russell Keith-Magee
On Sat, May 17, 2008 at 2:19 AM, Peter Bailey <[EMAIL PROTECTED]> wrote: > > However, I would really like to add a column to the join table, > "order", so I can use the admin of my Page class to add Items and > define their order on that particular page. Is there a way to do this? At present, thi

Re: ForeignKey information at runtime

2008-05-17 Thread Matthias Kestenholz
On Sat, 2008-05-17 at 00:59 -0700, mwebs wrote: > Hi, > > is there any possibility to get the field from a model instance that > speciefies a foreignkey-relationship. > > something like this: > > news.__foreignKey__ # returns 'category' Just inspect news._meta.fields, you'll find what you ne

Re: ForeignKey information at runtime

2008-05-17 Thread mwebs
Thank you, thats exactly what I was looking for. But how can I test if a field is a ForeignKey? On 17 Mai, 11:01, Matthias Kestenholz <[EMAIL PROTECTED]> wrote: > On Sat, 2008-05-17 at 00:59 -0700, mwebs wrote: > > Hi, > > > is there any possibility to get the field from a model instance that >

Re: ForeignKey information at runtime

2008-05-17 Thread mwebs
I found the soultion: news._meta.fields[x].get_internal_type() this returns 'ForeignKey' if the field is a FK. On 17 Mai, 12:06, mwebs <[EMAIL PROTECTED]> wrote: > Thank you, > > thats exactly what I was looking for. > But how can I test if a field is a ForeignKey? > > On 17 Mai, 11:01, Matth

Dynamic lookup

2008-05-17 Thread mwebs
Hello, I am using something like this: model.objects.filter(field = variable) Is it possible to pass the field that is used for the lookup dynamically, so that field is also a variable ? Thanks, Toni --~--~-~--~~~---~--~~ You received this message because you ar

Re: Dynamic lookup

2008-05-17 Thread Scott Moonen
Toni, you can do this, for example: fieldname1 = "field" fieldname2 = "field2__ge" model.objects.filter(**{ fieldname : variable, fieldname2 : variable2}) -- Scott On Sat, May 17, 2008 at 7:11 AM, mwebs <[EMAIL PROTECTED]> wrote: > > Hello, > > I am using something like this: > > model.object

Re: Dynamic lookup

2008-05-17 Thread Ronny Haryanto
On Sat, May 17, 2008 at 6:11 PM, mwebs <[EMAIL PROTECTED]> wrote: > I am using something like this: > > model.objects.filter(field = variable) > > Is it possible to pass the field that is used for the lookup > dynamically, so that field is also a variable ? It's python kwargs (keyword arguments).

Re: Dynamic lookup

2008-05-17 Thread mwebs
Thank you Scott and Ronny! This was a great help. On 17 Mai, 13:20, "Ronny Haryanto" <[EMAIL PROTECTED]> wrote: > On Sat, May 17, 2008 at 6:11 PM, mwebs <[EMAIL PROTECTED]> wrote: > > I am using something like this: > > > model.objects.filter(field = variable) > > > Is it possible to pass the fi

Getting FK-Value without knowing the name of the field

2008-05-17 Thread mwebs
Hello, I need something like this: modelObject.fk// returns the FK-value of the modelObject --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: How to use a string in filter()

2008-05-17 Thread caustic
On May 17, 9:13 am, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > Hi All, > > I am back with another query > > I have this (generic) view function > > --8>< > def object_list(request, object, filter_string = None): > if filter_string: >

Re: How to add an object with relations to other objects

2008-05-17 Thread Richard Dahl
You can always just pass the id of A into the template for creating the B and have it submitted along with the form. Then after you save the B you will have to get the A and save the instance of B to its relation. -richard On May 17, 2008, at 3:02 AM, jabbercat wrote: > > Hello, > > the

Setting up multiple sites

2008-05-17 Thread Greg Lindstrom
I am ready to deploy my first Django site on the web and am looking at starting another. Are there any collective thoughts on whether I should add the new app to my existing Django project or start an entire new project? I don't want to get site data mixed together, but I will have a number of c

hasNoProfanities doesn't work

2008-05-17 Thread Dan Kelley
Hi. I'm using the latest development version (svn'd today). I think I'm missing something on hasNoProfanities. I have the following in my model: from django.core import validators ... content = models.TextField(validator_list=[validators.hasNoProfanities]) and in my settings.py file

Re: Problems with generic.GenericForeignKey()

2008-05-17 Thread Josh
Ah, I see. Thanks, I'll give that a shot. On Mar 28, 6:52 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Mar 28, 9:16 pm, Josh <[EMAIL PROTECTED]> wrote: > > > I've determined that the problem is with the get(). If I just create > > the objects without first checking to see if it already exis

Re: Setting up multiple sites

2008-05-17 Thread Horst Gutmann
You could still connect to the same database from both sites but distinct the content that should *not* be shared using a site_id. For stuff like that the django.contrib.sites framework should be quite useful :-) http://www.djangoproject.com/documentation/sites/ - Horst On Sat, May 17, 2008 at

Re: How to use a string in filter()

2008-05-17 Thread M.Ganesh
caustic wrote: > > On May 17, 9:13 am, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > >> Hi All, >> >> I am back with another query >> >> I have this (generic) view function >> >> --8>< >> def object_list(request, object, filter_string = None

How best to place multiple orders from same screen?

2008-05-17 Thread Kenneth McDonald
I'm designing an order system wherein each order will be an object. However, most customers will typically want to order more than one thing at once. To make things easier for the user, I'd like to allow them to enter, say, up to 5 orders on the same screen. Each order will then be stored

Any examples of django order-processing systems out there?

2008-05-17 Thread Kenneth McDonald
Just wondering, it's always nice to see how others have done things. Thanks, Ken --~--~-~--~~~---~--~~ 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.c

Re: How best to place multiple orders from same screen?

2008-05-17 Thread John Hensley
Malcolm has a good how-to for this: http://www.pointy-stick.com/blog/2008/01/06/django-tip-complex-forms/ On May 17, 2008, at 12:16 PM, Kenneth McDonald wrote: > I'm designing an order system wherein each order will be an object. > However, most customers will typically want to order more than

Re: Secure file access with contrib.auth

2008-05-17 Thread John Hensley
You can do this with Apache. You need to add mod_xsendfile (http://tn123.ath.cx/mod_xsendfile/ ) to your Apache config, then control access to the files with a Django view. A quick search of this group turns up references to mod_xsendfile, but no example view, so here's what it might look li

sell dunk.gucci,prada,Adidas,rift,Puma,Gucci,Prada,Timberland.Ice,D&G,Adio,Armani,DC,ES,Lacoste,4US,Converse

2008-05-17 Thread BBNIKE
www.bbnike.com ,We are a leading company that wholesales shoes :Nike,Jordan,dunk,shox,max,air force one,james,dunk.gucci,prada,Adidas,rift,Puma,Gucci,Prada,Timberland.Ice,D&G,Adio,Armani,DC,ES,Lacoste, 4US,Converse,bape.chanel,hongan,tods,richmond,eneruie,dsquared,diesel.armant,dior,ice cream,kid

Re: loaddata .. columns app_label, model are not unique

2008-05-17 Thread Carl Karsten
patch submitted: http://code.djangoproject.com/ticket/7254 Carl K --~--~-~--~~~---~--~~ 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 unsubscr

Re: Any examples of django order-processing systems out there?

2008-05-17 Thread Peter Rowell
You might want to look at Satchmo. I think it's at 0.7 right now. http://groups.google.com/group/satchmo-users --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

How does one use model data in forms?

2008-05-17 Thread Kenneth McDonald
For example, I want foreign keys to show up as popup lists. Also, I'd like to get the date widget in a user form the same as it is in the Admin interface. These are broad questions, so I guess the real question is, "Where do I read how to do this". Haven't found it in the book yet. Thanks

TypeError: Cannot resolve keyword 'slug' into field

2008-05-17 Thread Brian
I've searched for this, but people think it is either fixed or very hard to reproduce. In my case it is 100% reproducible, and I wonder if it is my own fault. I have a model for a mp3 set (a set of mp3s). Individual mp3's are associated with the set via a Foreign key. I recently added a slug fie

Accept paypal www tradertrade com supply nike jordan shoes airforce one shoes nike air max ltd 90 95 97 87 89 tnshoes

2008-05-17 Thread www.tradertrade.com
www tradertrade com --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL PROTECT

Re: Admin : Select category -> show subcategory

2008-05-17 Thread Diego Ucha
You need to set a Subcategory as default when this field is loaded by the field Category? Sorry Martyn, i didn't get your doubt, could you elaborate more? On May 13, 2:23 am, martyn <[EMAIL PROTECTED]> wrote: > It's true, I don't know for what reason I changed this before posting, > but I've seen

10 Reasons why PCs crash

2008-05-17 Thread Dilani Reddy
10 Reasons why PCs crash Fatal error: the system has become unstable or is busy," it says. "Enter to return to Windows or press Control-Alt-Delete to restart your computer. If you do this you will lose any unsaved information in all open applications." You have

Re: Caching: Memcached vs locmem

2008-05-17 Thread [EMAIL PROTECTED]
I managed to get memcached up and running in about 5 minutes, so whilst it does involve more setup than locmem I wouldn't say it's difficult to the point of not being worth doing. Memcached is basically more efficient in general and supports clustering which makes it much better for scalability

Re: Caching: Memcached vs locmem

2008-05-17 Thread Brian
On May 17, 7:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I managed to get memcached up and running in about 5 minutes, so > whilst it does involve more setup than locmem I wouldn't say it's > difficult to the point of not being worth doing. Thanks for that. I'll likely give it a try.

Latest IT Books

2008-05-17 Thread Dilani Reddy
- Core Java 2 - Volume II - Advanced Features, 7th E... - Creating Games In C++ - A Step By Step Guide (2006... - Cryptogra

Re: sell dunk.gucci,prada,Adidas,rift,Puma,Gucci,Prada,Timberland.Ice,D&G,Adio,Armani,DC,ES,Lacoste,4US,Converse

2008-05-17 Thread BBNIKE
www.bbnike.com ,We are a leading company that wholesales shoes :Nike,Jordan,dunk,shox,max,air force one,james,dunk.gucci,prada,Adidas,rift,Puma,Gucci,Prada,Timberland.Ice,D&G,Adio,Armani,DC,ES,Lacoste, 4US,Converse,bape.chanel,hongan,tods,richmond,eneruie,dsquared,diesel.armant,dior,ice cream,ki