Re: i18n, how to denote context

2008-07-18 Thread Malcolm Tredinnick
On Fri, 2008-07-18 at 22:33 +0200, Torsten Bronger wrote: > Hallöchen! > > In one of my models, I have > > from django.utils.translation import ugettext_lazy as _ > > ... > class Meta: > verbose_name = _("sample series") > verbose_name_plural = _("sample series") > > Howev

Re: Trim URLs

2008-07-19 Thread Malcolm Tredinnick
On Sat, 2008-07-19 at 18:11 +0200, Torsten Bronger wrote: > Hallöchen! > > I just tried to move from the test web server to a real Apache. The > docs (http://www.djangoproject.com/documentation/modpython/) say > > Restart Apache, and any request to /mysite/ or below will be > served by

Re: Sets

2008-07-20 Thread Malcolm Tredinnick
On Sun, 2008-07-20 at 10:05 -0400, Cole Tuininga wrote: > On Sat, Jul 19, 2008 at 11:50 PM, Julien Phalip <[EMAIL PROTECTED]> wrote: > > > > 'set' is a Python standard object [1], since version 2.4. In version > > 2.3 you need to import the 'Set' package first. > > So, if you care about backward

Re: i18n project custom locale won't stick

2008-07-20 Thread Malcolm Tredinnick
On Sun, 2008-07-20 at 13:02 -0700, robin wrote: > I've spend 3 days on this. Please help. > > I've created the following locale to my project below: > /home/robin/myproject/locale/id/LC_MESSAGES/django.po > /home/robin/myproject/locale/id/LC_MESSAGES/django.mo > > so I have a custom language wh

Re: filter on a method

2008-07-20 Thread Malcolm Tredinnick
On Sun, 2008-07-20 at 10:28 +0200, Andre Meyer wrote: > hi all > > it does not seem to be possible to filter on the return value of a > model's method, or is it? No, it isn't. Filtering and sorting are converted to SQL statements and there's no way to write an SQL statement in this fashion. >

Re: Template Hiding Strings with Non-Ascii Characters

2008-07-20 Thread Malcolm Tredinnick
On Sun, 2008-07-20 at 22:03 -0700, Chris wrote: > I'm running the current trunk, and I'm seeing a strange problem. I > noticed Django's templates were occasionally displaying variables as > empty strings, when there should have been something. Then I realized, > all the strings that weren't bein

Re: How to display UserProfiles in newforms-admin

2008-07-21 Thread Malcolm Tredinnick
On Sun, 2008-07-20 at 21:35 +0200, Bernd Donner wrote: > In the old version of the admin site the fields of the UserProfile could be > displayed "inline" on the corresponding User page of the admin site. This was > done by somthing like: > > class UserProfile(models.Model): > ... > user =

Re: i18n project custom locale won't stick

2008-07-21 Thread Malcolm Tredinnick
irst to admit that that document is a mixture of many different things and quite hard to understand. I want to hit it with big sticks before 1.0 comes out. Regards, Malcolm > > Thank you for your prompt response, > Robin > > On Jul 21, 4:51 am, Malcolm Tredinnick <[EMAIL PROTECTED]&

Re: Custom permission problem in newforms-admin

2008-07-21 Thread Malcolm Tredinnick
On Mon, 2008-07-21 at 15:46 -0700, Brandon Taylor wrote: > Hi everyone, > > I'm trying to enforce a customer permission on Add/Update. In my > model, I have defined the permission: > > permissions = ( >('can_approve_stories','Can Approve Stories'), > ) > > > >

Re: Getting an IndexError when using distinct() and order_by()

2008-07-21 Thread Malcolm Tredinnick
On Mon, 2008-07-21 at 15:41 -0700, bhunter wrote: > Ahh, never mind. Looks like it IS a bug, but a very new one: > > http://code.djangoproject.com/ticket/7791 I haven't had a chance to look at that bug yet, except to reproduce it (and to remove Ivan from my Christmas card list for this year).

Re: Obtaining schema info from models

2008-07-21 Thread Malcolm Tredinnick
On Mon, 2008-07-21 at 21:23 -0700, s wrote: > Okay, I know this _should_ be easy but I'm in my all-too-familiar mode > of "mental block" with a little frustration peppered in. > > I'm trying to create a dynamic export mechanism (pretty simple) but > also trying to export a schema file for the pa

Re: Getting an IndexError when using distinct() and order_by()

2008-07-22 Thread Malcolm Tredinnick
On Mon, 2008-07-21 at 15:57 -0700, Malcolm Tredinnick wrote: > > On Mon, 2008-07-21 at 15:41 -0700, bhunter wrote: > > Ahh, never mind. Looks like it IS a bug, but a very new one: > > > > http://code.djangoproject.com/ticket/7791 > > I haven't had a chance

Re: WSGIScriptAlias and change #8015

2008-07-22 Thread Malcolm Tredinnick
On Tue, 2008-07-22 at 04:40 -0400, arsyed wrote: > Hi - With the change in 8015: > > http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#ChangedthewayURLpathsaredetermined > > it sounds like I shouldn't need to specify the WSGIScriptAlias in the > URLConf file. But this doesn't work

Re: WSGIScriptAlias and change #8015

2008-07-22 Thread Malcolm Tredinnick
On Tue, 2008-07-22 at 10:58 -0700, Malcolm Tredinnick wrote: > > On Tue, 2008-07-22 at 04:40 -0400, arsyed wrote: > > Hi - With the change in 8015: > > > > http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#ChangedthewayURLpathsaredetermined > >

Re: Which Postgresql/Psycopg2 version should we use?

2008-07-22 Thread Malcolm Tredinnick
On Tue, 2008-07-22 at 13:36 -0700, Steve wrote: > I ended up rebuilding everything with postgresql 8.29/pyscopg2.07 and > everything works fine. Email me if you have questions or a similar > problem as I never figured out why it didn't work with postgresql > 8.33. I'd like to know what the issue

Re: Form.clean() and custom error handling

2008-07-22 Thread Malcolm Tredinnick
On Tue, 2008-07-22 at 15:20 -0700, John-Scott wrote: > All, > > I had previously been using a bit of a hack (thought I found examples > of this on the mailing list, but can't find any evidence now) so that > I could actually associated field specific errors with the actual > field instead of hav

Re: Model relationships

2008-08-18 Thread Malcolm Tredinnick
On Mon, 2008-08-18 at 05:36 -0700, [EMAIL PROTECTED] wrote: > Incase my question wasn't clear enough, as I had trouble describing > it ... > > Can a different model access the manytomany table that django makes ? No, but you're probably thinking about this on the wrong level. Think about it in

Re: modelforms: getting field object in clean_ method

2008-08-18 Thread Malcolm Tredinnick
On Mon, 2008-08-18 at 08:05 -0700, Aljosa Mohorovic wrote: > i currently use self.instance but i'm not sure if i can do that since > i didn't find an example using it in docs. There are a few parts of model forms that aren't (re-)documented in the docs. Reading the code and docstrings is a good

Re: Trouble with regex

2008-08-18 Thread Malcolm Tredinnick
On Mon, 2008-08-18 at 20:04 +0200, Fernando Rodríguez wrote: > El lun, 18-08-2008 a las 12:49 -0500, Norman Harman escribió: > > > > > I'm fairly certain the space indicates an urls came from an "include". > > The spaces are not really part of regex. > > OK > > > > > > In latter case caree

Re: ImportError: cannot import name parse_lookup

2008-08-18 Thread Malcolm Tredinnick
On Mon, 2008-08-18 at 12:33 -0700, Nicolas Couture wrote: > [...] > signals.post_save.connect(self._save, cls, True) > AttributeError: 'object' object has no attribute 'connect' > > I am using django r7966. > > Would anyone be able to provide more input as to why this is breaking? Because

Re: lighttpd +fastcgi

2008-08-18 Thread Malcolm Tredinnick
On Mon, 2008-08-18 at 16:47 -0300, Gonzalo Almeida wrote: > hello, > I have a problem with lighttpd + fastcgi, > I used have the newforms-admin branch and everything worked fine. > but when I started using the trunk version, the problems appeared. > when I access http://localhost/admin/, I try to

Re: ifequal doesn't evaluate expressions

2008-08-18 Thread Malcolm Tredinnick
On Mon, 2008-08-18 at 13:37 -0700, zdmytriv wrote: > 2 Malcolm: > > > It makes a lot of sense when you think about what they can apply to. > > Equality is a natural operation for all sorts of object types. The > "less > > than" comparison only applies to things that have a natural > ordering. >

Re: ImageField save issues (IOError: [Errno 37] No locks available)

2008-08-18 Thread Malcolm Tredinnick
On Mon, 2008-08-18 at 16:05 -0700, wnielson wrote: > I've been running into an issue while trying to upgrade my code to use > Django's new file handling system. When I try to use the `save` > method of a `ImageField` instance, I get an `IOError: [Errno 37] No > locks available`. The file gets c

Re: ImageField save issues (IOError: [Errno 37] No locks available)

2008-08-18 Thread Malcolm Tredinnick
On Mon, 2008-08-18 at 16:42 -0700, wnielson wrote: > Thanks for the quick response. Yes, I did do some searching and ran > across the post about NFS (and yes I am using an NFS mount). However, > I can solve the problem by bypassing the `save` method like so: > > from django.core.files import F

Re: ImageField save issues (IOError: [Errno 37] No locks available)

2008-08-18 Thread Malcolm Tredinnick
On Mon, 2008-08-18 at 17:23 -0700, wnielson wrote: > For what its worth, I did manage a work around on the NFS side. In / > etc/export you need to have the `no_subtree_check` option enabled. > Apparently this has mild security implications (as stated in man > exports), but it does allow the lock

Re: manager select_related()

2008-08-19 Thread Malcolm Tredinnick
On Mon, 2008-08-18 at 20:50 -0700, saeb wrote: > > Sorry to ask a stupid question, but following is my basic model > structure. I want to create a custom manager for a class which has a > foreignKey to another class. And to call that manager function in list > display to display all the related

Re: Custom meta data to models

2008-08-19 Thread Malcolm Tredinnick
On Tue, 2008-08-19 at 13:20 +0200, Torsten Bronger wrote: > Hallöchen! > > Steve Holden writes: > > > Torsten Bronger wrote: > > > >> In > >> , > >> custom metadata to models were discussed. Has there been any > >> progress in this, or has been another approach to this proposed? > > > > FYI, w

Re: Invalid block tag: 'autoescape'

2008-08-19 Thread Malcolm Tredinnick
On Tue, 2008-08-19 at 04:13 -0700, tom17 wrote: > I developed something using the trunk, now we have a change in the > requirement and we need to use the 0.96 version as the hosting service > provider supports only the stable version. I know I have to change a > lot of things, > So what I want to

Re: dynamic creation of model with geodjango ?

2008-08-19 Thread Malcolm Tredinnick
On Tue, 2008-08-19 at 06:18 -0700, guillaume wrote: > Hi Dane, > > Thanks for these informations. Does it mean that a model dynamically > created will now appear in admin section ? The previous poster described a way to inspect an existing data source and print out the model definition to stdou

Re: filter(field=value) or filter(field__exact=value) ?

2008-08-19 Thread Malcolm Tredinnick
On Tue, 2008-08-19 at 12:48 -0700, akonsu wrote: > hello, > > what is the difference between > > MyModel.objects.filter(field=value) and > MyModel.objects.filter(field__exact=value) ? > > i could not find an explanation in the docs. It's documented here: http://www.djangoproject.com/document

Re: upload is working, but how to store the path in the imagefield?

2008-08-19 Thread Malcolm Tredinnick
On Tue, 2008-08-19 at 14:22 -0700, hotani wrote: > I'm using svn 2204, and "save_FOO_file" does not seem to exist any > more. Nor is it in the documentation anywhere that I've been able to > find. Is someone successfully using this on a recent build? "I just updated and something stopped working

Re: Sorting problem with model having ForeignKey and ManyToManyField

2008-08-20 Thread Malcolm Tredinnick
On Wed, 2008-08-20 at 05:55 -0700, laspal wrote: > hi, > I am trying to sort my tables depending upon the header. > Its working fine if my models does have any ForeignKey or > ManyToManyField. > but if its does sorting is not working. "Not working" could mean anything: the codes crashes, it runs

Re: translating app name

2008-08-20 Thread Malcolm Tredinnick
On Wed, 2008-08-20 at 15:53 +0200, Jarek Zgoda wrote: > Wiadomość napisana w dniu 2008-08-20, o godz. 15:33, przez Rajesh > Dhawan: > > > On Aug 20, 8:43 am, patrickk <[EMAIL PROTECTED]> wrote: > >> how? > >> > > > > You can see the following "blocktrans" fragment in django/contrib/ > > admin/

Re: TypeError - unpack non-sequence

2008-08-20 Thread Malcolm Tredinnick
On Wed, 2008-08-20 at 11:46 -0700, Alfonso wrote: > Interestingly changing /django/core/handlers.py line 77 from: > > request.path_info) > > to: > > request.path) > > Makes everything work again - hmm. No idea why though. So what you're saying is that if you introduce old bugs back into Dja

