Re: Practical Django Projects source code

2008-10-08 Thread Brandon Taylor
Hi, Unfortunately the source code isn't available from the Apress site yet, and there's no mention of when it might be available either. I've been through all of the samples in that book, and they work, with a few tweeks for 1.0. You can download Coltrane from DjangoPlugables.com, but there are

Re: Problem generating permalink for date-based view

2008-10-08 Thread Brandon Taylor
Using the following template tag resolved the issue: {% url archive_month obj.year obj|date:"b" %} On Oct 7, 9:04 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm using the generic date-based views. > > Here's a snippet of my "Entry" model for a blog: > > #models.py >

Using Block Tag in an Included File

2008-10-08 Thread Chris
Is there anyway to use {% block %} in an included template? I have a header template, that's included in a few generic base templates. I had hoped to declare some global stylesheets/javascript in the header, along with a {% block header %} tag, to allow other templates to insert their own

Re: MySQLdb...Please Help?

2008-10-08 Thread Robin
It looks like my problem was with how I installed gcc. I tried to install just gcc 3.3 and 4.0 from the OS X disc and I missed something. I just installed the typical Dev Tool install and I've gotten past these errors and am now dealing with the ones there seems to be help with. Sorry! On Oct

Re: MySQLdb...Please Help?

2008-10-08 Thread Robin
When I run the build with gcc 4.0 I get these errors...it continues, but I've included the first bits... >sudo python setup.py build running build running build_py copying MySQLdb/release.py -> build/lib.macosx-10.5-i386-2.5/MySQLdb running build_ext building '_mysql' extension gcc

Re: Extend contrib.comments?

2008-10-08 Thread Eric Abrahamsen
On Oct 9, 2008, at 8:14 AM, fitzage wrote: > > So far this is working great in terms of firing off the emails. How do > you go about creating the security hash? I'm a little lost when it > comes to that point. I'm on less solid ground here, unfortunately. Django's got a utility for this

Re: Password Change Usage

2008-10-08 Thread Chris Spencer
Yeah, this has been a big let down. What I'd hoped would be a few minutes setting up a basic site framework has turned into several hours wasted on boilerplate. The lack of docs, templates, and strange bugs like these leads me to think that django-registration isn't fully baked. I'm simply

MySQLdb...Please Help?

2008-10-08 Thread Robin
I'm sure you've seen this many times. I've been digging for hours now trying to figure this out. I honestly have looked and tried many solutions before posting. I'm running an Intel iMac on OS X 10.5.5. I've got Django 1.0 installed and working (can import django from python). I've got MySQL

Djando developers in the Dallas area

2008-10-08 Thread chimpera
I am in need of some Django help. Is there anyone in the dfw area who can share there expertise? Thanks, Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

an inline fk

2008-10-08 Thread chimpera
I have a model "case" and a model "person". Multiple cases can belong to one person so i used a foreign key. I would like to be able to edit an instance of the person class inline on the case admin page. How can I do this? Thanks for your help, Ben

Re: Checking for the current template

2008-10-08 Thread Malcolm Tredinnick
On Wed, 2008-10-08 at 19:37 -0600, Michael Saltsman wrote: > Hey, I want to do a simple if statement (inside a template) to check > for the current template, how would I do that? What do you mean? What would this hypothetical "check for the current template" function return? If you're

Re: Can a model have a OneToOne and ForeignKey to another model

2008-10-08 Thread Malcolm Tredinnick
On Wed, 2008-10-08 at 15:31 -0700, meppum wrote: > I wanted to have both a 1:1 and a 1:M relationship between the user > model and a model called "address". I wanted to be able to get a list > of all historical addresses the user has lived at, as well as the > current one like so: > >

Re: Reorder a queryset/list with respect to another list

2008-10-08 Thread Malcolm Tredinnick
On Wed, 2008-10-08 at 19:51 +0100, Andrew Ingram wrote: > Hi all, > > I'm using SolrPy to integrate django with solr for searching (very > simple to configure by the way, highly recommend it). But I have a > problem that I'm wonder if there's an elegant solution for either at the > Django

Re: Access a model's original get_absolute_url

