Reverse tag of safe

2009-03-24 Thread Alessandro Ronchi
I need to translate html entities on utf-8 characters, like à to à is there any template tag filter which can do that? -- Alessandro Ronchi Skype: aronchi http://www.alessandroronchi.net SOASI Soc.Coop. - www.soasi.com Sviluppo Software e Sistemi Open Source Sede: Via Poggiali 2/bis, 47100 Forlì

Re: Reverse tag of safe

2009-03-24 Thread Malcolm Tredinnick
On Tue, 2009-03-24 at 09:18 +0100, Alessandro Ronchi wrote: > I need to translate html entities on utf-8 characters, like à > to à > is there any template tag filter which can do that? Not in the core distribution, no. I don't know if there's any third-party filter to do so. Regards, Malcolm

ModelChoiceField - large lookup tables

2009-03-24 Thread PNM
Before I re-invent the wheel: is there any generally accepted or recommended generic way to handle ModelChoiceFields with very large datasets in Django? My current example is an address>post/ZIP-code relationship where Django's automatic field creation pulls in the whole postcode table with thous

Re: ModelChoiceField - large lookup tables

2009-03-24 Thread Thomas Guettler
Hi, for the Admin Interface there is raw_id_fields. In the code of my application I use my ButtonWidget. It renders itself as a hidden Input field and a button. If you click on the button you get a query page to search for the related object. After selection it writes the value back to the hidde

Re: inconsistency between remove() and clear()?

2009-03-24 Thread Thomas Guettler
Hi, book2.publisher is an attribute which was created before you deleted it. If you get book2 again from Book.objects, this attribute would not exist anymore. I have not looked at the underlaying django source, but I guess that remove(obj) removes the attribute from obj. But clear() can't do th

Re: Reverse tag of safe

2009-03-24 Thread Thomas Guettler
Hi, google for "entity resolver python". I recall that I did something like this. You could ask on comp.lang.python, too. If you got it working in python you can create a template tag. Thomas Alessandro Ronchi schrieb: > I need to translate html entities on utf-8 characters, like à to à > is

Why save on attributes is no good?

2009-03-24 Thread Filip Gruszczyński
If I create some model like this, it's ok: sm = SomeModel() sm.save() self.sm = sm But if I try to this: self.sm = SomeModel() self.sm.save() Then when I try to save self, OtherModel.save(self), because it wasn't yet saved I receive information, that self.sm id wasn't set (and it can't be null

Re: inconsistency between remove() and clear()?

2009-03-24 Thread Russell Keith-Magee
On Tue, Mar 24, 2009 at 6:10 PM, Thomas Guettler wrote: > > Hi, > > book2.publisher is an attribute which was created before you deleted it. > If you get book2 again from Book.objects, this attribute would not exist > anymore. > > I have not looked at the underlaying django source, but I guess th

django admin

2009-03-24 Thread Lakshman Prasad
Hi, I was thinking that django admin is an utility to provide trusted administrators of the site, full access to the site's data model. However, after going through django admin in detail, I understand that it is very powerful set of views and templates that one can use to create an entire applic

django with wing IDE

2009-03-24 Thread Lakshman Prasad
Hi, With the latest beta version of Wing 3.2, the auto complete of attributes happen during debug, by sniffing the current python namespace. This means that, even the ORM objects should auto complete in the IDE. But hooking wing run to django run server itself is a huge process. Can somebody wh

Re: Why save on attributes is no good?

2009-03-24 Thread Briel
Hi I'm not sure exactly how this work, but. Your problem is how the data is saved and retrieved.If you do self.sm_id after the save(), you will get the id by reference, but when the model itself needs to be saved, it need the data itself, which it hasn't, or something like that Anyways, to get i

Re: Multiple ModelAdmins for a single Model

2009-03-24 Thread Dan Ward
To follow up, I can see how I can achieve different forms, however I can't figure out how to provide three separate links in the admin index page. Any suggestions? On Mar 22, 11:22 am, Dan Ward wrote: > Hi, > > First of all thanks for the replies. I won't be able to try anything > until tomorr

Re: JSON Model Serialization