Re: Renaming of mailing lists to avoid user confusion

2008-08-20 Thread Malcolm Tredinnick
On Wed, 2008-08-20 at 12:55 -0700, daonb wrote: [...] > While a google group > is a good solution for the developers and evangelists it's not > targeted at providing help and support. Do you have any actual evidence to back that claim up? Because over the last three years, this group has done

Re: lighttpd + fcgi + FORCE_SCRIPT_NAME = admin grief

2008-08-21 Thread Malcolm Tredinnick
On Thu, 2008-08-21 at 10:02 -0700, James Matthews wrote: > Try FORCE_SCRIPT_NAME="" I use it and it works nicely It's always interesting after landing a feature like this that has a few edge cases to see where the problems distribute themselves. Turns out there are a lot of people using the ligh

No "normalize" in locale(?)

2008-08-24 Thread Malcolm Tredinnick
On Sun, 2008-08-24 at 10:14 -0700, Prairie Dogg wrote: > I ran into this problem as well when I upgraded to the most recent > django trunk. I found out about it because my tests failed the > following error: > > from locale import normalize > ImportError: cannot import name normalize So you've

Re: i18 returns me an UnicodeDecodeError

2008-08-25 Thread Malcolm Tredinnick
On Sun, 2008-08-24 at 23:29 -0700, Jose Jiménez wrote: > Hello, > > i'm using the stable version (0.96.2) of Django. > When newforms library try to returns a field's validation error, if > his translation contains any accent, it returns me an > UnicodeDecodeError. If i deactivate i18n in setting