2008-10-08 Thread Carl Meyer
On Oct 8, 2:30 pm, Erik Allik <[EMAIL PROTECTED]> wrote: > I've thought about this but I'm not sure how. Is there a hook/signal   > that gets fired when all models have been loaded but   > ModelBase._prepare hasn't run? No, there isn't, but it doesn't seem like you'd need that. It seems like

Re: Access a model's original get_absolute_url

2008-10-08 Thread Malcolm Tredinnick
On Wed, 2008-10-08 at 21:30 +0300, Erik Allik wrote: > I've thought about this but I'm not sure how. Is there a hook/signal > that gets fired when all models have been loaded but > ModelBase._prepare hasn't run? That would be impossible, since ModelBase.__new__ calls _prepare and the former

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Malcolm Tredinnick
On Wed, 2008-10-08 at 10:07 -0700, Dan Ellis wrote: > On Oct 8, 11:22 am, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > > > They won't. Django is Python first and foremost. So modules must have > > legal names. > > So what about all those Django apps with hyphens in their names? They

Re: Ordering in Admin Interface

2008-10-08 Thread Malcolm Tredinnick
On Wed, 2008-10-08 at 06:21 -0700, David Christiansen wrote: > Hello all, > > We are currently working on a project in which we would like to order > the list of model instances on the admin interface by two separate > parameters. So far, the second has been ignored. We've tried the >

Password Change Usage

2008-10-08 Thread Chris
Does anyone know of an example for using django.contrib.auth.views.password_change? All the docs seem to mention is how to specify it's template. After poking around in the code, I found it exposes new_password1 and new_password2 and I setup a basic form. However, it never redirects to the

Checking for the current template

2008-10-08 Thread Michael Saltsman
Hey, I want to do a simple if statement (inside a template) to check for the current template, how would I do that? What am I checking for inside my {% if %} ? Thanks in advance -mike --~--~-~--~~~---~--~~ You received this message because you are

Re: Django-Registration and NewForms Error

2008-10-08 Thread Chris Spencer
Thanks guys, that fixed the problem. On Wed, Oct 8, 2008 at 6:37 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > > Rishabh Manocha wrote: >> On Wed, Oct 8, 2008 at 5:07 PM, Chris <[EMAIL PROTECTED] >> > wrote: >> >> >> I installed django-registration via easy_install,

Re: porting OpenBookPlatform to Django v1

2008-10-08 Thread Tonu Mikk
Karen, thank you for your thorough response. It gives me a direction and food for thought. Tonu Karen Tracey wrote: > On Wed, Oct 8, 2008 at 2:50 PM, Tonu Mikk <[EMAIL PROTECTED] > > wrote: > > > Here is a bit more info on the error that I am getting with >

Re: problem posting data to MYSQL

2008-10-08 Thread Karen Tracey
On Wed, Oct 8, 2008 at 8:28 PM, KillaBee < [EMAIL PROTECTED]> wrote: >It is a model, > http://dpaste.com/83272/ it is called time, and timesheets it when I > tried to do it the form way. So, the key word is save(). Can I get > an example of how to use it? > There are examples in the

Practical Django Projects source code

2008-10-08 Thread [EMAIL PROTECTED]
I wonder if James could release the original code, even if slightly broken or outdated. It would be great to have it on GitHub where people could fork it and correct or update it. If that's not possible, does anyone have the source code, typed from the book? I'm specially interested in the code

Re: problem posting data to MYSQL

2008-10-08 Thread KillaBee
On Oct 8, 4:45 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 8, 2008 at 4:17 PM, KillaBee < > > > > [EMAIL PROTECTED]> wrote: > > > from django.http import HttpResponse, HttpResponseRedirect > > from intranet.timesheets.models import Poll > > from intranet.timesheets.models import

Re: Extend contrib.comments?

2008-10-08 Thread fitzage
So far this is working great in terms of firing off the emails. How do you go about creating the security hash? I'm a little lost when it comes to that point. On Oct 7, 7:49 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > On Oct 7, 2008, at 11:38 PM, fitzage wrote: > > > > > I want to add one

Re: i18n in templates and views

