Re: ManyToMany relationship on self through other table

2008-10-02 Thread chris
Dear Karen, Thank you very much for your response. It was very helpful and solved my problem! As I said, I am just beginning with Django, so could not quite understand where the problem lies. However, I will try to post a more useful and descriptive phrasing of the problem, including

postgres hangs indefinitely on many model inserts. anyone seen this?

2008-10-02 Thread dan90
I'm picking through some nasty problems with postgres connections on my django install. Bascially, if I do "a lot" of rapid selects and inserts on some models with "a lot" of mutual foreign key constraints, the database connection hangs indefinitely - and quite nastily - it acquires locks such

Ticket #5737: "CheckboxSelectMultiple when you use choices, required=False is not respected" reappearing?

2008-10-02 Thread johnny
I found the same problem as ticket #5737. It was closed due to unable to reproduce it, but I am seeing the same problem. I have: class QueryForm(f.Form): status = f.ChoiceField(choices=STATUS_TYPES, widget=f.CheckboxSelectMultiple(), required=False) and the form validation errored:

FormWizard with multiple forms / page

2008-10-02 Thread mcordes
Hello, I'd like to make a wizard using the FormWizard class that has multiple django Forms (and just a single html form) per page. It doesn't look like this is supported out of the box. Has anyone done something like this before? Any tips or other approaches I might try? -Matt

Re: Help Getting an error "invalid keyword argument for this function"

2008-10-02 Thread Karen Tracey
On Thu, Oct 2, 2008 at 2:26 PM, Karthik Krishnan <[EMAIL PROTECTED]>wrote: > > I have the following table in models.py > > class SiteAccessProcess(models.Model): > """Object model mapping to the site_access_process table. > > Each element in the class represents a table column. > """ >

Re: Help Getting an error "invalid keyword argument for this function"

2008-10-02 Thread Malcolm Tredinnick
On Thu, 2008-10-02 at 11:26 -0700, Karthik Krishnan wrote: > I have the following table in models.py > > class SiteAccessProcess(models.Model): [... snip ...] > I am running a unit test. [...] > I get the following error. > > 265, in __init__ > raise TypeError, "'%s' is an invalid

Re: Vague, annoying, login problem

2008-10-02 Thread Robocop
fixed. --~--~-~--~~~---~--~~ 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 PROTECTED] For more

Re: login page

2008-10-02 Thread Malcolm Tredinnick
On Wed, 2008-10-01 at 13:58 -0700, KillaBee wrote: > I am adding a login page to my app and it keep saying that it can't > find the login.html Do you mean that it cannot find a template called "login.html" or when you go to a particular URL a 404 response is returned (meaning it cannot match

admin.py, save_model and content-type of a file

2008-10-02 Thread ozgur
Hello, I am trying to get content-type of uploading file in admin, and I always get the error: 'TemporaryUploadedFile' object is unsubscriptable I dont want to try Pythons mimetypes object because of files i'm trying to upload has no extension and has aprox. 30MB file size. # models.py class

Re: Vague, annoying, login problem

2008-10-02 Thread Robocop
I just realized why the images are not loading; the images are served by appending the file path to the url, but when they try to append mysite.com/login/imagefilepath it can't find them as there is no login directory. My question now is how do i work around this, i haven't thought of a

Re: Difference between forked and threaded fastcgi mode?

2008-10-02 Thread Graham Dumpleton
On Oct 3, 9:31 am, chiggsy <[EMAIL PROTECTED]> wrote: > I want to run django via fastcgi, fronting it with nginx.  Now, from > the help, I see there are 2 options: > >   method=IMPL          prefork or threaded (default prefork) > > What are the pros and cons of the threaded model?  I'm tending

Difference between forked and threaded fastcgi mode?

2008-10-02 Thread chiggsy
I want to run django via fastcgi, fronting it with nginx. Now, from the help, I see there are 2 options: method=IMPL prefork or threaded (default prefork) What are the pros and cons of the threaded model? I'm tending toward prefork, does anyone have any experience to share?

os.path.exists(UNC) returns False in Apache, while True in manage.py runserver

2008-10-02 Thread Andre
Regards to all, I have completed Phase 1 of my first Django site and trying to deploy it on Apache. And hit a problem: if os.path.exists("\\file_server01\myproject\mydir") This returns True on development Django server and False on Apache 2.2 with mod_python 3.3.1 running on W2000. I