Re: disable admin log

2008-08-25 Thread Malcolm Tredinnick
On Mon, 2008-08-25 at 09:12 -0700, chefsmart wrote: > Can someone in the know please confirm the existence or otherwise of > an option to disable logging in admin? Such an option does not exist. Regards, Malcolm --~--~-~--~~~---~--~~ You received this message

Re: Widget rendering working as intended?

2008-08-25 Thread Malcolm Tredinnick
On Mon, 2008-08-25 at 10:35 -0700, Alex G wrote: > Hi there, > > I have been trying to get a function call into a widget argument, but > have not been able to at the template level, because it would appear > that my safe_strings are being escaped somewhere down in the > framework. I have create

Re: simple multiplication in models

2008-08-25 Thread Malcolm Tredinnick
On Mon, 2008-08-25 at 15:58 -0700, Chris Amico wrote: > Changed the variable names to make it a little more readable. Method > now returns "amount" (formerly "total"): > > Class Item(models.Model): > name = models.CharField(max_length=100) > price = models.DecimalField(max_digits=9, deci

Re: MultipleObjectsReturned with get() on 1.0-beta1 admin UI

2008-08-25 Thread Malcolm Tredinnick
On Mon, 2008-08-25 at 17:44 -0700, dchandek wrote: > To make this even stranger, the problem only occurs when the pk of the > selected (self-)related object is 1. There's something deep going on > in Django that I can't trace ... This is going to be infinitely easier to debug if have a small exa

Re: File upload and access properties

2008-08-25 Thread Malcolm Tredinnick
On Mon, 2008-08-25 at 22:44 -0700, Julien Phalip wrote: > Hi, > > I'm using the FileSystem storage to save uploaded files, in a very > basic way: > > storage.save('/blah/test.mp3', uploaded_file) > > Now, the resulting file has '600' file access properties. That file is > then served by apache

Re: Django with Apache messing up with my settings.py

2008-08-26 Thread Malcolm Tredinnick
On Mon, 2008-08-25 at 23:45 -0700, mario wrote: [...] > And here's how I defined the apps in Apache2 (running with lastest > Django SVN). > > > SetHandler python-program > PythonPath "['/var/www/myapps'] + sys.path" > PythonHandler django.core.handlers.modpython > SetEnv DJANGO_

Re: complex forms validation logic?

2008-08-26 Thread Malcolm Tredinnick
On Tue, 2008-08-26 at 01:39 -0700, est wrote: > class ContactForm(forms.Form): > subject = forms.CharField(max_length=100) > message = forms.CharField() > email = forms.EmailField() > phone = forms.CharField(max_length=8) > cc_myself = forms.BooleanField(required=False) > >

Re: gis: Current locale considered when converting a geometry to WKT

2008-08-26 Thread Malcolm Tredinnick
On Tue, 2008-08-26 at 11:01 -0300, Luiz Vital wrote: > Hello all, > > I've being using geodjango since it was in a branch in a number of > projects, and in one project specifically I was getting and > OGRGeometry Exception intermitently. > > After debuging the code I noticed that de wkt string

Re: Template inherite and direct_to_template

2008-08-26 Thread Malcolm Tredinnick
On Tue, 2008-08-26 at 07:10 -0700, chatchai wrote: > Hi , > > It's not easy to explain so please look at codes below, > > #url.py > base_context = { > 'books' : Book.objects.all(), > } > > urlpatterns = patterns('', > (r'^$', direct_to_template, {'extra_context': base_context, > 'templ

Re: Optimizing Django ORM SQL queries when in a loop

2008-08-26 Thread Malcolm Tredinnick
On Tue, 2008-08-26 at 08:05 -0700, [EMAIL PROTECTED] wrote: > Hi guys, > > I'm trying to optimize one of my views that is doing a rather (naive?) > query like this: > > ... > post_stream = Post.objects.filter(poster=some_user) > for other_user in other_user_queryset: > post_stream = post_st

Re: Inherited models in new forms admin

2008-08-26 Thread Malcolm Tredinnick
On Tue, 2008-08-26 at 10:57 -0700, diggs wrote: > I'm just starting to port my app over to use nfa and the first thing > that I'm seeing is that derived models are showing up twice in the > admin. In my case I have a base VideoStory class and > TwoPersonVideoStory class that derives from VideoSto

Re: custom field: clean-method not called ...

2008-08-27 Thread Malcolm Tredinnick
On Wed, 2008-08-27 at 01:42 -0700, patrickk wrote: > I´m just trying to write a custom field for the django filebrowser (a > filebrowsefield). the __init__ method of the form-field is called, but > the clean method is not ... instead the clean method of > forms.CharField is called, which is stran

Re: enforcing uniqueness

2008-08-28 Thread Malcolm Tredinnick
Hi Robin, On Thu, 2008-08-28 at 12:55 +0100, Robin Becker wrote: > My boss, created a model that represents an override to parts of other model > instances; Man, I gotta remember to use the "don't shoot me; my boss did it" reasoning some time. :-) > the business logic demands that the model i

