Order of Middleware

2008-11-17 Thread Peter
When I run django admin and do startproject I get a settings file that has: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) In the global_settings.

Re: Python and/or django book

2008-11-17 Thread Peter
at and the Django book mentioned here using a Safari subscription through DevX for about $9 per month. This is a good idea to see if you like a book enough to buy it! Cheers, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Access the HTTP request from a model

2008-11-24 Thread Peter
nyone tell me how? Thanks -- Peter --~--~-~--~~~---~--~~ 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

Re: Access the HTTP request from a model

2008-11-25 Thread Peter
Absolutely - that is exactly what I needed to know. Thanks! There is a link http://www.djangoproject.com/documentation/models/save_delete_hooks/ which I had looked at which actually turns out to be the wrong one. -- Peter > > Take a look at the following > doc:http://docs.djangoproje

Best way to create a for a subset of a model

2008-12-07 Thread Peter
Say I have model with many fields but I want to present a form to edit just a subset of these. The ModelForm class makes preparing a form for a whole model v. easy - somehow it seems there will be a neat way for doing this but I have not been able to find one. Is there such? Thanks, --~--~-

Re: Best way to create a for a subset of a model

2008-12-07 Thread Peter
t works. I tried it before but it didn't, but I must have screwed up somehow! -- Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Restricting add in the admin

2008-12-19 Thread Peter
common use-case. I am still pretty new to Django so excuse if this is a FAQ. -- Peter --~--~-~--~~~---~--~~ 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@google

Re: Restricting add in the admin

2008-12-19 Thread Peter
that could be set on a model when it was defined which set default permissions for 'staff' on the model (or even for superuser) on that model. Regards, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &qu

Re: Restricting add in the admin

2008-12-19 Thread Peter
ecause being a singleton (and not removable) should be, I think, an *attribute* of the class/model not of a particular user or a group. Cheers, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: Restricting add in the admin

2008-12-20 Thread Peter
Yes - perhaps add a Boolean field (not shown in the admin) 'is_active' Thanks, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Re: Restricting add in the admin

2008-12-20 Thread Peter
> Very relevant, don't forgot to overload the save method to set > other is_active to 0! > > Regards, James. Ah - yes that would seem a good idea :-). P. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django user

Inline problem in Postgres but not MySQL

2008-12-30 Thread Peter
the number. However if I add more than one phone number I cannot change or delete numbers. Changing from PostgreSQL to MySQL this issue disappears. There is no useful error information I can access (just the default ValidationError). Has anyone any idea what this

Re: Inline problem in Postgres but not MySQL

2008-12-30 Thread Peter
Thank you Ana, I checked that out - but I don't understand how it works (at least not without looking at the other models). Is Django less solid with Django than MySQL? I mean my example is a trivial 'text book' example and it did not work with PostgreSQL -- Peter On Dec 3

Re: Inline problem in Postgres but not MySQL

2008-12-30 Thread Peter
s. It does include an ordering already but I presume not the right one? Thanks for yur help here - an amazing list this. -- Peter > > Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&qu

Re: Inline problem in Postgres but not MySQL

2008-12-31 Thread Peter
I just installed 1.0.2 final and the bug has been fixed in that. -- Peter --~--~-~--~~~---~--~~ 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@googlegro

Re: Installing Django 1.0.2...

2008-12-31 Thread Peter
s\django should work. -- Peter On Dec 31, 8:46 am, mic wrote: > I am a first time python/django user.. > > Running "python setup.py install" from django-1.0.2-final directory > gives me this error > > Traceback (most recent call last): >   File "setup.py",

Validating imported data

2009-01-12 Thread Peter
way that I can validate the data without using a form? Or is there I can interface with the form validation with using a form? Thanks, ~Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Date from django to form and back again.

2008-09-29 Thread Peter
o cover it) If it isn't blank I want to use it's value to create a date in django. This is the bit that is giving me grief. I know it's gotta be ultra simple but I haven't found it. Cheers, Peter --~--~-~--~~~---~--~~ You received this m

Re: Date from django to form and back again.

2008-09-30 Thread Peter
fromtimestamp is exactly the ticket. Thanks! On Sep 30, 6:16 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-09-29 at 14:08 -0700, Peter wrote: > > Hi folks, > >   I want to check a form when it submitted to see whether it contains > > an input cal