2009-03-24 Thread gchuyun
i tried this, but get a error similar. TypeError: [{'publish_time': datetime.datetime(2009, 3, 24, 16, 16, 18), 'is_deleted': 0, 'is_confirmed' : 0, 'title': u'1', 'content': u'111', 'id': 1L}, {'publish_time': datetime.datetime(2009, 3, 24, 16 , 27, 50), 'is_deleted': 0, 'is_confirmed': 0, 'titl

Re: Templating language Include path dilemma

2009-03-24 Thread Colm
On Mar 24, 12:42 am, Malcolm Tredinnick wrote: > On Mon, 2009-03-23 at 17:21 +, Colm Dougan wrote: > > > There is, however, no concept of "context" passed through to the > template loader. Everything is loaded from the same base situation, > which is what I believe your question is asking.

Languages problem

2009-03-24 Thread knight
Hi, I have the following class in my models.py: class MainCategory(models.Model): title = models.CharField(max_length=50) value = models.DecimalField(default=0, max_digits=5, decimal_places=3) secid = models.SlugField(max_length=1000, editable=False) def save(self): if no

replace admin login

2009-03-24 Thread benjamin.wins...@googlemail.com
Hello I have created a more robust login mechanism for my site, using username and password but then also other information, specific to each user. My main login works fine, but I want to kill the admin login page so that it can't be accessed (any users logging into the main site who qualify as u

Re: Django book mostly done?

2009-03-24 Thread brad
On Mar 23, 8:15 pm, Malcolm Tredinnick wrote: > On Mon, 2009-03-23 at 15:08 -0700, Graham Dumpleton wrote: > > [...] > > > More of a concern is that mod_python is still regarded as the most > > robust production setup. I can't see that mod_wsgi is even mentioned > > at all. > > Here's a wild th

Django + mod_python + apache on development box

2009-03-24 Thread douglas
I am a django newbie having difficulty getting django operational on my development box running on Apache, with mod_python. My Django test case - the sitepoint.com tutorial: http://www.sitepoint.com/article/build-to-do-list-30-minutes/ - renders as HTML, but [Apache? Mod_python?] can not find th

GeoDjango - Multiple Features in Shapefile

2009-03-24 Thread Alfonso
Hi, I have a shapefile of England loaded into a geodjango model that is a combination of administrative boundaries (counties essentially) of the entire country. I'm trying to put together a query search that will return activities by country (then ultimately county) but layermapping has loaded th

Re: mod_python and Dev server compatible coding

2009-03-24 Thread Ross
The big value for me of the dev server is the ease with which I can get debugging information out of it. Of course, I fully understand that it is not suitable for serving my site - I didn't mean to give the impression that it was. But the cycle of using the dev-server for making something work, t

Re: need a multiselect list box for a static list of options

2009-03-24 Thread Adam Fraser
Still doesn't work. Maybe I should be more specific. I'm editing projectprofiler/projects/models.py which hasn't needed to import forms for anything, and when I do I get very strange errors. Here's what it looks like now: from django.db import models from django.contrib.auth.models import User

Re: Languages problem

2009-03-24 Thread Muslu Yüksektepe
if u have a error pls write all error code. 2009/3/24 knight > > Hi, > > I have the following class in my models.py: > > class MainCategory(models.Model): >title = models.CharField(max_length=50) >value = models.DecimalField(default=0, max_digits=5, > decimal_places=3) >secid = model

django and deploying requirements

2009-03-24 Thread marx.r...@googlemail.com
Hello i have some question on hardware req. for a new project we are going to deploy soon. First some facts on the expected traffic. - 200k to 500k Users in complete - 2k to 5k concurrent users on the page - every page consists of something about 10 to 20 database accesses - applications include

Local Server seems to not work with typing parameter in the url?

2009-03-24 Thread SamuelXiao
I am writing a simple application which takes parameter from the url and simply put it to another python app and open it. If it is successful, a content of the author's blog post will be returned. The following is my code: --This one works #Using Django v1.02 #this function wo

Re: Local Server seems to not work with typing parameter in the url?

2009-03-24 Thread R. Gorman
If that's an exact copy, you have a typo in your URL variable; you're missing a / after CSserver. R. --~--~-~--~~~---~--~~ 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: Languages problem

2009-03-24 Thread alexarsh
Hi, No, I don't have any errors. I just get my title empty. Regards, Alex A. On Mar 24, 3:56 pm, Muslu Yüksektepe wrote: > if u have a error pls write all error code. > > 2009/3/24 knight > > > > > > > Hi, > > > I have the following class in my models.py: > > > class MainCategory(models.Model

Re: Multiple ModelAdmins for a single Model

2009-03-24 Thread Dan Ward
OK, I've done a fair amount of research and I want to detail what I'm aiming to achieve. I have a page table. The page table contains various fields, which are dependent upon the pgtype option (containing three possible values). What I want to achieve is three separate pages in the admin site,

Re: Languages problem

2009-03-24 Thread Muslu Yüksektepe
i want you try without *> >def save(self): > >if not self.pk: > >self.secid = slugify(self.title).replace("-**", "_") > >if MainCategory.objects.filter(**secid = self.secid): > >super(MainCategory, self).save() > >self.secid = "%s

Re: Local Server seems to not work with typing parameter in the url?

2009-03-24 Thread Daniel Roseman
On Mar 24, 2:25 pm, SamuelXiao wrote: > I am writing a simple application which takes parameter from the url > and simply put it to another python app and open it.  If it is > successful, a content of the author's blog post will be returned. > The following is my code: > --This one work

Re: need a multiselect list box for a static list of options

2009-03-24 Thread Brian Neal
On Mar 24, 8:55 am, Adam Fraser wrote: > Still doesn't work.  Maybe I should be more specific. > > I'm editing projectprofiler/projects/models.py which hasn't needed to > import forms for anything, and when I do I get very strange errors. > > Here's what it looks like now: > > from django.db impo

Upload an ImageField from the Python shell

2009-03-24 Thread Rit
How can I set an ImageField of a model from within the Python shell? --~--~-~--~~~---~--~~ 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 unsubscr

model filed with default type set in database

2009-03-24 Thread mark
im a newbie to django. i have an existing database with default values for field set in the database: for example: created timestamp without time zone DEFAULT now(), number_polls integer DEFAULT 0, i want to use django admin interface to manage tables. how do i set up these fields in models

Re: Upload an ImageField from the Python shell

2009-03-24 Thread Matías Costa
On Tue, Mar 24, 2009 at 4:10 PM, Rit wrote: > > How can I set an ImageField of a model from within the Python shell? > > > ImageField and FileField are just strings. They get special treatment in forms, OK, but your model instance attribute is just a string. --~--~-~--~~~

Working With ModelForms

2009-03-24 Thread DarrenM
Hi. I'm quite new to Django so please excuse any ignorance. I'm trying to change the value of a ModelForm attribute and execute the same view with the altered attribute. I've read and read the ModelForms docs but I can't grasp how to do this. In the view the POST data comes back and I populate a

Garbage Collection(maybe?) and RequestContext

2009-03-24 Thread Keyton Weissinger
I'm using the extra_context dictionary passed into the view like many folks (James Bennett among them) seem to recommend either directly or via his projects. Here is what a view might look like (all of this is on dpaste with link below if you'd prefer): from django.shortcuts import render_to_res

Re: Working With ModelForms

2009-03-24 Thread Thomas Guettler
Hi, my guess: You need to redirect after POST. if you give request.POST to the Form, it will overwrite the values from the model with the values from request.POST. If you do a redirect after POST, the value from the model will be displayed, since POST is empty after the redirect. BTW, I often d

Is there a Country select feature in Local Flavors forms addon?

2009-03-24 Thread NoviceSortOf
I'm looking at using the USStateSelect from from django.contrib.localflavor.us.forms, I'm curious though if there an comparable CountrySelect object anywhere. Please advise. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Static Content and Google App Engine

2009-03-24 Thread tgorham3
Django documentation clearly disapproves of storing static content in a database. Google App Engine treats blobs in the db as the norm. Does Big Table change the rules or is it still preferable to store static content in the file system and let a server do the heavy lifting. --~--~-~--~

Re: Garbage Collection(maybe?) and RequestContext

2009-03-24 Thread Daniel Roseman
On Mar 24, 3:42 pm, Keyton Weissinger wrote: > I'm using the extra_context dictionary passed into the view like many > folks (James Bennett among them) seem to recommend either directly or > via his projects. > > Here is what a view might look like (all of this is on dpaste with > link below if y

Re: replace admin login

2009-03-24 Thread Matías Costa
On Tue, Mar 24, 2009 at 1:55 PM, benjamin.wins...@googlemail.com < benjamin.wins...@googlemail.com> wrote: > > Hello > > I have created a more robust login mechanism for my site, using > username and password but then also other information, specific to > each user. My main login works fine, but I

Re: inconsistency between remove() and clear()?

2009-03-24 Thread Margie
Ok, yes, this all makes sense now. Thanks for the explanation! Margie On Mar 24, 3:32 am, Russell Keith-Magee wrote: > On Tue, Mar 24, 2009 at 6:10 PM, Thomas Guettler wrote: > > > Hi, > > > book2.publisher is an attribute which was created before you deleted it. > > If you get book2 again f

Admin Model Search issue.

2009-03-24 Thread Bobby Roberts
Hi all. We're using a dev version somewhere post .96 and pre 1.0. I have an admin model as setup here: class Admin: list_display = ('FirstName','LastName','Organization','BZipCode','Phone','Active','CreatedDate',) list_filter = ['CreatedDate'] fields = (

OT: svn and '$Id$'

2009-03-24 Thread Alan
Hi there, It's a bit off topic but I guess appropriate anyway. So I want to use '$Id$' in my *.py files where '$Id$' got replaced when I commit my files via svn. But I googled and I still couldn't make it work. Can somebody tell to make it work? I would like to get at least date and time when the

Re: Local Server seems to not work with typing parameter in the url?

2009-03-24 Thread SamuelXiao
Thanks very much, it works now! On Mar 24, 10:57 pm, Daniel Roseman wrote: > On Mar 24, 2:25 pm, SamuelXiao wrote: > > > > > I am writing a simple application which takes parameter from the url > > and simply put it to another python app and open it.  If it is > > successful, a content of the a

Re: OT: svn and '$Id$'

2009-03-24 Thread David Lindquist
On Mar 24, 2009, at 10:09 AM, Alan wrote: > Hi there, > > It's a bit off topic but I guess appropriate anyway. > > So I want to use '$Id$' in my *.py files where '$Id$' got replaced > when I commit my files via svn. > > But I googled and I still couldn't make it work. Can somebody tell > to m

Re: OT: svn and '$Id$'

2009-03-24 Thread David Lindquist
On Mar 24, 2009, at 10:09 AM, Alan wrote: > Hi there, > > It's a bit off topic but I guess appropriate anyway. > > So I want to use '$Id$' in my *.py files where '$Id$' got replaced > when I commit my files via svn. > > But I googled and I still couldn't make it work. Can somebody tell > to m

Re: TemplateDoesNotExist at /admin/ on Linux (Xubuntu) while doing Django Tutorial 2

2009-03-24 Thread brad
On Mar 2, 10:14 am, Karen Tracey wrote: > On Sun, Mar 1, 2009 at 10:56 PM, Chris Verehhotti < > > chris.peresso...@gmail.com> wrote: > > > > however, in my Thunar file viewer, every icon has a little "X" on it > > > -- this makes me think it's a permissions issue, but I'm a Linux n00b > > > and

Re: OT: svn and '$Id$'

2009-03-24 Thread Alan
Hi guys, tanks for your help but I am definitely doning something wrong because I don't get what I want. So, I am trying this: I have this line in my *.py file: repositoryId = '$Id $' + '$Revision$' + '$Date$' I did: find . -name "*.py" -exec svn propset svn:keywords "Date" {} \; find . -name

Re: Garbage Collection(maybe?) and RequestContext

2009-03-24 Thread Keyton Weissinger
Something deep inside kept telling me it was something like that. Grrr Love making the noob mistakes. NOT! ;-) Thanks DR! On Mar 24, 11:57 am, Daniel Roseman wrote: > On Mar 24, 3:42 pm, Keyton Weissinger wrote: > > > I'm using the extra_context dictionary passed into the view like many >