Re: can't pickle OracleQuery

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 06:51 -0700, paulh wrote: > django svn version 8659 > I have some django code that runs perfectly against postgres > (psycopg2), but fails with: PicklingError: Can't pickle 'django.db.backends.oracle.query.OracleQuery'>: attribute lookup > django.db.backends.oracle.query.Or

Re: intpoint filter

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 10:54 -0400, Keith Eberle wrote: > I use similar functions for some of my template filters, but I use > locale instead. > > import locale > locale.setlocale(locale.LC_ALL, '') Unfortunately that has problems if your application is expected to work in multiple locales. Beca

Re: Problem with query_set extra select/field casting

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 20:58 +0200, Stephan Jäkel wrote: [...] > x.date returns a unicode string even its the same code, the same > database and same versions (database, python-mysqldb, python itself). Is it the same version of Django? That could be an important difference. If it is the same, *wh

Re: Core keyword error

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 12:24 -0700, Rob Goedman wrote: [..] > Until beta-1 no problems. Any hints? It was removed as part of r8616. It hasn't actually been needed since newforms-admin landed, but was tied to the manipulator code that was removed in the above changeset. Regards, Malcolm --~--~

Re: Odd error when executing "runserver"

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 13:43 -0700, Huuuze wrote: > I recently installed PostgreSQL 8.3.3 and psycopg 2 (latest from > SVN). When I attempt to start Django, I receive this error: > > File "/Library/Python/2.5/site-packages/django/db/backends/ > postgresql_psycopg2/base.py", line 20, in > ra