2008-10-08 Thread J
Thank you, Carl. I'll try this out. Carl Meyer wrote: > On Oct 8, 12:22 am, J <[EMAIL PROTECTED]> wrote: > >> How would I include the "date" field from the first model ("Post") in >> the queryset created from "PostI18N", using something similar to: >> >> queryset = >>

Re: djangosnippets.org list navigation

2008-10-08 Thread Rob Sutherland
On Wed, Oct 8, 2008 at 5:44 PM, David Durham, Jr. <[EMAIL PROTECTED]> wrote: > > The list navigation on djangosnippets is not so good. Take this page I found this link to a search utility for djangosnippets the other day. http://henning.cco-ev.de/django/djangosnippets.html Rob

djangosnippets.org list navigation

2008-10-08 Thread David Durham, Jr.
The list navigation on djangosnippets is not so good. Take this page for instance: http://www.djangosnippets.org/users/ I happened to stumble across the following jquery plugin which might be a quick fix for some of the issues (though searching should be added to):

Re: Extend contrib.comments?

2008-10-08 Thread fitzage
I don't totally understand that new method, but I should be able to figure it out once it's patched and documented. I'll try the subclassing method for now. Thanks guys! On Oct 8, 5:27 am, Carl Meyer <[EMAIL PROTECTED]> wrote: > On Oct 7, 10:49 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > >

Re: Django-Registration and NewForms Error

2008-10-08 Thread Steve Holden
Rishabh Manocha wrote: > On Wed, Oct 8, 2008 at 5:07 PM, Chris <[EMAIL PROTECTED] > > wrote: > > > I installed django-registration via easy_install, and followed the > directions for setting it up in my app, but when I go to /register, I > get the error: > >

advice on admin site structure

2008-10-08 Thread Adda Badda
Hi, Im building a back end for a simple flash site. The site can have any number of pages and each page can be either an GalleryPage or a TextPage. I would like to set up the admin system so that when a page is added the appropriate TextPage or GalleryPage is displayed for populating.

Re: problem posting data to MYSQL

2008-10-08 Thread Karen Tracey
On Wed, Oct 8, 2008 at 4:17 PM, KillaBee < [EMAIL PROTECTED]> wrote: > > from django.http import HttpResponse, HttpResponseRedirect > from intranet.timesheets.models import Poll > from intranet.timesheets.models import Choice > from intranet.timesheets.models import timesheet > from

Re: Trying to customize admin interface form