Re: Catching Exceptions thrown in .save() - django 1.0

2008-10-02 Thread Michael
On Thu, Oct 2, 2008 at 6:23 PM, bruno desthuilliers < [EMAIL PROTECTED]> wrote: > > On 2 oct, 16:51, Michael Newman <[EMAIL PROTECTED]> wrote: > > Kurczak; > > > > Short of this is, catching specific errors in the save method and > > displaying them to the user are hard and you might be

Re: os.path.exists(UNC) returns False in Apache, while True in manage.py runserver

2008-10-02 Thread Andre
Problem solved: running Apache as a service did not have same permission as my UID. Restarted service running under my user (configured Windows service) and got access to those files. A On Oct 2, 3:06 pm, Andre <[EMAIL PROTECTED]> wrote: > Regards to all, > > I have completed Phase 1 of my

Re: Catching Exceptions thrown in .save() - django 1.0

2008-10-02 Thread bruno desthuilliers
On 2 oct, 16:51, Michael Newman <[EMAIL PROTECTED]> wrote: > Kurczak; > > Short of this is, catching specific errors in the save method and > displaying them to the user are hard and you might be regurgitating > items back to the user that they really don't have any business seeing > (SQL errors,

Easy way to pre-populate a field in admin interface?

2008-10-02 Thread Ardesco
I was wondering if there was an way to do this easily. I have two scenarios I've been pondering: a) Pre-populating a field with the current username, b) pre-populating a field with the contents a user has previously typed, a sort of "history" field. I've already hacked at the editable fields to

Re: Rendering just child template...

2008-10-02 Thread Rock
No. Typically you would make a stand-alone template that does not extend anything else. This template only renders the contents of the container in question. It can be used by your AJAX view to create an updated container which can be passed back to the browser. But the same template can also be

Re: Rendering just child template...

2008-10-02 Thread AndrewK
I'm using a trick involving jQuery taconite plugin, and child template. I have two base templates for the child template (taconite one, for ajax requests, and regular one). And you can put a variable into {% extends %} tag, instead of string. Something like {% extends base_template %} and then

Re: Are a lot of people using SQLAlchemy with Django?

2008-10-02 Thread mtrier
Matt, On Oct 1, 11:39 am, Matt Wilson <[EMAIL PROTECTED]> wrote: > I'd love to be able to use SQLAlchemy with Django.  I've heard some > people are working with this, but I want to know if people are really > using it in production. We're working on a project called django-sqlalchemy (http://

Re: Catching Exceptions thrown in .save() - django 1.0

2008-10-02 Thread Kurczak
Thank you for your input. I'd rather use forms and clean_ method, but I need to get object's pk (it object exists in db), is there any proper way to get it? I know I can override form's __init__ and pass the model, but I can't figure out which method creates the form and if I can pass model from

Re: FileField in ModelForm gets required field error with valid entry

2008-10-02 Thread bobhaugen
Rajesh, Thanks a million. That advice got me almost all the way there. Needed one more twist, because the file url was unicode, so created this method: def file_url(self): return encoding.iri_to_uri(self.file.url) Now it all works.

Re: Django log for admin

2008-10-02 Thread Rajesh Dhawan
> I have an application based around the admin. Is there a way to find > out which users have logged on to the application? You could look at the last_login field in the User objects. -RD --~--~-~--~~~---~--~~ You received this message because you are subscribed

Rendering just child template...