Re: cannot import name ugettext_lazy

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 21:18 -0400, Karen Tracey wrote: [...] > > Make sure you have an SVN checkout at revision 8680 or higher. This: > > http://code.djangoproject.com/ticket/8654 > > looks like it could be responsible for what you are reporting, and the > fix was only checked in about five h

Re: Inconsistencies/Bug in ModelForm

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 21:32 -0400, Steve Holden wrote: > lingrlongr wrote: > > Submitted ticket #8663 for the following: > > > > When a ModelForm? is used to display a form for a Model, the fields > > defined with a choices option insert a "---" value for the first > > option when the form i

Re: cannot import name ugettext_lazy

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 18:37 -0700, Wayne Dyck wrote: > > I think the original poster's tarball of Django is broken. At least the > > 1.0-alpha version is. The 0.96 releases never had ugettext_lazy(). > > So I should be seeing it at this location django.utils.translation in > the latest SVN beta?

Re: cannot import name ugettext_lazy

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 19:20 -0700, Wayne Dyck wrote: > > Well, it's int django/utils/translation/__init__.py. Specifically: > > > > http://code.djangoproject.com/browser/django/trunk/django/utils/trans... > > It looks like it was just checked in a little while ago. I will > download the latest f

Re: Modify settings.py file through admin?

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 19:47 -0700, Dana wrote: > Hey All, > > Been trying to modify the settings.py file through admin using > something along the lines of: > > settings.py file: > -- > from config.models import SiteSetting > > > config= SiteSetting.objects