Re: Having trouble authenticating/validating

2009-03-24 Thread Adam Yee
On Mar 23, 8:30 pm, Karen Tracey wrote: > On Mon, Mar 23, 2009 at 4:45 PM, Adam Yee wrote: > > > I'm using Django's builtin AuthenticationForm > > > Here's my login view:http://dpaste.com/18110/ > > > Form submittal (not empty or empty fields) takes me back to the login > > page with 'Did not

Re: Strip empty lines in rendered templates?

2009-03-24 Thread chachra
Would the {% spaceless %} template tag be helpful here ? I posted a similar question, and someone responded saying that may be the way to go. Cheers! Sumit On Mar 16, 9:45 am, Benjamin Buch wrote: > Yes, you're right. > > But as the SpacelessMiddleware uses djangos' strip_spaces_between_tags,

Re: Working With ModelForms

2009-03-24 Thread Darren Mansell
That was a great help thanks. I also used the copy() method on the request.POST dict and I could redirect to the same view. Cheers. On Mar 24, 2009 3:43 PM, "Thomas Guettler" wrote: Hi, my guess: You need to redirect after POST. if you give request.POST to the Form, it will overwrite the valu

Bug report: Model.get(pk=None)

2009-03-24 Thread Michael Glassford
I haven't been able to debug why this is happening yet (I spent most of today narrowing down the problem to a simple test case), but if I create a new Django project, add a new app to it, change settings.py to have the appropriate db information (I'm using MySQL), and INSTALLED_APPS setting, t

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 2:39 PM, Michael Glassford wrote: > > I haven't been able to debug why this is happening yet (I spent most of > today narrowing down the problem to a simple test case), but if I create > a new Django project, add a new app to it, change settings.py to have > the appropriate