2008-10-02 Thread megrez80
Is there a way to render just a child template (without it's parent(s)) and pass the results back in response to an Ajax.Updater request? I want to do this to dynamically update a container in an already-rendered page. Ken --~--~-~--~~~---~--~~ You received

Re: Django 1.0 for brand new site

2008-10-02 Thread adamiis111
Based on some internal responses and this one, I think I'll choose Ubuntu over Debian. This will be a shell only machine since I'm running it on Amazon. Anybody have thoughts on me not using Ubuntu? Let's say Debian Lenny? I only ask here because I'm trying to stay with the pack on a standard

Re: Models - getting specific attributes question

2008-10-02 Thread WillF
Michael, Thanks for the response. I understand that part but what if i wanted to make it arbitrary. In the case of an arbitrary variable called "attribute". Something like user_profile.get(attribute) where attribute can be anything (ie 'firstname', 'lastname'). Is there a way to get a

Re: post_save signal and multi-table inheritance

2008-10-02 Thread Rajesh Dhawan
On Oct 2, 10:46 am, Ant <[EMAIL PROTECTED]> wrote: > Going with the multi-table inheritance example from the docs: > > class Place(models.Model): > name = models.CharField(max_length=50) > address = models.CharField(max_length=80) > > class Restaurant(Place): > serves_hot_dogs =

Re: FileField in ModelForm gets required field error with valid entry

2008-10-02 Thread Rajesh Dhawan
On Oct 2, 3:36 pm, bobhaugen <[EMAIL PROTECTED]> wrote: > Seehttp://dpaste.com/81988/ > > Ran some tests, FileFields work fine in admin. > > In a ModelForm, when I select a file with the Browse button, then > click the submit button, the FileField value disappears and I get a > required field

Re: Paginator - JSON - Serializing related issue

2008-10-02 Thread Rajesh Dhawan
Hi, > I have the following: > [snip] > def people_json(request): > userobjects = User.objects.filter(is_superuser=False).extra(order_by > = ['auth_user.username+0']) > p = Paginator(userobjects, 10) > pagenumber = request.POST.get('pagenumber', 1) > try: >

FileField in ModelForm gets required field error with valid entry

2008-10-02 Thread bobhaugen
See http://dpaste.com/81988/ Ran some tests, FileFields work fine in admin. In a ModelForm, when I select a file with the Browse button, then click the submit button, the FileField value disappears and I get a required field error. Did a bunch of googling, ran into this:

Re: Django Hangman

2008-10-02 Thread Ovnicraft
2008/10/2 chatchai <[EMAIL PROTECTED]> > > Hi all, > > I have built Hangman game using Django. You can see it at > http://feedfrog.net/app/hangman > > If anybody interest in its code, please contact me. > > Enjoy :) > Great !, you can link the src there? > > Chatchai > > > -- [b]question =

Re: Django 1.0 for brand new site

2008-10-02 Thread gordyt
Adam I'm using 1.0 with Python 2.5.2 (with Ubuntu servers) for my latest development work and couldn't be happier. --gordon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Django Hangman

2008-10-02 Thread gordyt
Very cute! --g --~--~-~--~~~---~--~~ 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 PROTECTED]

Django Hangman

2008-10-02 Thread chatchai
Hi all, I have built Hangman game using Django. You can see it at http://feedfrog.net/app/hangman If anybody interest in its code, please contact me. Enjoy :) Chatchai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Can QuerySet return array of raw data not in Dict?

2008-10-02 Thread Rajesh Dhawan
On Oct 2, 11:17 am, Adam <[EMAIL PROTECTED]> wrote: > Is there anyway to get QuerySet to return only the raw data from the > field not wrapped in a dictionary object? QuerySets support a values_list() call. http://docs.djangoproject.com/en/dev//ref/models/querysets/#values-list-fields Is

Re: Catching Exceptions thrown in .save() - django 1.0

2008-10-02 Thread Kurczak
Amazing! Thank you so much. Kurczak On 2 Paź, 20:24, Michael <[EMAIL PROTECTED]> wrote: > > Thank you for your input. > > I'd rather use forms and clean_ method, but I need to get > > object's pk (it object exists in db), > > is there any proper way to get it? > > I know I can override form's

Django 1.0 for brand new site

2008-10-02 Thread adamiis111
Django users will be glad to know that I've pretty much decided to use Python/Django for a new site I'm creating. I was getting sick of PHP and I'm not convinced that Ruby (Rails/Merb) is robust enough for my tastes, so I've ended up here. Still, I'm now wondering if anybody has thoughts on

Help Getting an error "invalid keyword argument for this function"

