How to debug ORM filter stacking?

2010-09-24 Thread ydjango
I am stacking filters on queryset. For some reason the second filter in stack is not applying and it is not giving any error either. Any way to debug what is going on? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: How do you set choices in your application?

2010-09-24 Thread Russell Keith-Magee
On Sat, Sep 25, 2010 at 10:50 AM, Yo-Yo Ma wrote: > Anyone have any thoughts. Yes. My thought is that you should settle down. This is a mailing list, populated by an international audience. You've waited less than *2 hours* before pinging the list for a response. This

Re: Since Django 1.2.3, I can't display any Form

2010-09-24 Thread Karen Tracey
2010/9/24 François Bonnefont > I am new to this group and not sure how to present my problem > correctly... > > I was working with django 1.1 and made a very small and simple > application with a "ContactForm" not related to any model. > > My forms.py : > > from django

Re: Python unexpectedly quit

2010-09-24 Thread Axel Bock
maybe I was a little bit out of sleep today :) . tried to get auth.User subclassing working til 4am in the morning ... and what do you mean with "not picky enough"? 2010/9/24 Steve Holden > On 9/24/2010 2:23 PM, Axel Bock wrote: > > Anything wrong here? I must say, the

Re: Python unexpectedly quit

2010-09-24 Thread Steve Holden
On 9/24/2010 2:23 PM, Axel Bock wrote: > Anything wrong here? I must say, the framework for the people "with > deadlines" is giving me a *really* hard time so far :) . Maybe you aren't in enough of a hurry? And, by the way, it's *perfectionists* with deadlines. Maybe you aren't being picky

Re: How do you set choices in your application?

2010-09-24 Thread Yo-Yo Ma
Anyone have any thoughts. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more

Re: Problem with reversing url in test

2010-09-24 Thread Brandon Taylor
So it appears to be something with django-cms' urls that are causing issues with testing. I'm able to test any URL that isn't controlled by dajngo-cms, like '/admin/' or whatever. Anyone else using django-cms v2 and Django 1.1.1 experiencing these issues? TIA, Brandon On Sep 24, 6:40 am,

Re: The REAL superuser

2010-09-24 Thread Karen Tracey
On Fri, Sep 24, 2010 at 6:02 PM, aug dawg wrote: > Hey all, > > I'm currently learning how to use Django, so earlier this evening I spent > about 30 minutes working on a blog engine. I used the admin interface and > ran 'python manage.py syncdb'. I then run the dev server. I

Flatpages incorrect 302 to 404

2010-09-24 Thread Josh
I have a django project, its a satchmo store. I have noticed that when the flatpages middleware is in my settings.py 404s seem to be handled incorrectly. i.e. if a page really does not exist the server first sends a 302 response, then a 404. When google crawls it only sees the 302 so it thinks

Since Django 1.2.3, I can't display any Form

2010-09-24 Thread François Bonnefont
Hi, I am new to this group and not sure how to present my problem correctly... I was working with django 1.1 and made a very small and simple application with a "ContactForm" not related to any model. My forms.py : from django import forms class ContactForm(forms.Form): firstname =

The REAL superuser

2010-09-24 Thread aug dawg
Hey all, I'm currently learning how to use Django, so earlier this evening I spent about 30 minutes working on a blog engine. I used the admin interface and ran 'python manage.py syncdb'. I then run the dev server. I log in to the admin interface successfully, but then it says I don't have

Re: mod_wsgi, apache, windows XP

2010-09-24 Thread chauhonglinh
I believe that the error [Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1] Try using django.db.backends.XXX, where XXX is one of: [Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1] 'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3' [Fri Sep 03 08:36:25 2010]

How do you set choices in your application?

2010-09-24 Thread Yo-Yo Ma
Let's say I have a model with a field called "status". I could set the choices in three ways: 1) status_choices = ((1, 'Completed'), (2, 'Unfinished'), (3, 'Cancelled')) 2) status_choices = (('COM', 'Completed'), ('UNF', 'Unfinished'), ('CAN', 'Cancelled')) Or, 3 ): db_choices =

Re: subclassing UserCreationForm

2010-09-24 Thread Jason
> Well, first I can to "if X == Student: ...", and I know the fields will be > there. > Second, User will have no additional properties (as I understand), but once > I do "Model --> User" relations ALL users will have that property. So each > user might have the .course property, AND the .subject

Re: Python unexpectedly quit

2010-09-24 Thread Axel Bock
oh f... thanks. 2010/9/24 Scott Gould > > > def logout(request): > > logout(request) > > Infinite loop, no? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to

Re: Python unexpectedly quit

2010-09-24 Thread Scott Gould
> def logout(request): >     logout(request) Infinite loop, no? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: subclassing UserCreationForm

2010-09-24 Thread Axel Bock
2010/9/24 Jason > > "Creating the relationship between User and UserInfo has some > implications I'd like to avoid on a model-level" > > Specifically what are you referring to here? Because anytime you > subclass in Django you are basically doing the exact thing in the >