Django as a Template Engine?

2009-03-24 Thread Dave A
Hi, I'm new to Django -- I'm evaluating open source frameworks in an attempt to port an existing application to a non-proprietary platform. I like Django, but am not sure about how to approach an application templating function from the current system... In short, each registered user of the sys

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Michael Glassford
Alex Gaynor wrote: > > > On Tue, Mar 24, 2009 at 2:39 PM, Michael Glassford > wrote: [snip model definition, etc.] > When I run the tests under Django 0.96.3, I get the expected exception: > "DoesNotExist: ModelA matching query does not exist." > > Ho

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 2:51 PM, Michael Glassford wrote: > > Alex Gaynor wrote: > > > > > > On Tue, Mar 24, 2009 at 2:39 PM, Michael Glassford > > wrote: > > [snip model definition, etc.] > > > When I run the tests under Django 0.96.3, I get the expected > except

Why won't my form validate?

2009-03-24 Thread Theme Park Photo, LLC
Im trying to get code to edit an existing record in a table working. For some reason, form.is_valid is returning false (and I can't save it because there's no cleaned data). Even reduced to this (below) where I'm simply getting an existing "Post" object, creating a ModelForm, and validating it, fa

Re: Why won't my form validate?

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 3:02 PM, Theme Park Photo, LLC wrote: > > Im trying to get code to edit an existing record in a table working. > For some reason, form.is_valid is returning false (and I can't save it > because there's no cleaned data). Even reduced to this (below) where > I'm simply gettin

