Re: Django's documention is horrible

2011-01-11 Thread derek
My 2c (as a lowly Django user). Having used Another Large Web Framework (open source) for nearly 10 years, I can say with confidence that Django's human-written documentation is superb. The ALWF documentation was never kept up-to-date (and the online API did not really help much) - the user's had

Re: TestCase and fixtures

2011-01-11 Thread Simone Dalla
Thank Shawn 2011/1/11 Shawn Milochik > It sounds like you're doing everything correctly. > > Just a few thoughts: > >Is your app definitely in INSTALLED_APPS in settings.py? > Yes > >Check typos in fixture name and filename (and include extension in > test). > Are ok. > >Are yo

Runtime Error: maximum recursion depth exceeded while calling Python object

2011-01-11 Thread Derek
Working with Django 1.2.3 I had an application that was running well. However, some recent changes (not to the models themselves) have caused the "Runtime Error: maximum recursion depth exceeded while calling Python object" to start showing up everywhere; typically in conjunction with the def __u

Re: TestCase and fixtures

2011-01-11 Thread Simone Dalla
2011/1/12 Piotr Zalewa > Hi Simone > > Try fixtures = ['myfix'] Thank Piotr, I've already done but same result: No fixtures found. ... -- Ran 3 tests in 0.419s -- Simo - Registered Linux User #395060 - Software is like sex

Re: Django's documention is horrible

2011-01-11 Thread Doug Ballance
The reason I chose django in the first place was the documentation. Compared to everything out there, it was incredible. Back then it also had a helpful comments section on each page where people chimed in to clarify various parts of the document. It reads like a text book, which is a big help wh

how to change the default label on a readonly ForeignKey

2011-01-11 Thread wongtsefei
Hi, I'm using django 1.2.4. On the admin, the default label for a ForeignKey field reference to User is User.username. This is less desirable to me and I am able to create a full name label on a drop-down menu, by subclassing ModelChoiceField and overriding label_from_instance as per the django

Re: empty DateTimeField?

2011-01-11 Thread chris
As Justin mentioned, my guess is that you would have to manually update the table definition to allow nulls for that column. On Jan 11, 7:21 pm, galago wrote: > I tried but I get: > Exception Type: IntegrityError Exception Value: > > (1048, "Column 'publish_date' cannot be null") > > Exception L

login failed with correct username and password

2011-01-11 Thread Lin Tao(EXT-VanceInfo/Beijing)
Hi, I encounter this problem that I failed to login to my app with correct username and password. I'm wondering if there is something wrong with my login form. Here is what it looks like: from django import forms from django.contrib import auth class LoginForm(forms.Form): usernam

Re: Configure LAMPP with Django

2011-01-11 Thread Kenneth Gonsalves
On Tue, 2011-01-11 at 04:51 -0800, evstevemd wrote: > I have learned alot in these few threads. Now my question was how do I > deploy different Django apps using same Apache server. use virtual hosts - one virtual host per project - and keep your projects somewhere in the file system, each in it'

Re: Configure LAMPP with Django

2011-01-11 Thread Kenneth Gonsalves
On Tue, 2011-01-11 at 07:39 -0500, Javier Guerra Giraldez wrote: > On Tue, Jan 11, 2011 at 2:37 AM, Kenneth Gonsalves > wrote: > > On Mon, 2011-01-10 at 11:12 -0500, Javier Guerra Giraldez wrote: > >> Django is not a page-based template system like PHP. it's a > >> long-running application that a

Re: Email and activation key in django.contrib.auth

2011-01-11 Thread Shawn Milochik
Yes, it's very easy to do. For the e-mail address as the login, all you have to do is create your own auth backend. That is a LOT simpler than it sounds -- just a few lines of code. http://docs.djangoproject.com/en/dev/topics/auth/#writing-an-authentication-backend As for the need to activate t

Re: Django's documention is horrible

2011-01-11 Thread Kevin Monceaux
On Tue, Jan 11, 2011 at 05:12:46PM -0600, Kevin Monceaux wrote: > Do you mean like the reference manual one can build from Django > source? The above wasn't entirely clear. I meant the manual one can build from the documentation source code which is included the Django source tarball. -- K

Email and activation key in django.contrib.auth

2011-01-11 Thread Micah Carrick
Hey guys, I've been looking into this for a few hours now and don't have a good solution. I want to use the built in authentication system for a project. However, it's essential that (a) users login using their email address and password only (no username or username=email) and that (b) they must

Re: empty DateTimeField?

2011-01-11 Thread Justin Murphy
Did you create a new DB and run syncdb or is it the same DB based on the old schema? -Justin -- 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, se

Re: empty DateTimeField?