Re: Recommend a book

2010-09-24 Thread Tim Johnson
* Sandro Dutra [100924 09:28]: > "The Definitive Guide to Django: Web Developement Done Right", Apress, > updated Django 1.1 > "Pratical Django Projects", Apress, updated Django 1.1 Thanks for all the input. I know have the means to make a decision. cheers -- Tim

Re: subclassing UserCreationForm

2010-09-24 Thread Jason
Don't get me wrong - I'm not saying my way is right and I'm not saying anyone is doing anything necessarily wrong. I'm still a Django noob in a lot of ways. Just things to keep in mind - if you do have multiple types of users subclassing might be a bad idea if there are possibilities of being

Python unexpectedly quit

2010-09-24 Thread Axel Bock
HI all, another problem here: On my system (MacBook Pro, OS X newest version) Python "unexpectedly" quits when I invoke localhost:8000/logout. The code for that looks like this: #urls.py: urlpatterns += patterns('webflog.flightlog', # (r'^logout/', 'views.logout'), )

Re: fixtures and dates

2010-09-24 Thread Shawn Milochik
We need more information. Preferably the full traceback. In short, something is trying to add a date object to a unicode text object. Possibly the date as a date object and the time as a unicode string. How did you convert the original data to JSON? -- You received this message because you are

fixtures and dates

2010-09-24 Thread CrabbyPete
I have a spreadsheet of football games that I wanted to get into an sqlite3 database. I converted it to json, but when i loaded it I was required to put the date in -MM-DD format. So I changed it. The problem is now when I run the admin and look at the game I get this error

Re: Recommend a book

2010-09-24 Thread Sandro Dutra
"The Definitive Guide to Django: Web Developement Done Right", Apress, updated Django 1.1 "Pratical Django Projects", Apress, updated Django 1.1 2010/9/24 Shawn Milochik > > On Sep 24, 2010, at 6:53 AM, Franklin Einspruch wrote: > > > I recommend against Beginning Django

show mail as the option instead username in admin

2010-09-24 Thread Alexandre González
Hi! I like to show the email instead the username in the that django uses when you define you attrib as ForeignKey in your model. Anybody know how can I do this? Thanks! -- @agonzalezro Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx,

Re: subclassing UserCreationForm

2010-09-24 Thread Axel Bock
Thanks a lot for your answers. I thought subclassing users is a nice idea, cause a Student IS a user, with a few extended attributes. I decided to subclass users, because ... * when adding a UserInfo -> user relationship (class UserInfo(Model): user = ForeignKey('User')), ALL users having a

Re: subclassing UserCreationForm

2010-09-24 Thread Vasil Vangelovski
> Mainly, I just don't think you're subclassing User for the right > reasons. In fact, I can't really think of anytime I would subclass > it. Usually adding a related table is a better way to go (lookup > django user profiles for example). > There are times when the builtin User model is not

Re: subclassing UserCreationForm

2010-09-24 Thread Jason
I'm not sure how to solve your exact problem but I would recommend NOT extending the user class here. You'll probably want to create a manytomany field on your Course model that contains users. And if you're going to have many different types of users you'll want to create groups. Put students

Re: Universal form

2010-09-24 Thread Tran Cao Thai
isn't it unnatural to force user go around the site before going to the right place? Anyway, i will go around with all the ways first before making decision Thanks everybody On Sat, Sep 25, 2010 at 1:30 AM, Nick Arnett wrote: > I was tackling this problem recently and

Re: Universal form

2010-09-24 Thread Nick Arnett
I was tackling this problem recently and found several approaches by searching for Django login form. I ended up using a middleware solution that brings up a login page no matter where the user tries to go, then redirects them to the page they were trying to view... but that only makes sense if

Re: Universal form

2010-09-24 Thread Tran Cao Thai
a little bit search ends up with django-annoying. Is there anyone using it ? which one is better ? On Sat, Sep 25, 2010 at 1:25 AM, Shawn Milochik wrote: > Context processors will do this for you. > > >

Re: Universal form

2010-09-24 Thread Shawn Milochik
Context processors will do this for you. http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Universal form

2010-09-24 Thread Tran Cao Thai
Hello all, I have a login form that should appear in every pages of the site. How can i create it from the views file ? Since every form is triggered by calling a function in the views file, do i have to create the form in every function? -- You received this message because you are subscribed

Re: admin panel fieldsets for different type of users?

2010-09-24 Thread Profuel
We've faced with same and other problems linked to the same issue. The idea is that DJango caches every object that's used in Admin. So, when you do exclude field, you should get it back to form in other cases. -- if not request.user.is_superuser: self.exclude.append('A') else:

Re: File Upload Content Type Verification

2010-09-24 Thread Federico Capoano
Thanks. I'm concerned about the possibility of uploading and executing a script on the server. Just this. I think I can avoid this by hiding the file somewhere behind the public folder so the content is not accessible via http. On 24 Set, 13:31, Tom Evans wrote: > On