Opera File Upload Issue

2009-03-30 Thread Peter
I'm having an opera file upload issue, which may not be django's fault, but I'm curious if anyone has seen it (and has a solution)... When I upload an image *only in opera* (specifically 9.64 on mac osx) it doesn't appear in request.FILES. However, if I upload a really small image 8kb, it works.

Django fastcgi randomly raising OperationalError

2009-04-21 Thread Peter
osed to call close() myself when I am done? Right now I don't call close anywhere. Any pointers, suggestions, or solutions would be tremendously appreciated. The site is going live on a couple weeks and if I can't get to the bottom of this I will probably switch to using Apache and mod_w

how to change database within Django.

2009-04-30 Thread peter
iable. How can I get around this dealing with multiple database search problem? Thanks, -Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: how to change database within Django.

2009-04-30 Thread peter
x27;t an easier way to do this, then I will have to think of another framework alternative...perhaps RoR. -peter On Apr 30, 12:54 pm, Daniel Roseman wrote: > On Apr 30, 6:45 pm, peter wrote: > > > Hello, > >   I'm an newbie so please bear with me. > > >   I hav

MySQLdb (python 2.6/django from subversion)

2009-12-04 Thread Peter
uld be better on another list, please let me know which one and I'll post there. I wasn't sure if I should post here or on a more general python list. Cheers Peter -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

"Error: cannot import name comments" during syncdb

2010-04-20 Thread Peter
unk of) my settings.py at the bottom of this email. (I've just started trying to integrate Paypal, but that code is commented out and the problem arose before I started doing that, so I'd say that's a red herring.) Thanks in advance, Peter settings.py: # -*- coding: utf-8 -*- #

Variable-length forms

2010-05-03 Thread Peter
page? Or do I have to use the Form Wizard with a variable number of steps? Is that even possible? Thanks for any help you can give, Peter -- 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

Re: Variable-length forms

2010-05-05 Thread Peter
Thanks. I'd totally misread what that page was about. Now I see it's basically what I want. Cheers. On May 4, 9:02 am, Shawn Milochik wrote: > http://docs.djangoproject.com/en/1.1/topics/forms/formsets/ > > That ought to help out. > > Shawn > > -- > You received this message because you are su

Job opportunity - Newcastle, NSW, Australia

2010-02-21 Thread Peter
Hi all Please see: http://tinyurl.com/djangojob for a job being advertised by NSW Rural Doctors Network in Newcastle, NSW, Australia. Thanks. Peter J Williams Information Manager NSW Rural Doctors Network Head Office Suite 19, Level 3 133 King Street Newcastle NSW 2300 Telephone: (02) 4924

delayed_loader and psyco: IndexError issue

2008-02-11 Thread Peter
I'm having the same issue as seen in this post: http://groups.google.com/group/django-users/browse_thread/thread/4eb598a52fee2d14/49cd8b7eae6bd72e?lnk=gst&q=delayed_loader I'm getting an IndexError: "list index out of range" in delayed_loader.py when it tries to make the call: caller = trac

Template Question - What if...

2008-02-11 Thread Peter
I have a bunch of widgets that I access dynamically and they render their own parts of a page. I would like to give these widgets the ability to use templates. Furthermore, these are not installed apps, so I do not have access to the "django.template.loaders.app_directories.load_template_source"

Re: Template Question - What if...

2008-02-12 Thread Peter
source(template_name, dirs) template = get_template_from_string(source, origin, template_name) return template On Feb 12, 12:26 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-02-11 at 16:55 -0800, Peter wrote: > > I have a bunch of widgets that I access dynamically and t

Re: File Upload, form issue

2008-05-02 Thread Peter
It's probably one of two things: 1. You might be pointing to the wrong template, load the page in your browser and hit view source to ensure that your form is indeed doing enctype="multipart/form-data", and that whatever url you're pointing to for the action attribute is blank or for debugging, t

Admin panel question

2008-05-25 Thread peter
Hello everyone. I've just begin my adventure with Django, and I have some problems. I want to add some custom functions to admin site. For example, I want to add method from not model class, which sends email to specify users, or something similar. Is it possible? Where I can find information abou

Creating a request object + middleware benefits

2008-05-29 Thread Peter
I'm looking for a quick and simple way to create a request object - as it would be received by a specific view - for some very basic testing. Additionally, I want this object to have all the added attributes from the middleware modules e.g. request.user. I tried this: (1) I looked at django.htt

using only database part of Django

2008-06-26 Thread Peter
Hello. I want to use Django database API without using other parts of Django (views, templates etc). What is the most correct way of doing that? Of course, I can create a new project with an empty template and view, but it will look bad, cause there will be a lot of needless files in my project

connection.queries - show improper SQL?

2008-07-08 Thread Peter
When I look at generated sql from connection.queries, it doesn't show any quotes around strings. For example: >>> from django.db import connection >>> from django.contrib.auth.models import User >>> User.objects.filter(username="bob") [] >>> connection.queries[-1] {'time': '0.000', 'sql': u'SELEC

connection.queries - show improper SQL?

2008-07-08 Thread Peter
quot;Unknown column 'bob' in 'where clause'". It's obvious how I would change that code to execute properly, but I'd like to know exactly what query django is building. (for example you can get away with passing a number into a query against a var

Table Locks with Django? (MyISAM)

2007-10-30 Thread Peter
Is there any way to do a table lock through the django database api? I can't find information on it anywhere. Hi all, I'm using MySQL MyISAM tables, which means transactions don't work -- but they do support table locks. If not directly through the django api, is there some hybrid of raw SQL an

MyISAM table locking.

2007-11-06 Thread Peter
Hi All, I tried writing some code to do table locking on a MySQL MyISAM database. I used the code below, which seemed to work in basic examples, but the code would complain of accessing a non-locked table whenever I made a more complex query such as objects.filter(__) saying that the table __ wa

Re: MyISAM table locking.

2007-11-06 Thread Peter
Very nice, thanks for the detailed response! -Peter On Nov 6, 12:53 pm, Karen Tracey <[EMAIL PROTECTED]> wrote: > At 10:40 AM 11/6/2007, you wrote: > > >Hi All, > > >I tried writing some code to do table locking on a MySQL MyISAM > >database. I used the co

Re: Dynamic ImageField

2007-11-13 Thread Peter
rride this vs the _save_FIELD_file method as shown in this example: http://gulopine.gamemusic.org/2007/11/customizing-filenames-without-patching.html Regards, Peter On Nov 8, 11:26 pm, cschand <[EMAIL PROTECTED]> wrote: > Hi Marcin >It's working... Thankyou very much :) > &

Re: Dynamic ImageField

2007-11-13 Thread Peter
self.id) and I tried getting the filename within the save_file method as such: file_name = os.path.join(settings.MEDIA_ROOT, getattr(new_object, self.attname)) Thanks for any help! On Nov 13, 11:30 am, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On Nov 13, 2007 11:03 AM