2011-01-11 Thread galago
I tried but I get: Exception Type: IntegrityError Exception Value: (1048, "Column 'publish_date' cannot be null") Exception Location: C:\Python27\lib\site-packages\MySQLdb\connections.py in defaulterrorhandler, line 36 Field definition: publish_date = models.DateTimeField(editable=False, bla

Login support for external applications?

2011-01-11 Thread Stodge
I need to let client applications, primarily written in Java and Python login to my Django site. What's the best way? Request the form, parse it and POST the username, password and csrf token? Or provide an Ajax login view? -- You received this message because you are subscribed to the Google G

Re: Problem with django auth login_required and lighttpd

2011-01-11 Thread Eric Chamberlain
John, We have a similar configuration, try adding: FORCE_SCRIPT_NAME = '' to settings.py On Jan 11, 2011, at 2:44 PM, John Finlay wrote: > I'm trying to serve django pages using mod_fastcgi from a lighttpd server. > Everything works well using the setup recommended in the documentation excep

Re: Django's documention is horrible

2011-01-11 Thread Kevin Monceaux
On Tue, Jan 11, 2011 at 12:36:26AM -0800, mrmclovin wrote: > I guess your post should be replaced by my first one :). It's exactly > what I was trying to say: django need a reference manual to complement > the existing documentation. Do you mean like the reference manual one can build from Django

Re: TestCase and fixtures

2011-01-11 Thread Piotr Zalewa
Hi Simone Try fixtures = ['myfix'] On 01/11/11 21:25, Simone Dalla wrote: > Hi! > > I'm testing my application with a TestCase class, specifing "fixtures" > attribute in my class like: > > class MyTestCase(TestCase): > fixtures = ['myfix.json'] > > > I've created the folder "fixt

Problem with django auth login_required and lighttpd

2011-01-11 Thread John Finlay
I'm trying to serve django pages using mod_fastcgi from a lighttpd server. Everything works well using the setup recommended in the documentation except for the initial login. The porblem seems to be that when the user tries: http://server/ the login page comes up with a url of: http://serve

TestCase and fixtures

2011-01-11 Thread Simone Dalla
Hi! I'm testing a part of my application with a TestCase class specifing the 'fixtures' attributes like -- 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

Re: TestCase and fixtures

2011-01-11 Thread Shawn Milochik
It sounds like you're doing everything correctly. Just a few thoughts: Is your app definitely in INSTALLED_APPS in settings.py? Check typos in fixture name and filename (and include extension in test). Are you definitely using a Django TestCase instead of a unittest TestCase?

Re: empty DateTimeField?

2011-01-11 Thread Justin Murphy
Yes. A quick read of the Model Field Reference docs would have answered this. my_date = models.DateTimeField(blank=True, null=True). http://docs.djangoproject.com/en/dev/ref/models/fields/ -Justin -- You received this message because you are subscribed to the Google Groups "Django users" gro

TestCase and fixtures

2011-01-11 Thread Simone Dalla
Hi! I'm testing my application with a TestCase class, specifing "fixtures" attribute in my class like: class MyTestCase(TestCase): fixtures = ['myfix.json'] I've created the folder "fixtures" in my directory application like: /home/simo/Projects/myproject/myapp/fixtures/myfix.json

Re: Django's documention is horrible

2011-01-11 Thread Rainy
On Jan 11, 3:36 am, mrmclovin wrote: > On Jan 11, 7:44 am, Sam Lai wrote: > > > > > > > > > > > On 11 January 2011 13:39, Christophe Pettus wrote: > > This isn't about patches to the existing docs (which are great for > > their purpose). It is about Django missing an API reference manual, > >

empty DateTimeField?

2011-01-11 Thread galago
Is it possible to set DateTimeField in model to be empty? I don't want to set it when adding it to database but edit it in future. -- 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.co

Re: image servers?

2011-01-11 Thread garagefan
wow, this supports rackspace's cloud files already so i'll definitely be taking a gander. On Jan 11, 12:25 pm, Eric Chamberlain wrote: > You might want to look at django-storages > .  We use it with S3. > > On Jan 10, 2011, at 4:55 PM, garag

Re: Screen/Form Fields