Re: Recommend a book

2010-09-24 Thread Shawn Milochik
On Sep 24, 2010, at 6:53 AM, Franklin Einspruch wrote: > I recommend against Beginning Django E-Commerce in favor of The > Definitive Guide. The project described in the former has you chasing > down so many details that it's hard to get a sense of the big picture. > As a second book it's more

Re: Problem with reversing url in test

2010-09-24 Thread Brandon Taylor
So here's something else that's weird... I can start a shell, load up the test Client and get the page in question: Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from

Re: File Upload Content Type Verification

2010-09-24 Thread Tom Evans
On Fri, Sep 24, 2010 at 12:23 PM, Federico Capoano wrote: > I can't trust the user because this field will be used in the > frontend, which will be an app similar to the django admin, but much > more limited. > > So according to what you said, there is no standard way to

RE: Re: File Upload Content Type Verification

2010-09-24 Thread Henrik Genssen
for images PIL does the job more or less well for all the filetypes and formats it knows (validation build in ImageField) I have recognized problems with some image file types... you may also do some virus scan... we added clamav (pyclamd) to the clean method... regards Henrik >reply to

Re: File Upload Content Type Verification

2010-09-24 Thread Federico Capoano
I can't trust the user because this field will be used in the frontend, which will be an app similar to the django admin, but much more limited. So according to what you said, there is no standard way to do this. the second solution seems interesting. But what if I wanted to restrict to images?

Re: File Upload Content Type Verification

2010-09-24 Thread Tom Evans
On Fri, Sep 24, 2010 at 11:28 AM, Federico Capoano wrote: > Is there a way we can check if a certain file being uploaded is really > what it claims to be? > Let's say I want to restrict files to PDF only, then I take a php > script and I rename it PDF I can still upload

Re: Problem importing model after inspectdb

2010-09-24 Thread bruno desthuilliers
On 24 sep, 02:33, Ivan wrote: > Hi all, > I'm trying to build a Django project by working through the handbook > but I'm having some problems accessing the database by referencing the > model I've created from it (by inspectdb). When attemping to do some > "Basic Data

Re: Recommend a book

2010-09-24 Thread Franklin Einspruch
I recommend against Beginning Django E-Commerce in favor of The Definitive Guide. The project described in the former has you chasing down so many details that it's hard to get a sense of the big picture. As a second book it's more informative. Franklin On Thu, Sep 23, 2010 at 11:21 PM, Ivan

Re: Newbie: Operational Error 1060 Duplicate column name

2010-09-24 Thread bruno desthuilliers
On 24 sep, 05:20, Howard Wolf wrote: > I want the foreign key to be called taxonomy_kingdom. > > So would I do something like this? > > taxonomy_kingdom = models.ForeignKey(TaxonomyKingdom, null=True, blank=True) > superior=taxonomy_kingdom This will yield the exact same

File Upload Content Type Verification

2010-09-24 Thread Federico Capoano
Is there a way we can check if a certain file being uploaded is really what it claims to be? Let's say I want to restrict files to PDF only, then I take a php script and I rename it PDF I can still upload it if using the following custom FileField that I just worked out yesterday: from

Re: Django Accounts - User account 'component'

2010-09-24 Thread Benedict Verheyen
On 23/09/2010 18:04, Guiga wrote: > Hi guys, > > I'd like to know if django have a "component" (or some like this) to > create, edit and login user's accounts. I mean, some like a system > user accounts to work with django. > > Thanks. > Hi, as mentioned you can use the authentication system

Re: Relationship between multiple sites & projects, apps

2010-09-24 Thread Benedict Verheyen
Hi Brian, 2 valid points that i hadn't even considered. I'm also leaning towards using 1 project for 1 site. I'm interested however why you don't use several apps then in a site? 1 app might be the authentication, another a blog and so on. Wouldn't it be more useful if you try to seperate the

Re: Why Django Apps Suck

2010-09-24 Thread Venkatraman S
On Fri, Sep 24, 2010 at 12:09 PM, Klaas van Schelven < klaasvanschel...@gmail.com> wrote: > > http://djangocon.eu/ is going to be in the spring of 2011. Let's see > how many of the "best of the bunch" are going to make it to > Amsterdam :-) > > Wanted to attend this year. Missed. How was it? -V-

Re: subclassing UserCreationForm

2010-09-24 Thread Axel
All right, I found some sources. http://stackoverflow.com/questions/1061279/for-the-django-admin-how-do-i-add-a-field-to-the-user-model-and-have-it-editable http://blog.picante.co.nz/post/Subclassing-User-to-add-extra-fields-in-the-Django-Admin-Site/ By strictly holding to these, and by

Re: Why Django Apps Suck

2010-09-24 Thread Klaas van Schelven
> > Sure. However, Djangocon 2010 finished a week ago, so you're going to > have to wait until next year before we have the next serious > opportunity to do this. > http://djangocon.eu/ is going to be in the spring of 2011. Let's see how many of the "best of the bunch" are going to make it to