Re: imports

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 21:41 -0700, lingrlongr wrote: [...] > Has something changed? Nothing popped out at me on the Backwards- > incompatible changes. Nothing should have changed that caused this if your code was correct earlier. The best way to work out where the problem is simple to start bi

Re: Escaping or Unescaping Translations in Templates

2008-08-29 Thread Malcolm Tredinnick
On Fri, 2008-08-29 at 11:16 -0700, Aidas Bendoraitis wrote: > Hello all! > > How to control the escaping of translations in templates? For example, > {% trans "I & Co" %} should be escaped in html templates but not in > javascript (or other language) templates. You'll have to use different mess

Re: imports

2008-08-29 Thread Malcolm Tredinnick
On Fri, 2008-08-29 at 15:00 -0700, lingrlongr wrote: > I can see some differences between the Python Path for the dev server > (manage.py runserver) and apache/mod_python. I created an error in a > template using an invalid tag so the Django pretty error screen > appears. Using the development

Re: photologue or: how to not escape html in the admin?

2008-08-30 Thread Malcolm Tredinnick
On Sat, 2008-08-30 at 15:52 +0200, Benjamin Buch wrote: > Hi, > > > I've installed photologue recently, and it's a great app. > Works like a charm... > > > The only thing that doesn't is the thumbnail preview in the admin. > I think photologue spits out the correct html: > > > src="http://

Re: id problem with mysql and django models

2008-08-30 Thread Malcolm Tredinnick
On Sat, 2008-08-30 at 06:56 -0700, eniac wrote: > Hello, > > I'm using django 0.96.1 on ubuntu. > I'm going to describe the steps I went through until I encountered > something odd. > > I create a model: > > class shoutbox(models.Model): > name = models.CharField(maxlength=15) >

Re: Space added when including URLs

2008-08-30 Thread Malcolm Tredinnick
On Sat, 2008-08-30 at 09:08 -0700, Leaf wrote: > I'm testing a styles app, and I tried this URL: > > http://localhost:8000/styles/css/test-style/ > > When I did that, it responded with a 404 error. It said it checked > against the URLConfs I had included, which were: [...] >1. ^admin/doc/

Re: Translating Model Form Error Messages

2008-08-30 Thread Malcolm Tredinnick
On Sat, 2008-08-30 at 12:57 -0700, Aaron wrote: > Hi, I'm working on a non-English site and need to replace the > validation messages from ModelForm (e.g. 'This field is required.') > What are some approaches that I can take? All those strings should already be translated. They're defined in dja

Re: recursive templates