django.db.models.Q for OR lookup is having issues with NULL values

2008-01-02 Thread Peter
I am trying to filter by users who are not staff, but this user column accepts NULL values in my model. As a result I need to check for user__isnull, since user__is_staff=False will not work for null values. I tried: Post.objects.filter(Q(user__isnull=True) | Q(user__is_staff=False)) but this

Value Error during 1.2 to 1.4 conversion

2012-10-07 Thread Peter
I'm trying to convert a Django 1.2 site to a 1.4 site. So there's lots of changing old generic views to class-based generic views, and the apps all go up one level so lots of changes to imports, but in each case so far it's it's been quite easy to narrow down the problem to a line in my code, a

Re: Value Error during 1.2 to 1.4 conversion

2012-10-10 Thread Peter
Thanks. That pointed me in the right direction. First, I didn't realize that the 'url' form required named parameters. However, I was using the non-url form, and it turned out in the conversion to class-based generics, I had left off the "{}" third object in each list. So it was expecting a dict

Re: LDAP search results "disappear"

2012-12-17 Thread peter
On 12/17/2012 03:58 PM, Kevin Cole wrote: On Mon, Dec 17, 2012 at 1:57 PM, Kevin Cole wrote: And here I'll display my ignorance about threading. I've done nothing specific to ask for threading. I wouldn't know how to thread even if I had a sewing machine. ;-) I'm using apache prefork with mod

Re: Converting Django app into a Desktop app