Re: Why won't my form validate?

2009-03-24 Thread Theme Park Photo, LLC
It has data! It was created from an existing instance...and all the fields have values 'body': u'hello there', 'allow_comments': 1, 'author': 10L, 'tease': u'hello there', 'publish': datetime.datetime(2009, 3, 23, 15, 3, 36),

Re: More DJango Tagging Oracle Issues

2009-03-24 Thread Brandon Taylor
After much digging, I was able to find the problem. In fields.py in django-tagging, the tags are pulled from cache when they are saved, rather than going back to the database. The problem I was seeing wasn't that tags werent' being applied to objects, or added to the database, but the input field

Re: Why won't my form validate?

2009-03-24 Thread David Zhou
If it's not valid, then something likely threw a validation error. What does the error say? -- dz On Tue, Mar 24, 2009 at 3:11 PM, Theme Park Photo, LLC wrote: > > It has data! It was created from an existing instance...and all the > fields have values > > 'body': u'hello there', 'allow_comme

Re: More DJango Tagging Oracle Issues

2009-03-24 Thread Brandon Taylor
I have confirmed that it also works as expected with cx_Oracle-5.0.1 Woohoo On Mar 24, 2:14 pm, Brandon Taylor wrote: > After much digging, I was able to find the problem. In fields.py in > django-tagging, the tags are pulled from cache when they are saved, > rather than going back to the datab