2008-08-30 Thread Malcolm Tredinnick
On Sat, 2008-08-30 at 20:33 -0700, mmcduff wrote: > I am trying to create a contents list using the following > sidebar_sub_contents.html. > > {% for content in contents %} > {% if content.link %} > > {{ content.name }} > > {% endif %} > {% if content.li

Re: how do i do background tasks

2008-08-31 Thread Malcolm Tredinnick
On Sun, 2008-08-31 at 09:00 -0700, sotirac wrote: > i'm creating an application that will read rss feeds. i'm using the > universal feed parser library. i have a feed model (has the url to the > feed) and an entry model (for each individual entry). Is there a > method in the model that I have to

Slovkian speakers? Help wanted with #8709

2008-08-31 Thread Malcolm Tredinnick
All, We're coming down to the wire with 1.0, so I need to throw out a plea to the audience... If anybody speaks Slovakian, could you please have a look at the translation diff attached to ticket #8709 and see if it looks reasonable. This is a case of somebody who is unknown to me submitting a la

Re: Slovkian speakers? Help wanted with #8709

2008-08-31 Thread Malcolm Tredinnick
On Sun, 2008-08-31 at 13:21 -0700, Frantisek Malina wrote: > Hi Malc, > I am the author of the language file, I've tested it on a full Satchmo > installation. > I wrote to Vlado Labath, who is the original translator of Django to > Slovak prior to submitting the ticket it directly, but I got no >

Re: Unicode decode errors with Admin and Postgres

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 08:37 -0700, Paolo Corti wrote: > Hi all > > I am a beginner using Django from the trunk and Postgres 8.2 > > I have this issue with utf8, you can replicate it this way (it is > something similiar to this with MySql i guess: > http://groups.google.com/group/django-users/br

Re: threadlocals: hack or best practice?

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 00:33 -0700, patrickk wrote: > http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser > > using threadlocals has been considered a "hack" recently by one of the > main django-developers (james bennett, see > http://groups.google.com/group/django-users/browse_frm/thr

Re: Verbose model name in Admin interface

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 04:41 -0700, Nick Day wrote: > No, sorry, my mistake - I hadn't had enough coffee when I posted > this... > > I actually wanted to change the app name in the admin interface. My > app is called "en" and I would like this to appear as "English Site" > within the admin inter

Re: ValueError at /pages/

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 10:39 -0700, Leaf wrote: > All the info is at http://dpaste.com/75250/. I really have no idea > what this error is trying to tell me. Can anyone explain what it might > be? It's an internal Python error that is raised when you try to update a dictionary with bad data. What

Re: Using model instances as dictionary keys

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 08:35 -0700, Rodrigo Culagovski wrote: [...] > So, I guess the problem is using a model instance as a dictionary key. > What's weird is the development/production server discrepancy. > Development is running 0.97, production 0.96, which I guess might > account for the differ

Re: Send emails using sendmail or postfix

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 11:39 -0700, Mathieu Leplatre wrote: > Hi all, > > According to the documentation, email sending is done through smtp. > Is there a way to use sendmail or postfix instead ? Yes, start up sendmail or postfix to listen on a port. :-) Presumably, you mean sending by calling

Re: dumb question model-dictionary

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 15:10 -0400, Jay Parlar wrote: > On Mon, Sep 1, 2008 at 2:48 PM, Vance Dubberly <[EMAIL PROTECTED]> wrote: > > > > So I'm finding there are multiple places where I'm needing to iterate > > over the properties of a Model and I'm absolutely certain it's got to > > be insanely

Re: Running doctests

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 22:48 +0200, Guillaume Lederrey wrote: > Hello ! > > I have an app that has a "utils.py" module. I have written quite a few > doctests inline. Now my problem is to actually run those tests. > Reading the documentation, I get the feeling that I should be able to > call them

Re: Url template tag errors post-8760, invalid literal for int

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 15:16 -0700, Dave Lowe wrote: > I saw the note about revision 8760 introducing changes to reverse and > the url template tag, specifically that passing extra parameters won't > work. I haven't been able to find anywhere in my code where extra > parameters are being passed. H

Re: Url template tag errors post-8760, invalid literal for int

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 15:55 -0700, Dave Lowe wrote: > I wish I could find that. I've already been looking for anything like > that and keep coming up empty. None of the URL variables I'm using > include '}'. Not the variables. The regular-expression patterns. In one of your urls.py files. Regar

Re: Url template tag errors post-8760, invalid literal for int

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 15:59 -0700, Malcolm Tredinnick wrote: > > On Mon, 2008-09-01 at 15:55 -0700, Dave Lowe wrote: > > I wish I could find that. I've already been looking for anything like > > that and keep coming up empty. None of the URL variables I'm using &

Re: utf8 works on my dev server but not on my production server

2008-09-01 Thread Malcolm Tredinnick
On Mon, 2008-09-01 at 16:16 -0700, Henhiskan wrote: > I had the same error and was fix changing the encoding var in > setencoding() method from site.py ( in your python installation) > I change it from "ascii" to "UTF-8" Please don't do that. Or if you must, don't recommend it to other people.

Re: MySQL timediff and datetime.timedelta

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 03:16 -0700, Jens Grivolla wrote: > Hi, > > I am getting weird results using django.db to do a "select > timediff(a,b)..." query from MySQL. The result is a datetime.datetime > object instead of a datetime.timedelta. When using MySQLdb directly, > it returns the expected

Re: day is out of range for month

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 08:38 -0700, Xiong Chiamiov wrote: > On a site of ours, we got a 500 on Aug 31 with the error: > > ImproperlyConfigured: Error while importing URLconf 'ee_website.urls': > day is out of range for month > > from this line: > > announcements = {'queryset': > Announcement.ob

Re: Custom SQL or database API?

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 13:12 -0700, janedenone wrote: > Hi, > > I am in the process of moving my handmade website to a Django-based > version. One of my SQL queries returns all articles by a certain > author if this article is not a chapter or section of an article by > the same author: > > SELE

Re: Testing framework observations

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 18:45 -0700, ballparkfh wrote: > My fixtures won't load unless I name them "initial_data". What is the > reason for this? Based on the complete lack of example code you've provided, it's difficult to tell. Perhaps post a short example of your TestCase-derived class so we c

Re: registering an admin class causes complete meltdown

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 21:40 -0700, Justin Fagnani wrote: > I have a very, very simple model that when I register with the admin > completely kills my app/project. I can't for the life of me figure out > what's going on. If I don't register the admin class, everything works > fine, if I do, the no

Re: registering an admin class causes complete meltdown

2008-09-02 Thread Malcolm Tredinnick
On Tue, 2008-09-02 at 22:16 -0700, Justin Fagnani wrote: > Of course. I've been doing it this way at the start of conversions and > this is the first time it's been a problem. Some internal changes were necessary recently (particularly r8605) to work around some other problems that have made thi

Re: OT: Google Chrome

2008-09-03 Thread Malcolm Tredinnick
Come on, guys. There's no Django content in this thread and the list is high enough volume without becoming a social list. Take it somewhere else, please. Thanks, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: forms and dynamic # of form fields

2008-09-03 Thread Malcolm Tredinnick
On Wed, 2008-09-03 at 11:08 -0700, Mike Hansen wrote: > I apologize if this already showed up on the list. I originally posted this > from google groups, and I think it ate it. > > I'm new to Django. As a small Django project, I'm making a internal purchase > request form. One section has user

Re: How to encode the url ??

2008-09-03 Thread Malcolm Tredinnick
On Wed, 2008-09-03 at 13:00 +0200, Grzegorz Szymański wrote: > On Wednesday 03 of September 2008 09:19:37 babatu wrote: > > How to encode the url ??make the non-English looks like %CD%E2%C6%C5%BC > > %D2 > > http://docs.python.org/lib/module-urllib.html > quote, unquote Neither of which work wi

Re: How am I supposed to debug a url template tag?

2008-09-03 Thread Malcolm Tredinnick
On Wed, 2008-09-03 at 14:07 -0700, catsclaw wrote: > On Sep 3, 3:48 pm, bruno desthuilliers <[EMAIL PROTECTED]> > wrote: > > Sorry, my crystal ball is down for maintainance - but the answer is > > probably that the django.core.urlresolvers.reverse function didn't > > found a match. The easiest w

Re: Django 1.0 post_save signal has no attribute 'connect'?

2008-09-04 Thread Malcolm Tredinnick
On Thu, 2008-09-04 at 06:25 -0700, Webchemist wrote: > Hi all! > > Trying the fallowing: > > from django.db.models import signals > print dir(signals.post_save) > gives: > ['__class__', '__delattr__', '__doc__', '__getattribute__', > '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex

Re: USStateField has gone missing

2008-09-04 Thread Malcolm Tredinnick
On Thu, 2008-09-04 at 18:23 -0700, Brandon Taylor wrote: > Hello everyone, > > Is anyone else missing USStateField? None of my models that use this > field are validating. I've tried trunk and the 1.0 official release I > get the same error on both versions. > > If you look in django > db > mod

Re: USStateField has gone missing

2008-09-04 Thread Malcolm Tredinnick
On Thu, 2008-09-04 at 18:46 -0700, Brandon Taylor wrote: > So, next stupid question :) > > These fields all derive from forms, not models. Not true. All the fields in django.contrib.localflavor.us.forms derive from form fields. All the ones in django.contrib.localflavor.us.models derive from m

Re: ModelChoiceField - remove empty-value

2008-09-05 Thread Malcolm Tredinnick
On Fri, 2008-09-05 at 03:11 -0700, mwebs wrote: > Hello, > > I use a modelchoicefield and want to remove the entry that represents > "no item selected"(--), because in my > scenario I will only allow to select between existing entries. Specify a default value for the field (one of the choic

Re: Limit results of Q objects?

2008-09-05 Thread Malcolm Tredinnick
On Fri, 2008-09-05 at 16:52 +0200, Benjamin Buch wrote: > Hi all, > > 1.0 is there, great! Congratulations for the people who made it > possible! > > Now my problem: > > I have a model 'Gig' which includes a date field, and I need a query > that results in the five latest passed gigs and t

Re: Limit results of Q objects?

2008-09-05 Thread Malcolm Tredinnick
On Fri, 2008-09-05 at 08:32 -0700, julianb wrote: > gigs = Gig.objects.filter(date__gt=today)[:5] & > Gig.objects.filter(date__lte=today)[:5] Whilst that might not raise an error, it won't return the correct result. You can only have one limit on a single SQL query. Regards, Malcolm --~--~--

<    1   2   3   4   5   6   7   8   9   10   >