2008-10-02 Thread Karthik Krishnan
I have the following table in models.py class SiteAccessProcess(models.Model): """Object model mapping to the site_access_process table. Each element in the class represents a table column. """ instance_id = models.DecimalField( blank=False, max_digits=32, decimal_places=0,

Re: Catching Exceptions thrown in .save() - django 1.0

2008-10-02 Thread Michael
> > > Thank you for your input. > I'd rather use forms and clean_ method, but I need to get > object's pk (it object exists in db), > is there any proper way to get it? > I know I can override form's __init__ and pass the model, but I can't > figure out which method creates the form and if I can

Re: Something I don't understand when using get_absolute_url()

2008-10-02 Thread John Allen
On Oct 2, 10:27 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > > You are right, it wasn't necessary to add the domain name explicitly. > > I had only done this because of some earlier issues with flatpage URLs > > (where it was necessary to add the domain name). > > ??? I never used

Re: IntegrityError in admin with django-tagging

2008-10-02 Thread smcoll
Found help on IRC: Since my TagField is named "tags", i have to set ``tag_descriptor_attr`` to some other name when registering it. tagging.register(Post, tag_descriptor_attr='_tags') On Oct 2, 12:01 pm, smcoll <[EMAIL PROTECTED]> wrote: > Can someone tell me if i set up the model and admin

factory ModelForms

2008-10-02 Thread garces.85
Hello am new in django, am in a worry here. I have the next question: i have a ModelForm that must display some choices depending on an id of region. I have done it when i am saving a new registration( it only shows me the choices of the region a am logged on) But when a want to edit the regions

Re: IntegrityError in admin with django-tagging

2008-10-02 Thread smcoll
Can someone tell me if i set up the model and admin correctly? On Sep 30, 2:05 pm, smcoll <[EMAIL PROTECTED]> wrote: > i'm trying to get a TagField working in the admin for my model using > django-tagging 0.2.  i get an IntegrityError when i save my model from > the admin- it looks like django

Re: alphabetize options in a ForeignKey dropdown?

2008-10-02 Thread Rock
On Oct 2, 2:00 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-10-02, o godz. 01:03, przez Rock: > > > Have you tried setting the order within your model? I think that is > > the only simple way to tackle this at this time. > > >    class Meta: > >        ordering =

Re: Models - getting specific attributes question

2008-10-02 Thread Michael
On Thu, Oct 2, 2008 at 12:02 PM, WillF <[EMAIL PROTECTED]> wrote: > > > Michael, Thanks for the response. > > I understand that part but what if i wanted to make it arbitrary. In the > case of an arbitrary variable called "attribute". Something like > > user_profile.get(attribute) where attribute

Re: Dynamically appending a step to FormWizard

2008-10-02 Thread Rock
I cannot show you the entire code since the company lawyers have not had time to allow me to release this snippet, but I did get this working. However it was not easy and required some interaction with the guys who created FormWizard. My approach was to create a DummyForm which I put in the

Re: Something I don't understand when using get_absolute_url()

2008-10-02 Thread bruno desthuilliers
On 1 oct, 22:44, John Allen <[EMAIL PROTECTED]> wrote: > On Oct 1, 10:25 pm, bruno desthuilliers > > <[EMAIL PROTECTED]> wrote: > > I think this has to do with '/cms/' being defined in both your domain > > name and your apache conf's location directive. Since you tell Django > > the django.root

a simple API to SproutCore

2008-10-02 Thread Stefan Foulis
SproutCore is a javascript framework for rich client side applications running in the browser (http://www.sproutcore.com) I have just released a django app that makes communicating with the sproutcore client by REST quite simple. The project is hosted at google code:

Re: Dynamically appending a step to FormWizard

2008-10-02 Thread Rock
I can't show you the code yet since I haven't got permission to post it cleared from my company, but I got this working. (It was not easy and req --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

inheritance across apps

2008-10-02 Thread cardhu
Hello, I have succeeded in reusing a model with translation subclass {{{ class Content(models.Model): created = models.DateTimeField(_("created on"), editable = False) creator = models.ForeignKey(User, related_name="% (class)s_creator", editable = False) ...etc class

Re: Django model version control

2008-10-02 Thread David Hall
That is a problem, to be sure, and I'm not sure if a reasonable solution exists. As it stands, Django is currently lacking an automated rollback/recovery for models. The fullhistory branch tried to address this lack, but seems to have been abandoned for the time being. django-reversions

Can QuerySet return array of raw data not in Dict?

2008-10-02 Thread Adam
Is there anyway to get QuerySet to return only the raw data from the field not wrapped in a dictionary object? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: A little refactoring help please

2008-10-02 Thread Brandon Taylor
Thanks guys, I appreciate it. On Oct 2, 3:29 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 2 oct, 07:33, Travis Parker <[EMAIL PROTECTED]> wrote: > > > Instead of calling render_to_response on an empty template file you > > could simply return an empty django.http.HttpResponse and

Re: alphabetize options in a ForeignKey dropdown?

2008-10-02 Thread webcomm
Thanks James. That did the trick. --~--~-~--~~~---~--~~ 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

Re: Models - getting specific attributes question

2008-10-02 Thread Michael Newman
It's even easier than that: try user_profile.name if you need a specific variable field, remember it is just python so: >> from Model.models import Profile >> user_profile = Profile.objects.get(pk=1) >> attribute = 'name' >> getattr(user_profile, attribute) John Hope that helps, Mn On Oct 2,

post_save signal and multi-table inheritance

2008-10-02 Thread Ant
Going with the multi-table inheritance example from the docs: class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) class Restaurant(Place): serves_hot_dogs = models.BooleanField() serves_pizza = models.BooleanField() I was

Re: Catching Exceptions thrown in .save() - django 1.0

2008-10-02 Thread Michael Newman
Kurczak; Short of this is, catching specific errors in the save method and displaying them to the user are hard and you might be regurgitating items back to the user that they really don't have any business seeing (SQL errors, programming errors, etc.). The best way to check for the proper

Models - getting specific attributes question

2008-10-02 Thread WillF
Hi I'm new to django. Is there way to get a specific column from a specific table in a database when using Models. Say for instance I wanted just a list of user's firstnames or something. Also, with a instance of a Model, say for instance, UserProfile, is there a way to get an arbitrary

Re: Problems with dumpdata/loaddata

2008-10-02 Thread Russell Keith-Magee
On Thu, Oct 2, 2008 at 9:35 PM, Gary Thomas <[EMAIL PROTECTED]> wrote: > > I'm trying to use the admin interface to dump & restore my database, > without much luck. I can dump the data fine, but I've had no success > loading it back in. > > Could someone list the commands to do this? The actual

Re: _CheckLogin object has no attribute _meta

2008-10-02 Thread bobhaugen
Never mind, ignore, stupid programmer error... > section_form = section_form_class(request.POST, > instance=report) Shd be: > instance=section) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Problems with dumpdata/loaddata

2008-10-02 Thread Gary Thomas
I'm trying to use the admin interface to dump & restore my database, without much luck. I can dump the data fine, but I've had no success loading it back in. Could someone list the commands to do this? The actual commands is what I'm looking for (not present in the docs) - something that I can

_CheckLogin object has no attribute _meta

2008-10-02 Thread bobhaugen
Has anybody seen this error: Exception Type: AttributeError Exception Value: '_CheckLogin' object has no attribute '_meta' See also http://dpaste.com/81918/ Possibly related technique: I'm trying to use multi-table inheritance and a form dictionary to get the form class based on a

Re: Q about a ticket and merging into svn

2008-10-02 Thread Gerard Petersen
Russell, Thanx for the heads up. I've been using svn for a while, but it seems like I indeed need to brush on svn and patching. Mind you, in daily work my 'system/network administration' hat is bigger then my 'software development' hat. Anyway, thanx again! Regards, Gerard. Russell

Re: Change QuerySet of ModelMultipleChoiceField in a ModelForm

2008-10-02 Thread Karen Tracey
On Thu, Oct 2, 2008 at 8:46 AM, oversize <[EMAIL PROTECTED]> wrote: > > Hello > > in a ModelForm based Form, i have a ManyToManyField. I want only > specific objects of the Relation to be shown in the Forms > ModelMultipleChoiceField. > For my example, Motive and Textile belong to the same

Re: Template inheritance problem

2008-10-02 Thread tapautler
Looking at the comments in that ticket, I think you may need a redesign - sounds like conditional blocks weren't ever "meant" to be supported. I've done something similar using a template include at the point that you are putting your select block. I try to use includes sparingly but sometimes it

Change QuerySet of ModelMultipleChoiceField in a ModelForm

2008-10-02 Thread oversize
Hello in a ModelForm based Form, i have a ManyToManyField. I want only specific objects of the Relation to be shown in the Forms ModelMultipleChoiceField. For my example, Motive and Textile belong to the same Project, and i want only the Motives to Show in the ModelMultipleChoiceField that are

Re: Django model version control

2008-10-02 Thread Bas van Oostveen
But your schema's will most likely change over time. And sometimes in significant ways which do not have a likely default; e.g. splitting a full_name field into a first_name and last_name field or visa-versa. Now after applying this change to the database, how will django-reversions work when

Re: Q about a ticket and merging into svn

2008-10-02 Thread Russell Keith-Magee
On Thu, Oct 2, 2008 at 7:00 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: > > Hi all, > > I'm in need of the functionality of ticket #3672. I have de initial code > implemented. And there are some patches, but they seem to be diffs on files > in the main svn trunk. Yes - diffs against the

Q about a ticket and merging into svn

2008-10-02 Thread Gerard Petersen
Hi all, I'm in need of the functionality of ticket #3672. I have de initial code implemented. And there are some patches, but they seem to be diffs on files in the main svn trunk. The question with the easiest solution for me would be, when is the code from this ticket going to be merged

Re: reverse() outside HTTP-Context (SCRIPT_NAME)

2008-10-02 Thread Malcolm Tredinnick
On Thu, 2008-10-02 at 12:37 +0200, Thomas Guettler wrote: > Malcolm Tredinnick schrieb: > > To understand the problem you're trying to solve a bit better: why do > > you want it to add a (fake) script name in the non-HTTP case? > > Example: Send an email via cron that includes a link which >

Re: reverse() outside HTTP-Context (SCRIPT_NAME)

2008-10-02 Thread Thomas Guettler
Malcolm Tredinnick schrieb: > To understand the problem you're trying to solve a bit better: why do > you want it to add a (fake) script name in the non-HTTP case? Example: Send an email via cron that includes a link which was created with reverse(). The method which creates the link (and adds

Paginator - JSON - Serializing related issue

2008-10-02 Thread H. de Vries
Hey everyone, I have the following: [snip] def people_json(request): userobjects = User.objects.filter(is_superuser=False).extra(order_by = ['auth_user.username+0']) p = Paginator(userobjects, 10) pagenumber = request.POST.get('pagenumber', 1) try:

Re: reverse() outside HTTP-Context (SCRIPT_NAME)

2008-10-02 Thread Malcolm Tredinnick
On Thu, 2008-10-02 at 11:24 +0200, Thomas Guettler wrote: > Hi, > > if used in a view called from a http request, reverse() returns the > URL with SCRIPT_NAME (e.g. /my-wsgi-scriptalias/myview/) > > But if I call it from the shell, there is no SCRIPT_NAME since there > is no http request. > >

Re: Are a lot of people using SQLAlchemy with Django?

2008-10-02 Thread Erik Allik
There is a SQLAlchemy DB backend for Django that allows you to write Django ORM models on top of a SQLAlchemy ORM layer. But that's just if you need the Django ORM. For example if you want to use a database engine that is not supported by Django but is supported by SQLAlchemy. Or I guess

Re: Django model version control

2008-10-02 Thread Marek Stępniowski
2008/10/2 David Hall <[EMAIL PROTECTED]>: > Marek Stępniowski wrote: >> How does django-reversion deal with relationships between Django models? >> >> Version-controlling relationships between entities is an Achilles heel >> of such applications. I have read django-reversion docs on google code >>

reverse() outside HTTP-Context (SCRIPT_NAME)

2008-10-02 Thread Thomas Guettler
Hi, if used in a view called from a http request, reverse() returns the URL with SCRIPT_NAME (e.g. /my-wsgi-scriptalias/myview/) But if I call it from the shell, there is no SCRIPT_NAME since there is no http request. But if FORCE_SCRIPT_NAME is set, I think reverse() should use it. But it

Re: Admin UI Problems

2008-10-02 Thread jordanwlee
Ok after a few hours of experimenting and reading posts on here I finally got it working on OS X when installing django-cms make sure to COPY the /projectname/media/admin/cms files (admin.css cmslayout.css DateTimeShortcuts.js etc..) to /django_trunk/django/contrib/admin/media/ into a "cms"

dealing with legacy tables without primary key

2008-10-02 Thread Eric Simorre
I have just posted this in the dev group, but it should interest users too: http://groups.google.com/group/django-developers/browse_frm/thread/5611a45dc23f6e06 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Django model version control

2008-10-02 Thread David Hall
This is best explained by example. Let's say you have two models, Foo and Bar, both under version control. >>> class Bar(models.Model): ... pass ... >>> class Foo(models.Model): ... bar = models.ForeignKey(Bar) If you save an instance of Foo, then the primary key of the referenced

Re: A little refactoring help please

2008-10-02 Thread bruno desthuilliers
On 2 oct, 07:33, Travis Parker <[EMAIL PROTECTED]> wrote: > Instead of calling render_to_response on an empty template file you > could simply return an empty django.http.HttpResponse and avoid the > templating system overhead. > > I would generally send *something* in the response, even if

Re: Something I don't understand when using get_absolute_url()

2008-10-02 Thread bruno desthuilliers
On 2 oct, 07:36, John Allen <[EMAIL PROTECTED]> wrote: > Bruno, > Thanks, this helps a lot.> > > While we're at it : what's your use case for > adding the domain name to > > > > the url ? > > > > I'm doing this in a custom tag to produce a sidebar menu of recent > > > posts. > > > Recent posts

Catching Exceptions thrown in .save() - django 1.0

2008-10-02 Thread Kurczak
Hello there, I'm in need of some kind of validation at model level (and don't have time to wait till 1.1 lands). Now I'm doing it by raising exceptions in save method (I know how ugly it sounds). What can I do to propagate those exceptions to forms or handle them at some user-friendly level (so

Re: alphabetize options in a ForeignKey dropdown?

2008-10-02 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-10-02, o godz. 09:11, przez James Bennett: >> Anyway, I seem to be unable to change ordering of FKs relating to >> User >> object. Any hint? > > class UserProfileForm(forms.ModelForm): >user = >

Re: alphabetize options in a ForeignKey dropdown?

2008-10-02 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-10-02, o godz. 01:03, przez Rock: > Have you tried setting the order within your model? I think that is > the only simple way to tackle this at this time. > >class Meta: >ordering = ("fruit",) This will change default ordering across the whole site. To

Re: Problems with django.contrib.auth.views.login

2008-10-02 Thread F Pighi
On Oct 1, 9:55 pm, Denis Morozov <[EMAIL PROTECTED]> wrote: > Try >  {% if form.errors %} >                          Your username and password didn't match. >                          Please try again. > {% endif %} This is working, thank you :-)

Re: mod_wsgi and 500 error

2008-10-02 Thread Graham Dumpleton
On Oct 2, 3:41 pm, "Patrick J. Anderson" <[EMAIL PROTECTED]> wrote: > I'm running mod_wsgi, and I'm wondering if anybody else who uses mod_wsgi   > has experienced problems with Django directing requests to 500.html   > template when the server returns 500 status code. > > Is there any

Re: alphabetize options in a ForeignKey dropdown?

2008-10-02 Thread James Bennett
2008/10/2 Jarek Zgoda <[EMAIL PROTECTED]>: > Anyway, I seem to be unable to change ordering of FKs relating to User > object. Any hint? So, suppose you have the following model, a simple user profile: from django.contrib.auth.models import User from django.db import models class

Re: Problems with django.contrib.auth.views.login

2008-10-02 Thread F Pighi
On Oct 1, 11:21 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Assuming you are actually using Django 1.0, you'll need to keep in mind that > some things have changed (forms & admin definitions are two biggies) between > what the book is describing and the version you are using.  In cases where

Admin UI Problems

2008-10-02 Thread jordanwlee
Hello, I love the CMS but I am having some trouble in the admin area. I have a new install of django 1.0 on my macbook with MySQL database. I successfully installed the CMS and have it running. My problem is that I cannot drag the pages to reorder them. Unlike the demo on django-cms.org I am not

Admin UI Problems

2008-10-02 Thread jordanwlee
Hello, I love the CMS but I am having some trouble in the admin area. I have a new install of django 1.0 on my macbook with MySQL database. I successfully installed the CMS and have it running. My problem is that I cannot drag the pages to reorder them. Unlike the demo on django-cms.org I am not