Re: Why won't my form validate?

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 3:15 PM, David Zhou wrote: > > If it's not valid, then something likely threw a validation error. > What does the error say? > > -- dz > > > > On Tue, Mar 24, 2009 at 3:11 PM, Theme Park Photo, LLC > wrote: > > > > It has data! It was created from an existing instance...a

Re: Why won't my form validate?

2009-03-24 Thread Theme Park Photo, LLC
Error fields were all empty. I checked methods non_field_errors and _get_errors; _errors was None. But Alex Gaynor was right! When I added the form "POST" data in, the form validated. I assumed that creating a ModelForm from an existing instance would give it valid data, but that's not the case.

Re: Why won't my form validate?

2009-03-24 Thread David Zhou
It builds up on the things mentioned in the documentation for normal forms. Also, the documentation for ModelForm's save instance has pretty explicit examples of creating form instances: http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-save-method -- dz On Tue, Mar 24, 2009

Join unrelated models

2009-03-24 Thread Konstantin S
Hello! I have two unrelated models that have one common field. class Media(models.Model): title = models.CharField(max_length=500) ... class Link(models.Model): title = models.CharField(max_length=500) ... Now I want to select those objects from the Media model that do not exis

Re: Join unrelated models

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S wrote: > > Hello! > > I have two unrelated models that have one common field. > > class Media(models.Model): >title = models.CharField(max_length=500) >... > > class Link(models.Model): >title = models.CharField(max_length=500) >... >

Re: Join unrelated models

2009-03-24 Thread Paulo Köch
Does that generate a join or a not in? This is very relevant for performance. Cheers, Paulo Köch On Tue, Mar 24, 2009 at 20:13, Alex Gaynor wrote: > > > On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S wrote: >> >> Hello! >> >> I have two unrelated models that have one common field. >> >> class

Re: Join unrelated models

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 4:15 PM, Paulo Köch wrote: > > Does that generate a join or a not in? This is very relevant for > performance. > > Cheers, > Paulo Köch > > > > On Tue, Mar 24, 2009 at 20:13, Alex Gaynor wrote: > > > > > > On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S > wrote: > >> > >>

Re: Join unrelated models

2009-03-24 Thread Konstantin S
On Mar 24, 11:13 pm, Alex Gaynor wrote: > On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S wrote: > > > Hello! > > > I have two unrelated models that have one common field. > > > class Media(models.Model): > >    title = models.CharField(max_length=500) > >    ... > > > class Link(models.Model):

Re: Join unrelated models

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 4:26 PM, Konstantin S wrote: > > > > On Mar 24, 11:13 pm, Alex Gaynor wrote: > > On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S > wrote: > > > > > Hello! > > > > > I have two unrelated models that have one common field. > > > > > class Media(models.Model): > > >title

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Michael Glassford
Alex Gaynor wrote: > > I'm almost positive the MySQL CLI operates differently for the purposes > of this query. The reason the queries do different things in .96 is > that in .96 that query becomes id = NULL rather than id IS NULL, which > MySQL handles differently. > Well, that fits the fa

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 4:50 PM, Michael Glassford wrote: > > Alex Gaynor wrote: > > > > I'm almost positive the MySQL CLI operates differently for the purposes > > of this query. The reason the queries do different things in .96 is > > that in .96 that query becomes id = NULL rather than id IS N

Error when posting a comment

2009-03-24 Thread Tonu Mikk
I posted this on djangothreadedcomments list some days ago, but did not get a response. Perhaps django users can help me out? Hello, I am attempting to get threaded comments to work on a shared bookmarking application. It seems that I am almost there, but when I post the comment, I get the fo

Re: Admin Model Search issue.