2012-12-18 Thread peter
On 12/18/2012 04:27 PM, Loai Ghoraba wrote: @ all thanks for your responses, I will try to investigate them @Chris: you got me right :) I can use runserver, but it would be too light, or make the client install and configure apache (which is not a good idea if the client is a normal user, not

Re: Converting Django app into a Desktop app

2012-12-18 Thread peter
On 12/18/2012 05:18 PM, Chris Cogdon wrote: No Python included with xampp... this makes me sad ;_; On Tuesday, December 18, 2012 11:43:56 AM UTC-8, peter_julian wrote: You can use xampp. Create a automatic installer that install xampp and django with your app. Just like Kordi EDMS.

Re: Converting Django app into a Desktop app

2012-12-18 Thread peter
On 12/18/2012 05:18 PM, Chris Cogdon wrote: No Python included with xampp... this makes me sad ;_; On Tuesday, December 18, 2012 11:43:56 AM UTC-8, peter_julian wrote: You can use xampp. Create a automatic installer that install xampp and django with your app. Just like Kordi EDMS.

Re: Django community, is it active?

2012-12-19 Thread peter
Yeah man, we are alive. :). You wanna be part of us. Don't be afraid, just take a seat, to share, implement, etc, etc. On 12/19/2012 10:32 AM, Tom Christie wrote: > Is this worth going? --- http://2013.djangocon.eu Yes, yes, yes, yes, and yes. I've been to two

Re: Django community, is it active?

2012-12-20 Thread peter
On 12/19/2012 07:09 PM, Glyn Jackson wrote: @Odagi point well made. thanks for everyone for being so welcoming :0 I spent today building my first Django local site, ended up with 4 apps. taken me awhile to get my head around things i ended up with registration - handles my user signed

Re: new user

2012-12-21 Thread peter
On 12/21/2012 02:13 PM, Satinderpal Singh wrote: On Fri, Dec 21, 2012 at 5:57 PM, senthil mariyappan wrote: hi friends, i new one to django.. Welcome, man. I hope we can help you!!. Welcome to the Django family. -- Satinderpal Singh http://satindergoraya.blogspot.in/ http://satindergoraya9

Easiest Way to Deploy Django?

2013-02-21 Thread Peter
iar with how to use Postgres. Should I learn how to work with a real database first? Thanks! Peter -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an e

Re: Easiest Way to Deploy Django?

2013-02-23 Thread Peter
Thanks Russell for your answer. I've been playing with Postgres and it's not nearly as complicated as I thought. I'll have to figure out how to deploy postgres in production, wish me luck. Best, Peter On Thursday, February 21, 2013 4:25:00 PM UTC-8, Russell Keith-Magee wrot

Reverse Lookup Failure on password change/reset views

2013-07-23 Thread Peter
ion/password_reset/ Reverse for 'django.contrib.auth.views.password_reset_done' with arguments '()' and keyword arguments '{}' not found. Request Method: GET Request URL: http://127.0.0.1:8000/registration/password_reset/ Django Version: 1.5.1 Exception Ty

Re: Reverse Lookup Failure on password change/reset views