2011-01-11 Thread Tim Sawyer
Yep, something like this (which is off the top of my head - syntax /detail may be incorrect!) Pea Fish Bean Then, in jQuery $('#flavours').change(function(){ var lValue = $('#flavours').val(); if (lValue === "P"){ $('#toppings').show(); } else { $('#toppings').hide();

Re: image servers?

2011-01-11 Thread kRON
What your looking for is exactly achieved by providing a custom default file storage class. Have a look at: http://docs.djangoproject.com/en/1.2/ref/settings/#default-file-storage http://docs.djangoproject.com/en/1.2/topics/files/#file-storage Here's a simple example of how it might work in your

HTML special chars in form labels

2011-01-11 Thread Vsevolod
Django known to escape whole form label text. Still I have a need to insert special characters (nbsp, dashes etc.) into the label text. Is there any way to do it or disable escaping? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: image servers?

2011-01-11 Thread Eric Chamberlain
You might want to look at django-storages . We use it with S3. On Jan 10, 2011, at 4:55 PM, garagefan wrote: > so i bit the hype and got myself a rackspace cloud account. i also got > a rackspace file account for image serving. i would lik

Re: Field permissions in admin

2011-01-11 Thread Leandro Ardissone
Ok, I've just figured out, by using the get_form modelAdmin method. Here's my solution in case someone find it helpful: class EventAdmin(admin.ModelAdmin): list_display = ('title', 'description') search_fields = ('title', 'description') inlines = [OccurrenceInline] def get_fo

Re: Generic views

2011-01-11 Thread Dorival Ben Molinari Martinez
Thank you. I am reading the tutorial 'Django - writing your first app'. version 1.2. 2011/1/11 Piotr Zalewa > On 01/11/11 14:02, martinez wrote: > > I would like to know if I could work without generic views. > > > Sure you can - simply define your own in [application]/views.py > > Please read t

Re: default _ storage path

2011-01-11 Thread prasad iyer
Give www-data rwx permission /va/www/dir and start the application using the user who is member of www-data On Jan 11, 4:56 am, Tonton wrote: > hello > may we use default storage to write outside of project or only in media > because i can writ in media path ... > > my porject : /home/user/projec

Re: default _ storage path

2011-01-11 Thread urukay
One solution is to create your own storage to upload files outside MEDIA folder. Also you will have to write own views to rwtrieve and display these files. Or you have to configure your server to serve static files in the way you want. Maybe there's better solution, but i did it this way. Radovan

Field permissions in admin

2011-01-11 Thread Leandro Ardissone
Hi, I don't know if it's possible or if there's a better way to do that. I'm working on a website with 3 user groups (administrators, moderators and content editors). All of them can edit content, but I want to remove some fields from the content for the editors and moderators groups. For exam

Re: Generic views

2011-01-11 Thread Marc Aymerich
On Tue, Jan 11, 2011 at 3:02 PM, martinez wrote: > I would like to know if I could work without generic views. > > This issue was discussed in this list a couple months ago: http://groups.google.com/group/django-users/browse_thread/thread/a67d36c94efc2d3f/9cd7c5299ac74f13 -- Marc -- You rec

Re: Generic views

2011-01-11 Thread Piotr Zalewa
On 01/11/11 14:02, martinez wrote: > I would like to know if I could work without generic views. > Sure you can - simply define your own in [application]/views.py Please read the doc http://docs.djangoproject.com/en/1.2/#the-view-layer zalun -- blog http://piotr.zalewa.info jobs http://webdev

Generic views

2011-01-11 Thread martinez
I would like to know if I could work without generic views. -- 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.

Re: image servers?

2011-01-11 Thread garagefan
Rackspace has an API for connecting to the server and writing to it... I'll see if the ability to mount it is there as that would be... amazing On Jan 10, 10:59 pm, Dustin wrote: > I haven't used Rackspace, but i would assume (hope) they support > remote mounting. > > I would use sshfs to mount t

Re: Django's documention is horrible

2011-01-11 Thread Masklinn
On 2011-01-11, at 14:39 , shofty wrote: > but by the same token, ive not seen a mailing list that hasn't made me > want to gouge my own eyes out. its not a great place for reading code > is it? you can't do a [code] [/code] to isolate an example on it. If you configure your MUA to display text with

Re: Django's documention is horrible

2011-01-11 Thread shofty
but by the same token, ive not seen a mailing list that hasn't made me want to gouge my own eyes out. its not a great place for reading code is it? you can't do a [code] [/code] to isolate an example on it. the point im trying to make is that your choice isn't necessarily my choice. who is right? (

Re: Django's documention is horrible

2011-01-11 Thread mrmclovin
On Jan 11, 1:51 pm, Masklinn wrote: > On 2011-01-11, at 13:47 , mrmclovin wrote:> On Jan 11, 9:59 am, Masklinn > wrote:y? > > Because you don't have to compile APIDocs to be able to use Django. > Okey, the analogy was not about django itself, but a reference manual. > In fact the APIDocs are

Re: Follow relations on three tables

2011-01-11 Thread Matias Aguirre
So, basically you want this: C.objects.filter(Bref__Dref__id=D_id).values_list('Aref') Matías Excerpts from gia...@gmail.com's message of Tue Jan 11 07:58:05 -0200 2011: > Let's say I have a model like: > > class A: > > class B: > Dref = ForeignKey('D') > > class C: > Aref = ForeignKey('A'

Follow relations on three tables

2011-01-11 Thread gia...@gmail.com
Let's say I have a model like: class A: class B: Dref = ForeignKey('D') class C: Aref = ForeignKey('A') Bref = ForeignKey('B') class D: I also have a view taking a D_id parameter and in this view I would like to create and show the list of A objects that are related to D through the B a

default _ storage path

2011-01-11 Thread Tonton
hello may we use default storage to write outside of project or only in media because i can writ in media path ... my porject : /home/user/project and i 'd like to write in /var/www/myoutputdirectory own by what ever you want but i've truy www-data and the user in my WSGIDaemon in apache conf f

Re: Django's documention is horrible

2011-01-11 Thread Masklinn
On 2011-01-11, at 13:47 , mrmclovin wrote: > On Jan 11, 9:59 am, Masklinn wrote: >> >> This analogy makes no sense whatsoever, I fear. > > hehe why? Because you don't have to compile APIDocs to be able to use Django. In fact the APIDocs are pretty irrelevant to a new Django user, and the handc

Re: Configure LAMPP with Django

2011-01-11 Thread evstevemd
Thanks friends, I have learned alot in these few threads. Now my question was how do I deploy different Django apps using same Apache server. I tried instructions in links given above but I ended screwing my Apache and ended falling back. May be my PHP background keeps me that way. Please help me a

Re: Django's documention is horrible

2011-01-11 Thread mrmclovin
On Jan 11, 9:59 am, Masklinn wrote: > > This analogy makes no sense whatsoever, I fear. hehe why? Wouldn't it be nice to host an online reference instead of letting users "compile" the source themselves? Guess I will try pydoc now and get my own html reference. I hope next time someone is lookin

Re: Configure LAMPP with Django

2011-01-11 Thread Javier Guerra Giraldez
On Tue, Jan 11, 2011 at 2:37 AM, Kenneth Gonsalves wrote: > On Mon, 2011-01-10 at 11:12 -0500, Javier Guerra Giraldez wrote: >> Django is not a page-based template system like PHP.  it's a >> long-running application that answers web requests. > > I do not think it is a long running application '

Re: Reconnecting after a database restart

2011-01-11 Thread Brennan Sellner
On Mon, 2011-01-10 at 09:09 -0800, Euan Goddard wrote: > As far as I know Django maintains a persistent connection to the > database server and restarting the server without restarting the > client isn't possible. We never restart our live database server in > production (we fail over to a secondar

Re: Flatten template?

2011-01-11 Thread Danny Adair
Just in case someone needs this... I now have a working module. It "resolves" via the source files - no context, no "real rendering". Therefore only literal string parameters are supported for the template paths of {% extends ... %} and {% include ... %}. That's ok for my current purposes. Otherwi

Re: upload files via ajax

2011-01-11 Thread Mauro
On 11 Gen, 12:05, Łukasz Rekucki wrote: > On 11 January 2011 11:28, Jani Tiainen wrote: > > > > > > > On Monday 10 January 2011 16:05:13 Mauro wrote: > >> On 23 Dic 2010, 23:12, Paul Osman wrote: > >> > On Thu, Dec 23, 2010 at 9:39 AM, Mauro wrote: > >> > > Hello, > >> > > is it possible toup

Re: upload files via ajax

2011-01-11 Thread Łukasz Rekucki
On 11 January 2011 11:28, Jani Tiainen wrote: > On Monday 10 January 2011 16:05:13 Mauro wrote: >> On 23 Dic 2010, 23:12, Paul Osman wrote: >> > On Thu, Dec 23, 2010 at 9:39 AM, Mauro wrote: >> > > Hello, >> > > is it possible to upload files via ajax? >> > > >> > > I would like to upload multip

Re: Django's documention is horrible

2011-01-11 Thread Masklinn
On 2011-01-11, at 09:36 , mrmclovin wrote: > If you bought a game, would you rather like to get info on how to > compile the game in order to play it.. or just install it and play it? > This analogy makes no sense whatsoever, I fear. -- You received this message because you are subscribed to the

Re: Django's documention is horrible

2011-01-11 Thread Masklinn
On 2011-01-11, at 07:44 , Sam Lai wrote: > On 11 January 2011 13:39, Christophe Pettus wrote: >> >> On Jan 10, 2011, at 1:25 PM, Simon W wrote: >> >>> For such a good web framework it's a shame that the documention is not >>> structured well .. at all. >> >> I have no doubt that the project wo

Re: Django's documention is horrible

2011-01-11 Thread mrmclovin
On Jan 11, 7:44 am, Sam Lai wrote: > On 11 January 2011 13:39, Christophe Pettus wrote: > This isn't about patches to the existing docs (which are great for > their purpose). It is about Django missing an API reference manual, > something like .NET Class Library Reference > (http://msdn.microsoft