2009-03-24 Thread Ayaz Ahmed Khan
On 24-Mar-09, at 9:28 PM, Bobby Roberts wrote: > When I try to search on anything at all, the screen just blinks and > returns all of the records. This same syntax works perfectly on > another model. There's no error but the search function in the > /admin is not working. Any ideas what it co

Call function on server start

2009-03-24 Thread JGAllen23
Is there any way to call a function on server start? I have some maintenance stuff that I'd like to run on server start (both manage.py runserver and apache reload). Is there any way to do that? --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: Why won't my form validate?

2009-03-24 Thread Theme Park Photo, LLC
Actually, no. The docs have this example which will fail # Create a form to edit an existing Article. >>> a = Article.objects.get(pk=1) >>> f = ArticleForm(instance=a) >>> f.save() On Mar 24, 12:34 pm, David Zhou wrote: > It builds up on the things mentioned in the documentation for normal >

Re: Why won't my form validate?

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 6:10 PM, Theme Park Photo, LLC wrote: > > Actually, no. The docs have this example which will fail > > # Create a form to edit an existing Article. > >>> a = Article.objects.get(pk=1) > >>> f = ArticleForm(instance=a) > >>> f.save() > > > > On Mar 24, 12:34 pm, David Zhou

Re: OT: svn and '$Id$'

2009-03-24 Thread Alan
I got a solution. I undid what I did in ~/.subversion/config Forget about Id, and used just "$Date$" in my *.py, then find . -name "*.py" -exec svn propset svn:keywords "Date" {} \; commit it and it worked. Cheers, Alan On Mar 24, 5:34 pm, Alan wrote: > Hi guys, tanks for your help but I am d

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Michael Glassford
Alex Gaynor wrote: > > > On Tue, Mar 24, 2009 at 2:51 PM, Michael Glassford wrote: > > > Alex Gaynor wrote: > > > > > > On Tue, Mar 24, 2009 at 2:39 PM, Michael Glassford wrote: > > [snip model definition, etc.] > > > When I run the tests under Django 0.96.3,

Re: Templating language Include path dilemma