2013-07-24 Thread Peter
> used the url tag in the template wrong - it changed between two django versions Thanks Christian, but I'm pretty sure the reverse is being invoked from the Django auth code (django.contrib.auth.password_reset) , not my template; nevertheless the template I'm using (registration/password_reset

Re: Reverse Lookup Failure on password change/reset views

2013-07-24 Thread Peter
On Wednesday, July 24, 2013 4:46:07 PM UTC+9:30, Peter wrote: > > > django.contrib.auth.password_reset > Sorry, that should be: django.contrib.auth.views.password_reset -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Reverse Lookup Failure on password change/reset views

2013-07-24 Thread Peter
> Sorry, that should be: django.contrib.auth.views.password_reset In fact, I'm pretty sure it's this line of code in auth:: File "/usr/local/lib/python2.7/ dist-packages/django/contrib/auth/views.py" in password_reset 147. post_reset_redirect = reverse('django.contrib.auth.views.passw

Re: Reverse Lookup Failure on password change/reset views

2013-07-27 Thread Peter
Yep, that fixed it. Thanks. I still think it's wrong of django not to find it by view name though... > Probably because you've included it under a namespace, so Django would > need to look for it as "registration:whatever". There's no need to use the > namespace in the include call. > -- > DR

Help with a somewhat complex reverse ForeignKey lookup.

2011-01-12 Thread Peter
If I have a couple of models like these (just an example) class Parent(models.Model): name = models.CharField(max_length=100) class Gender(models.Model): name = models.CharField(max_length=100) class Child(models.Model): entity = models.ForeignKey(Entity, related_name=’children’)

Re: Flatten template?

2011-01-12 Thread Peter
Please add to djangosnippets I'm somewhat interested in what you have done. -- 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: Help with a somewhat complex reverse ForeignKey lookup.

2011-01-12 Thread Peter
And your example of course worked It's obvious really and just stupid of me. Thanks -- 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 ema

Non-Ascii Characters in URL causes crash

2013-11-20 Thread Peter
ck. Should I just ignore this? Peter Traceback (most recent call last): File "/home/peter/django-ductedit/django/core/handlers/base.py", line 92, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/home/peter/django-ductedit/django/contr

Re: Split a form up in the template/view?

2008-10-22 Thread Peter Bengtsson
On Oct 22, 5:10 pm, Ardesco <[EMAIL PROTECTED]> wrote: > Taking an example from Chapter 7 of the Django Book: > > from forms import PublisherForm > > def add_publisher(request): >     if request.method == 'POST': >         form = PublisherForm(request.POST) >         if form.is_valid(): >      

Re: www.djangosnippets.org is down now?

2008-10-22 Thread Peter Bengtsson
When I get an error on viewing a snippet I copy the URL into Google and click the Cached version. On Oct 22, 5:08 pm, Gmail <[EMAIL PROTECTED]> wrote: > i found lots of snippets to download,but the server always says it is   > down. --~--~-~--~~~---~--~~ You receiv

Re: Django Suitability

2008-10-22 Thread Peter Bengtsson
On Oct 22, 3:56 pm, "Matthew Talbert" <[EMAIL PROTECTED]> wrote: > Hi all, > > I am being considered for a project that would involve re-writing an > application which is currently in MS Access/VBA. The application is an order > entry/shop management software for a small vertical market. I am st

Re: ViewDoesNotExist: Even though it does

2008-10-22 Thread Peter Bengtsson
Have you written a unit test that executes the view? If so, and if it doesn't always happen, you can run the unit test over and over quickly to see if it has something strange to do with the order of how things are important or something crazy like that. By the way, writing tests can often help fi

Re: second post:Please answer!How to compare from two models in the same function (view)?

2008-10-22 Thread Peter Bengtsson
On Oct 22, 1:23 pm, Net_Boy <[EMAIL PROTECTED]> wrote: > Hi, >    I am trying to make a view function to get the posted values and > make some comparison (if x.value >= y.value).. > where x is the model that I got it's values from the post > and   y is the other model . > > example: > > def comp

Re: Accessor for field 'user' clashes with related field 'User.*'

2008-10-22 Thread Peter Bengtsson
I don't see what splitting it up into "sub apps" has anything to do with it? What happens when you add the related_name attribute to your model fields? Here's some code from one of my apps: class M(models.Model): ... from_user = models.ForeignKey(User, null=True, related_name='from')

Re: Forms generated from models missing primary key

2008-10-22 Thread Peter Bengtsson
On Oct 22, 8:24 am, MrMuffin <[EMAIL PROTECTED]> wrote: > I'm generating html forms from models using ModelForm. When I do > something like : > > >>> article = Article.objects.get(pk=1) > >>> form = ArticleForm(instance=article) > Change it's widget to hidden I think should work >>> from django

Re: Test client: how to tell if user is logged in?

2008-10-22 Thread Peter Bengtsson
It's definitely possible. Here's an example: from django.contrib.auth.models import User staff = User.objects.create_user(username='s', password='s', email='[EMAIL PROTECTED]') #staff.is_staff = True client = Client() assert client.login(username='s', pass

Re: www.djangosnippets.org is down now?

2008-10-22 Thread Peter Bengtsson
Not down but you get lots of errors. They're probably working on it. I hope. On Oct 22, 5:08 pm, Gmail <[EMAIL PROTECTED]> wrote: > i found lots of snippets to download,but the server always says it is   > down. --~--~-~--~~~---~--~~ You received this message becau

Re: What do you use for design interface / mockup

2008-10-23 Thread Peter Herndon
e job done with them. If cross-platform is not your highest priority, I'd pick OmniGraffle and Acorn, with Photoshop and such as the big guns, as required. Though, there's a lot to be said for wireframing in HTML, and for paper prototypes. ---Peter On 10/23/08, Gerard Petersen <[EMAIL

Re: Noon Help

2008-10-27 Thread Peter Herndon
I might also suggest django-registration (http://code.google.com/p/django-registration) to handle your user registration needs. On Mon, Oct 27, 2008 at 2:34 PM, Jeff Anderson <[EMAIL PROTECTED]> wrote: > Johnny Utah wrote: >> Thanks for the input. >> >> When you say Django.admin would be useful,

How to chain filters with multi-value realtions?

2008-10-29 Thread Peter Krantz
the collection to remove items? Regards, Peter [1]: http://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi-valued-relationships --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Multiple saves without redirecting

2008-11-05 Thread Peter Bailey
. Must be from all those years of MS web programming that have clouded my brain! Cheers, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: Multiple saves without redirecting

2008-11-05 Thread Peter Bailey
Well that sounds very logical. Thanks very much. I'll make the changes and give it a go. Thanks again, Peter On Nov 5, 11:51 am, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Nov 5, 3:54 pm, Peter Bailey <[EMAIL PROTECTED]> wrote: > > > > > I want to create

Re: Newbie question: HTML formatting not applied to pages

2008-11-06 Thread Peter Rowell
You're being tripped up by auto-escaping of variable contents. This is a security feature that was first introduced in November of last year. (http://code.djangoproject.com/changeset/6671) See http://docs.djangoproject.com/en/dev/ref/templates/builtins/#autoescape --~--~-~--~~

Turning key=value1&key=value2&key=value3 into a list

2008-11-12 Thread Peter Bengtsson
If I publish http://someurl/myview?foo=1&foo=2&foo=3 How do I turn this into foo = ['1','2','3']? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

Re: ImageField upload_to not workin

2008-11-14 Thread Peter Bengtsson
On Nov 14, 9:31 pm, Javier <[EMAIL PROTECTED]> wrote: > Hi, > > I've create a model: > > class ImagenesLugar(models.Model): >     archivo = models.ImageField(upload_to="imageneslugar/") >     texto = models.CharField(max_length=400) > > The thing is that when i create a new instance of this mode

Re: psycopg2 Visual Studio installation error on XP

2008-11-17 Thread Peter Herndon
le to help you. You should also look around for pre-compiled binaries of psycopg2 for Windows, as the packagers will have taken this compiler mismatch issue into account. ---Peter On 11/17/08, dj <[EMAIL PROTECTED]> wrote: > > Hello All, > > I am django novice and i am very,

Re: Setting Up Django on Vista and Creating a Database

2008-11-17 Thread Peter Herndon
The other thing that comes to mind is, have you installed the MySQLdb python library? If you want to connect to a database from a Python app, you must also install a library that bridges Python and the database. (I apologize in advance if you've already done so). ---Peter On 11/17/08,

Re: Keeping fields out of the Admin

2008-11-22 Thread Peter Rowell
On Nov 21, 10:58 am, maeck <[EMAIL PROTECTED]> wrote: > Please note that the result of this is that if you use > 'editable=False' this field is not visible in the admin at all. > As far as I know there is no good way (see below) of putting read only > data in an admin page. The world is strange.

locmem or memcache

2008-11-28 Thread Peter Bengtsson
What's faster, locmem or memcache? I know that the docs rave on about how fast memcache is but what about locmem? That sounds pretty fast to me since it doesn't need another TCP service and just uses the RAM. My particular site (for mobile phones without any media) is so tiny that I wouldn't worr

Re: Ordering bookeditions by their rating

2008-11-28 Thread Peter Bengtsson
The trick is to use .query.group_by. Here's an example that will work:: >>> from collection.models import Edition, User, Rating >>> Rating.objects.all().delete() >>> Edition.objects.all().delete() >>> >>> e1 = Edition.objects.create(title=u'Title1', binding=u'') >>> e2 = Edition.objects.create(ti

ForeignKey value return from web page

2008-12-03 Thread Peter Bailey
does something similar. Thanks very much, Peter --~--~-~--~~~---~--~~ 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

Re: ForeignKey value return from web page

2008-12-03 Thread Peter Bailey
, 3:25 pm, Peter Bailey <[EMAIL PROTECTED]> wrote: > > > > > I am trying to use ForeignKey data returned from a page and view, and > > am having trouble. I am missing something fundamental I think. > > > Say I have 2 models > > > class TopModel(models.Mod

Re: django and favicon.ico problem

2008-12-17 Thread Peter Herndon
ght solve that issue. If I get a chance I'll test it today, see if works. Has anyone else experimented with this? ---Peter On 12/16/08, Malcolm Tredinnick wrote: > > > On Tue, 2008-12-16 at 02:45 -0800, architecture wrote: >> i was working with php and always i put the favic

Re: Custom form/formset for edit inline

2008-12-18 Thread Peter Shafer
is my admin.py http://dpaste.com/100468/ I don't get any errors, but my inline forms remain unchanged. Peter On Nov 17, 10:33 am, Ben Gerdemann wrote: > I'm having exactly the same problem which I posted about > herehttp://groups.google.com/group/django-users/browse_thread/thre

Re: Custom form/formset for edit inline

2008-12-18 Thread Peter Shafer
It seems to be working now once I made the following changes to admin.py http://dpaste.com/100570/ On Dec 18, 1:56 pm, Peter Shafer wrote: > I'm also having the same problem as Emil.  I have pictures that belong > to galleries so I use inline forms to manage them.  I also use the

Re: Django-like PHP framework?

2009-01-05 Thread Peter Bailey
You might want to have a look at CakePHP. It follows the MCV pattern I believe, although I have not looked closely because it is PHP not Python. http://cakephp.org/ Peter On Jan 5, 8:31 am, "thi.l...@gmail.com" wrote: > Hi, > > I have a hard time getting Django adopted

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Peter Herndon
"Practical Django Projects" is a bit dated at the moment -- Django has been moving very quickly. However, there's a lot to learn from it, particularly regarding structuring your applications to be reusable, and lots of other best practices. I'm in the middle of "Python Web Development with Djang

Re: Unique Case Sensitivity

2008-07-16 Thread Peter Melvyn
ase insensitive. > This doesn't just affect unique constraints - it affects case > sensitive matching as well. Not only default setups. See http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html for available collations - all collations are case insensitive except the xxx_bin one.

Migrating to newforms-admin and classes already registered error

2008-07-22 Thread Peter Bailey
wrong. Feeling kinda stupid about now... Thanks, Peter --~--~-~--~~~---~--~~ 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 unsubscri

Re: Migrating to newforms-admin and classes already registered error

2008-07-22 Thread Peter Bailey
That works much better Malcolm, thank you very much. Appreciate the explanations too. Cheers, Peter On Jul 22, 3:23 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-07-22 at 12:21 -0700, Peter Bailey wrote: > > Hi all. I am attempting to convert an app I am wri

More advanced test runner available?

2008-08-25 Thread Peter Bengtsson
Is there an alternative to the test runner that comes by defauly with Django (svn version)? The one that you get doesn't have colour coding and it doesn't have the option to stop all other tests after the first failure. --~--~-~--~~~---~--~~ You received this messag

Discover tests in forms.py

2008-09-04 Thread Peter Bengtsson
>From http://www.djangoproject.com/documentation/testing/ "4. Looking for unit tests and doctests in the models.py and tests.py files in each installed application." Next to models.py I have forms.py which does exactly what the filename suggests: it defines forms. I've put some doctests in these

Re: Discover tests in forms.py

2008-09-04 Thread Peter Bengtsson
> If your looking for an example to follow, the code for > django.test.simple isn't too hard to tear apart and customize for your > own purposes. OK. Here's how I solved it: from django.test.simple import * from django.test.simple import run_tests as orig_run_tests # my app is called 'classes'

Problem with filtering on DateTimeField

2008-09-05 Thread Peter Bengtsson
e__month=, date__day= but that feels a bit excessive. At the moment I've solved my problem by doing a __range but I really want to know why it doesn't work. Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Stupid noob question - admin link

2008-09-09 Thread Peter Bailey
link back the other way. Don't see an obvious way to do this. Can anyone tell me a easy way to add a hyperlink from the main admin page to somewhere else outside the admin app. Thanks, and sorry for the dumb question. Peter --~--~-~--~~~---~--~~ You received

  1   2   3   4   5   6   7   8   9   10   >