2008-10-08 Thread bmsilva
That's what happens when I don't read the documentation until the end. Found this in django documentation: """ Templates which may be overridden per app or model¶ Not every template in contrib\admin\templates\admin may be overridden per app or per model. The following can: *

Re: Django Admin - Does not see templates, images or templates.

2008-10-08 Thread Karen Tracey
On Wed, Oct 8, 2008 at 3:11 PM, NoviceSortOf <[EMAIL PROTECTED]> wrote: > > > Of the other two, one claims to be Django 1.0 and one claims to be > > Django SVN trunk. Assuming they are what they claim to be, which one > > is the latest depends on whether the trunk checkout is from before or > >

Re: porting OpenBookPlatform to Django v1

2008-10-08 Thread Karen Tracey
On Wed, Oct 8, 2008 at 2:50 PM, Tonu Mikk <[EMAIL PROTECTED]> wrote: > > Here is a bit more info on the error that I am getting with > OpenBookPlatform. > > When I try to access booklist in OpenBookPlatform I received this error: > Exception Value: Could not import apps.books.views. Error was:

Trying to customize admin interface form

2008-10-08 Thread bmsilva
Hi, I tried to change submit_line.html in the admin interface for a particular model without success. /myproj/templates/admin/submit_line.html --> works /myproj/templates/admin/myapp/submit_line.html --> nothing happens /myproj/templates/admin/myapp/mymodel/submit_line.html --> nothing happens

problem posting data to MYSQL

2008-10-08 Thread KillaBee
from django.http import HttpResponse, HttpResponseRedirect from intranet.timesheets.models import Poll from intranet.timesheets.models import Choice from intranet.timesheets.models import timesheet from intranet.timesheets.models import time from django.shortcuts import render_to_response,

Re: problem posting data to MYSQL

2008-10-08 Thread KillaBee
On Oct 8, 3:20 pm, KillaBee <[EMAIL PROTECTED]> wrote: > > > > > > > Untitled Document > > > > > > > > {{ form.as_p }} > > > > > > date > > > > fedtime > > > > worked > > > > user > > > > > > > > > > > > I fill the form out and it redirects but data doesnot post.

Re: problem posting data to MYSQL

2008-10-08 Thread KillaBee
On Oct 8, 3:27 pm, KillaBee <[EMAIL PROTECTED]> wrote: > On Oct 8, 3:26 pm, KillaBee <[EMAIL PROTECTED]> > wrote: > > > > > from django.http import HttpResponse, HttpResponseRedirect > > from intranet.timesheets.models import Poll > > from intranet.timesheets.models import Choice > > from

Re: problem posting data to MYSQL

2008-10-08 Thread KillaBee
On Oct 8, 3:26 pm, KillaBee <[EMAIL PROTECTED]> wrote: > from django.http import HttpResponse, HttpResponseRedirect > from intranet.timesheets.models import Poll > from intranet.timesheets.models import Choice > from intranet.timesheets.models import timesheet > from intranet.timesheets.models

Re: problem posting data to MYSQL

2008-10-08 Thread KillaBee
Untitled Document {{ form.as_p }} date fedtime worked user --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

problem posting data to MYSQL

2008-10-08 Thread KillaBee
from django.http import HttpResponse, HttpResponseRedirect from intranet.timesheets.models import Poll from intranet.timesheets.models import Choice from intranet.timesheets.models import timesheet from intranet.timesheets.models import time from django.shortcuts import render_to_response,

Re: Django Admin - Does not see templates, images or templates.

2008-10-08 Thread NoviceSortOf
> Of the other two, one claims to be Django 1.0 and one claims to be > Django SVN trunk. Assuming they are what they claim to be, which one > is the latest depends on whether the trunk checkout is from before or > after 1.0. You might get a clue by looking at django/__init__.py in > both and

Reorder a queryset/list with respect to another list

2008-10-08 Thread Andrew Ingram
Hi all, I'm using SolrPy to integrate django with solr for searching (very simple to configure by the way, highly recommend it). But I have a problem that I'm wonder if there's an elegant solution for either at the Django template or Python level (I can solve the problem in a messy way, but

Re: dynamic associations?

2008-10-08 Thread Alex G
Ah, yes, I fell back on the add() function only because setattr wasn't doing what I needed it to do. I know I am getting the DoesNotExist exception because the related model doesn't exist, but that's the problem entirely: I have no way to pass an argument to setattr because getattr raises this

Re: porting OpenBookPlatform to Django v1

2008-10-08 Thread Tonu Mikk
Here is a bit more info on the error that I am getting with OpenBookPlatform. When I try to access booklist in OpenBookPlatform I received this error: Exception Value: Could not import apps.books.views. Error was: cannot import name validators Same error appears when I try to use the Register

Re: Multiple projects, model inheritance, and one common database

2008-10-08 Thread barbara shaurette
Actually, that's been suggested ... and considered. The problem is that these two initial projects aren't going to be the only ones. There will be more sites in the future, all slightly different, but all sharing this common type of content. And putting *all* of them on the same database is,

some fields in django admin need to have rtl

2008-10-08 Thread Eugene Pyvovarov
hi, I have such a problem - I need to have few fields in admin interface with different style('direction:rtl;' in my case) but only some selected fields I've found nothing about such problem in docs or google, maybe there is some solution to resolve my problem? Maybe is it possible to set

Re: Access a model's original get_absolute_url

2008-10-08 Thread Erik Allik
I've thought about this but I'm not sure how. Is there a hook/signal that gets fired when all models have been loaded but ModelBase._prepare hasn't run? Erik On 08.10.2008, at 16:38, Carl Meyer wrote: > > > > On Oct 8, 5:29 am, Erik Allik <[EMAIL PROTECTED]> wrote: >> I'm writing a content

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Carl Meyer
On Oct 8, 1:09 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: > Can somebody tell me how one would best store django apps and projects when > starting branches and tags under svn? If an app is reusable between projects I store it in its own separate VC repo (bazaar, in my case). If an app is

Re: Organizing apps without using projects

2008-10-08 Thread Brent Hagany
I haven't tried a syncdb (which, now that you mention it, probably does not work), but the admin does work. This is probably because I don't do an autodiscover - I register each app manually. As for coupling, the apps in question do depend on each other, but not at a very deep level. My reason

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Carl Meyer
On Oct 8, 1:07 pm, Dan Ellis <[EMAIL PROTECTED]> wrote: > So what about all those Django apps with hyphens in their names? You won't find a Django app that asks you to put a directory with a hyphen into your Python path. Usually the pattern is for an app's human-readable name to look like

Re: Multiple projects, model inheritance, and one common database

2008-10-08 Thread Carl Meyer
On Oct 8, 12:47 pm, barbara shaurette <[EMAIL PROTECTED]> wrote: > We're building a couple of different projects - one social network-y > site, and one that's bloglike.  So each has its own unique database, > but they do share one common set of content. You'll almost certainly have better luck

Django-sphinx with postgresql

2008-10-08 Thread Rob Sutherland
Hi, I'm working on setting up the sphinx search tool with django-sphinx and I have a few questions for any current users out there. First, while googling I see a lot of links to http://www.davidcramer.net/ which don't resolve and I see that David Cramer is listed as the package maintainer. Is

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Gerard Petersen
Dan, I know a workaround which is this: django_admin = __import__('django-admin', fromlist=['django.bin']) But I'm not into Django's code enough to know how it is generally done. Regards, Gerard. Dan Ellis wrote: > On Oct 8, 11:22 am, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > >>

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Gerard Petersen
Guys, Thanx for the reply! Still some Q's though: Can somebody tell me how one would best store django apps and projects when starting branches and tags under svn? And how portable are apps between projects? So would tagging an app seperately from a project be a good idea? Or do you pro's

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Dan Ellis
On Oct 8, 11:22 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > They won't. Django is Python first and foremost. So modules must have > legal names. So what about all those Django apps with hyphens in their names? --~--~-~--~~~---~--~~ You received this

Multiple projects, model inheritance, and one common database

2008-10-08 Thread barbara shaurette
We're building a couple of different projects - one social network-y site, and one that's bloglike. So each has its own unique database, but they do share one common set of content. I've created a third "common" project to hold the base models, at least - the model inheritance seems to be

Re: Specify that syncdb not create a table for a Model

2008-10-08 Thread Ed Anuff
On Oct 7, 6:32 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > >  On the roadmap? > > Yes. Should certainly be in 1.1. Probably land in a few weeks. Awesome, couldn't ask for more, thanks :) --~--~-~--~~~---~--~~ You received this message because you are

Re: Using Javascript

2008-10-08 Thread David Reynolds
On 8 Oct 2008, at 3:18 pm, Johnny wrote: > Someone's got an idea? Write a django view that returns JSON and use your Javascript to call that. You should be able to parse the JSON from javascript. -- David Reynolds [EMAIL PROTECTED] --~--~-~--~~~---~--~~

Re: looking for event registration/calendar modules

2008-10-08 Thread KillaBee
On Sep 11, 5:39 pm, cjl <[EMAIL PROTECTED]> wrote: > Probably not exactly what you are looking for, but check out: > > https://pycon.coderanger.net/ > > -cjlesh that 129 snippest didnt work for me. I just put the top in the view and the bottom as a template. I get this, can anybody tell me

Re: re-direction after login successfully

2008-10-08 Thread KillaBee
On Oct 7, 3:20 pm, Bob <[EMAIL PROTECTED]> wrote: > The setting LOGIN_REDIRECT_URL will allow you to change the default. > > On Sep 4, 7:07 pm, zissan <[EMAIL PROTECTED]> wrote: > > > It's seemd that Django has set /accounts/profile as default page after > > login successfully. > > I wonder if

porting OpenBookPlatform to Django v1

2008-10-08 Thread Tonu Mikk
Hello, I wonder if anyone has tried porting the OpenBookPlatform http://djangosites.org/s/limodou-51boo-com/ to Django v1? I am trying this, but running into problems. I contacted the project owner, but he is not maintaining the code any more. Thank you, Tonu

test client post exception due to cStringIO

2008-10-08 Thread Rodrigue
Hi all, I am writing some unit tests using the django.test.client.Client to send requests to my views. I'm using django 1.0 final I am having problems when sending a post request though. Here is my code: post_content_type = "application/x-www-form-urlencoded" data = {} data['username'] =

Error while rendering comments

2008-10-08 Thread Jorge Romo
Hello, I have this issue: Caught an exception while rendering: Reverse for '' with arguments '()' and keyword arguments '{}' not found. The second line is what is causing me trouble: 1 {% load comments %} 2 3 {% for field in form %} 4 {% if field.is_hidden %} 5

Re: Can M2M be one-way?

2008-10-08 Thread Dylan Reinhardt
On Tue, Oct 7, 2008 at 3:26 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Tue, Oct 7, 2008 at 6:01 PM, Dylan Reinhardt <[EMAIL PROTECTED]>wrote: > >> >> Is there any way to make Django ManyToManyField objects not be bi- >> directional? >> > > I think you want symmetrical=False: > > >

Re: Django Hosting Survey

2008-10-08 Thread Finder
I'm on slicehost with one 256 slice, and one 512...running Django on the 256 with lighttpd and my forums, email, etc on the 512 with apache So far Django has still preformed great and when I ran load tests, lighttpd with Django handled the load very well. We're up to about 3,000 hits per day no

Re: Using Javascript

2008-10-08 Thread Andrew Ingram
use a django-served template for your JS file. 2008/10/8 Johnny <[EMAIL PROTECTED]>: > Hi everyone, > > I'm writting a Web App using Django and I got problems to make appear or > deasappear some content. > > Here is the code I was using to write a part of the windows: > > >

Re: Organizing apps without using projects

2008-10-08 Thread Carl Meyer
On Oct 8, 9:51 am, Brent Hagany <[EMAIL PROTECTED]> wrote: > I'm not in front of my code at the moment, but I'm pretty sure there's > no magic involved, and it works just fine.  When I do a runserver from > my (completely decoupled) project, the root urlconf sends everything > to umbrella.urls,

Using Javascript

2008-10-08 Thread Johnny
Hi everyone, I'm writting a Web App using Django and I got problems to make appear or deasappear some content. Here is the code I was using to write a part of the windows: Episode Name

Re: Organizing apps without using projects

2008-10-08 Thread Brent Hagany
I'm not in front of my code at the moment, but I'm pretty sure there's no magic involved, and it works just fine. When I do a runserver from my (completely decoupled) project, the root urlconf sends everything to umbrella.urls, which then delegates once again to umbrella.app.urls, which knows

Re: Access a model's original get_absolute_url

2008-10-08 Thread Carl Meyer
On Oct 8, 5:29 am, Erik Allik <[EMAIL PROTECTED]> wrote: > I'm writing a content management framework which stores content in a   > tree of nodes. Nodes can be of different content types and I want to   > be able to add new content types by simply adding apps that provide   > models to

Re: Importing times and dates into Postgres DB via Django

2008-10-08 Thread Ales Zoulek
Django's Date/Time fields on models accepts instances from python's datetime module. So you need to create one import datetime date = datetime.datetime.strptime(datetime_string, datetime_string_format) model_instance.datecolumn = date model_instance.save() On Wed, Oct 8, 2008 at 3:17 PM,

Ordering in Admin Interface

2008-10-08 Thread David Christiansen
Hello all, We are currently working on a project in which we would like to order the list of model instances on the admin interface by two separate parameters. So far, the second has been ignored. We've tried the following: 1. Setting the ordering attribute of the ModelAdmin subclass. The

Re: Django Hosting Survey

2008-10-08 Thread Hani
Happy Webfaction user here. :) On Oct 6, 1:30 pm, Jeff <[EMAIL PROTECTED]> wrote: > I am about to begin a new Django project and I am currently evaluating > hosting options. I know there has been a number of discussions on this > topic, and I have read most of them. However, seeing how quickly

Importing times and dates into Postgres DB via Django

2008-10-08 Thread Alfonso
Hi, I have a textfile full of event data that I'm trying to parse into the associated postgresql db via django. Wrote a simple load.py script I can run via shell. Being going well though I've stumbled when importing DateField and TimeField values. the relevant bits of the code that processes

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Carl Meyer
On Oct 8, 2:08 am, Gerard Petersen <[EMAIL PROTECTED]> wrote: > When the project dir is named 0.1 instead of djapp I get a trace (see below) > that it has no module 0.1. Where and why does django look at the name of the > parent (project) dir? In Python, you can happily put any directory into

Re: Django Admin - Does not see templates, images or templates.

2008-10-08 Thread Carl Meyer
On Oct 8, 3:28 am, NoviceSortOf <[EMAIL PROTECTED]> wrote: > These 3 directories seem to contain many redundant files. > > /var/www/Django-1.0/django/ > /var/www/django-trunk/django/ > > /usr/lib/python2.3/site-packages/django/ > > How do I determine if one of these directories > contains a

Re: Organizing apps without using projects

2008-10-08 Thread Carl Meyer
On Oct 7, 10:28 pm, Brent Hagany <[EMAIL PROTECTED]> wrote: > My apologies if this has been brought up before on this group - my > searching did not turn up anything, but my search skills are > notoriously suspect. > > I have been reorganizing my code so that it does not depend on the > project

Re: Extend contrib.comments?

2008-10-08 Thread Carl Meyer
On Oct 7, 10:49 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > from django.contrib import comments > > def my_get_form(): >      return MyCommentForm > > comments.get_form = my_get_form This works, but it should be noted that it's an unfortunate monkeypatch that is necessary because

Re: Django Admin - Does not see templates, images or templates.

2008-10-08 Thread Karen Tracey
On Wed, Oct 8, 2008 at 3:28 AM, NoviceSortOf <[EMAIL PROTECTED]> wrote: > > > What version of Django are you running? These two patterns are from > > different Django versions. The first, with the include of > > 'django.contrib.admin.urls' was the old one -- that file does not exist > in > >

Re: i18n in templates and views

2008-10-08 Thread Carl Meyer
On Oct 8, 12:22 am, J <[EMAIL PROTECTED]> wrote: > How would I include the "date" field from the first model ("Post") in > the queryset created from "PostI18N", using something similar to: > > queryset = > PostI18N.objects.filter(lang=get_language()).order_by('post__date') > > Would that date

Re: Django-Registration and NewForms Error

2008-10-08 Thread Rishabh Manocha
On Wed, Oct 8, 2008 at 5:07 PM, Chris <[EMAIL PROTECTED]> wrote: > > I installed django-registration via easy_install, and followed the > directions for setting it up in my app, but when I go to /register, I > get the error: > > File "/usr/lib/python2.5/site-packages/django_registration-0.5- >

Django-Registration and NewForms Error

2008-10-08 Thread Chris
I installed django-registration via easy_install, and followed the directions for setting it up in my app, but when I go to /register, I get the error: File "/usr/lib/python2.5/site-packages/django_registration-0.5- py2.5.egg/registration/views.py", line 12, in File

Re: Generating widget based on class type for a Custom Form

2008-10-08 Thread Leon Yeh
Hi Ronny, Thanks ... that is a great idea! It works like I wanted. Leon Yeh New Avenue Systems Inc. Ronny Haryanto wrote: > On Tue, Oct 7, 2008 at 7:31 PM, Leon Yeh | New Avenue.net > <[EMAIL PROTECTED]> wrote: > >> Hi Ronny, terima kasih... :-) >> > > Sama-sama :-) > > >> I am

a href in Template redirects right but the wrong template is loading

2008-10-08 Thread Stas
hi all. I use this code in my view for login a user in def logmein(request): if request.POST: username = request.POST['username'] password = request.POST['password'] user = authenticate(username=username,password=password) if user is not None: if

Re: dynamic associations?

2008-10-08 Thread Russell Keith-Magee
On Tue, Oct 7, 2008 at 9:59 PM, Alex G <[EMAIL PROTECTED]> wrote: > > Ah, it works for me too, except in the case of relations. > > Essentially, it all comes down to one line of code; given an instance > model, a method as a string, and a secondary instance of a model, > something like: > >

Re: Conditions in templates

2008-10-08 Thread Kasper Grubbe
I will look at it at the future. I fixed this problem by making another approach to it. However i think that it would be neat that templates supported boolean statements. On Oct 8, 3:39 am, hasan_aljudy <[EMAIL PROTECTED]> wrote: > You can't really do it that easily with the default django

ManyToMany via intemediary model and admin interface

2008-10-08 Thread Marco Buttu
Hi. I wrote an intemediary model like this one: http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships ## models.py # from django.db import models class Person(models.Model): name =

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Malcolm Tredinnick
On Wed, 2008-10-08 at 06:11 -0400, Steve Holden wrote: [...] > Well, firstly 0.1 isn't technically a valid Python name, though it's > possible that Django's specific import methods will be able to cope with > things that would be syntactically illegal in the import statement. They won't. Django

Re: random quote help

2008-10-08 Thread Steve Holden
Bobby Roberts wrote: >> Is your problem the mechanics of *making* the random choice, or are you >> uncertain how to get it into your output? >> > > Hi Steve - > > Yeah i know the randomization needs to be in the view and then pushed > back to the template. How would I call the view on each

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Steve Holden
Gerard Petersen wrote: > Hi all, > > This might be somewhat off topic, but I'm moving my django project into > another directory (svn branch). > > It was here: /home/gerard/files/python/djapp/(myapp) > > I want it here: /home/gerard/files/python/djapp/branches/0.1/(myapp) > > When the

Re: Double encoded slash in path_info removed when using apache/wsgi

2008-10-08 Thread Graham Dumpleton
On Oct 8, 5:57 pm, Merrick <[EMAIL PROTECTED]> wrote: > Could this problem be in the wsgi.py handler in django? If not I > suppose I need to look at mod_wsgi and quit asking here :) It is how Apache works and there is possibly not much you can do about it. In Apache 1.3, repeating slashes can

Re: static html

2008-10-08 Thread Erik Allik
First of all, why don't you just point the browser at the URL of the commands.html file in the first place? > def list_commands(request): >commands = open('home/.../commands.html') >return HttpResponse(commands) >commands.close() Secondly: when do you suppose the last line of

Re: static html

2008-10-08 Thread Daniel Roseman
On Oct 8, 9:32 am, "Alfredo Alessandrini" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to show a static html page... > > The html page is in the /media folder. > > I've some problem with view funcition: > > def list_commands(request): >     commands = >     return HttpResponse(commands) >

Re: Access a model's original get_absolute_url

2008-10-08 Thread Erik Allik
> This does hint that you're using the wrong shovel to hammer in your > screws, however. You've said that you want to change that URL, always. > Hence it's in ABSOLUTE_URL_OVERRIDES. Later you are effectively saying > "no, just joking... I don't want it overridden all the time". If it's > only

Re: random quote help

2008-10-08 Thread Benjamin Buch
Am 08.10.2008 um 10:33 schrieb David Reynolds: > On 8 Oct 2008, at 4:05 am, Bobby Roberts wrote: > >> Yeah i know the randomization needs to be in the view and then pushed >> back to the template. How would I call the view on each page in the >> website? > > > Use a template tag. > > Oh and

Re: Django Hosting Survey

2008-10-08 Thread NoviceSortOf
(ROSS) you say 256 RAM but I'm curious if you are running Ubuntu server or some other distro? Is 256 RAM sufficient for Ubuntu or should one allow for more headroom? I'm leaning towards the Slicehost or Lincode type solution. Because in the past with frameworks and platforms we have learned

Re: static html

2008-10-08 Thread Alfredo Alessandrini
I've solved it with: def list_commands(request): commands = open('home/.../commands.html') return HttpResponse(commands) commands.close() 2008/10/8 Alfredo Alessandrini <[EMAIL PROTECTED]>: > Hi, > > I'm trying to show a static html page... > > The html page is in the /media

Re: random quote help

2008-10-08 Thread David Reynolds
On 8 Oct 2008, at 4:05 am, Bobby Roberts wrote: > Yeah i know the randomization needs to be in the view and then pushed > back to the template. How would I call the view on each page in the > website? Use a template tag. Oh and Quote.objects.order_by('?')[0] is probably what you want --

  1   2   >