2009-03-24 Thread Malcolm Tredinnick
On Tue, 2009-03-24 at 05:36 -0700, Colm wrote: [..] > Assuming foo_app/template/template1 looks like this : > > {% include "path1/temtlate2" %} > > If template2 wants to include template3 should it do this : > >{ % include "../path2/template3" %} > > OR this : > > {% include "path2/

Re: Languages problem

2009-03-24 Thread Malcolm Tredinnick
On Tue, 2009-03-24 at 07:33 -0700, alexarsh wrote: > Hi, > > No, I don't have any errors. I just get my title empty. So is the data not being stored in the database? Use psql and have a look at the table directly to see what's there. Django quite happily handles non-ASCII text in the admin (htt

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 8:15 PM, Michael Glassford wrote: > > Alex Gaynor wrote: > > > > > > On Tue, Mar 24, 2009 at 2:51 PM, Michael Glassford wrote: > > > > > > Alex Gaynor wrote: > > > > > > > > > On Tue, Mar 24, 2009 at 2:39 PM, Michael Glassford wrote: > > > > [snip mod

Re: Static Content and Google App Engine

2009-03-24 Thread Malcolm Tredinnick
On Tue, 2009-03-24 at 08:56 -0700, tgorham3 wrote: > Django documentation clearly disapproves of storing static content in > a database. Well, no, but it acknowledges that a filesystem is usually a better solution for that type of operation, as it's optimised for storing large files (SQL databas

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Karen Tracey
On Tue, Mar 24, 2009 at 8:15 PM, Michael Glassford wrote: > Django can be patched to do this automatically. There may be a better > way to do it, but I've figured out that in db/backends/mysql/base.py, > inside the DatabaseWrapper._cursor function, adding the line > "cursor.execute('SET sql_auto_i

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Malcolm Tredinnick
On Tue, 2009-03-24 at 16:50 -0400, Michael Glassford wrote: > Alex Gaynor wrote: > > > > I'm almost positive the MySQL CLI operates differently for the purposes > > of this query. The reason the queries do different things in .96 is > > that in .96 that query becomes id = NULL rather than id I

Re: Call function on server start

2009-03-24 Thread Malcolm Tredinnick
On Tue, 2009-03-24 at 14:59 -0700, JGAllen23 wrote: > Is there any way to call a function on server start? I have some > maintenance stuff that I'd like to run on server start (both manage.py > runserver and apache reload). Is there any way to do that? No, because the requirement doesn't make s

Re: Call function on server start

2009-03-24 Thread Graham Dumpleton
On Mar 25, 11:53 am, Malcolm Tredinnick wrote: > On Tue, 2009-03-24 at 14:59 -0700, JGAllen23 wrote: > > Is there any way to call a function on server start?  I have some > > maintenance stuff that I'd like to run on server start (both manage.py > > runserver and apache reload).  Is there any w

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Malcolm Tredinnick
On Tue, 2009-03-24 at 20:40 -0400, Karen Tracey wrote: [...] > > But the decision was made to not add this overhead to the start of > every connection. If you read the last paragraph you'll note it wasn't > an emphatic "no, never shall we do this" type of decision but I don't > know that anything

What's the most scalable Django deployment out there currently?

2009-03-24 Thread ldm999
Is there any reason why Django couldn't be used to create a website that gets Facebook-like traffic? --~--~-~--~~~---~--~~ 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: What's the most scalable Django deployment out there currently?

2009-03-24 Thread Alex Gaynor
On Wed, Mar 25, 2009 at 12:32 AM, ldm999 wrote: > > Is there any reason why Django couldn't be used to create a website > that gets Facebook-like traffic? > > > Not really, at that point it's mostly scaling your DB(since web nodes are comparatively easy). Django doesn't have a public API for mul

Re: What's the most scalable Django deployment out there currently?

2009-03-24 Thread ldm616
I guess I'm asking if there's any inherent reason to *not* use Django for a website that you hope/anticipate will have many simultaneous users and high levels of database reads/updates. And, related, what's the most "extreme" Django deployment currently out there. And on the database side, what d

Re: What's the most scalable Django deployment out there currently?

2009-03-24 Thread Adam V.
Curse (http://www.curse.com/) manages to stay up on WoW patch day, so that's a pretty good sign. --~--~-~--~~~---~--~~ 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

Re: What's the most scalable Django deployment out there currently?

2009-03-24 Thread Alex Gaynor
On Wed, Mar 25, 2009 at 12:43 AM, Adam V. wrote: > > Curse (http://www.curse.com/) manages to stay up on WoW patch day, so > that's a pretty good sign. > > > > Curse is no longer running on Django(it's ASP.net now I think), no idea if that was a technical decision or not. Alex -- "I disapprove

Re: What's the most scalable Django deployment out there currently?

2009-03-24 Thread Graham Dumpleton
On Mar 25, 3:45 pm, Alex Gaynor wrote: > On Wed, Mar 25, 2009 at 12:43 AM, Adam V. wrote: > > > Curse (http://www.curse.com/) manages to stay up on WoW patch day, so > > that's a pretty good sign. > > Curse is no longer running on Django(it's ASP.net now I think), no idea if > that was a techn

Re: What's the most scalable Django deployment out there currently?

2009-03-24 Thread Alex Gaynor
On Wed, Mar 25, 2009 at 1:06 AM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > > > > On Mar 25, 3:45 pm, Alex Gaynor wrote: > > On Wed, Mar 25, 2009 at 12:43 AM, Adam V. wrote: > > > > > Curse (http://www.curse.com/) manages to stay up on WoW patch day, so > > > that's a pretty good si

django.utils.html bug?

2009-03-24 Thread Chen Jie
>>> from django.utils import html >>> html.urlize('炳叔的这句“这不是典型的大蒜瞧不起腊八蒜,妒忌人家好吃不臭嘛。”太逗了。http://blog.donews.com/bingshu/archive/2009/03/25/1479512.aspx') u'\u70b3\u53d4\u7684\u8fd9\u53e5\u201c\u8fd9\u4e0d\u662f\u5178\u578b \u7684\u5927\u849c\u77a7\u4e0d\u8d77\u814a\u516b\u849c\uff0c \u5992\u5fcc\u4e