multiple one-to-one relationships

2008-07-15 Thread Eric Abrahamsen
I've got an issue with multiple one-to-one relationships, which probably arises from poor design decisions on my part. Given a model like the following: class Translator(models.Model): user = models.OneToOneField(User, unique=True, blank=True, null=True, help_text="If this translator i

Re: capture http code 413 (file size too large)

2008-07-15 Thread Eric Abrahamsen
If you wanted to do this purely within django, you could write a custom middleware that reads a 'request body max size' setting from settings.py, then checks the content-length header on incoming request against that setting and returns a custom 413 if it's too large. I believe that doing

Re: writing unit tests for views?

2008-07-15 Thread pgb
On 15 Lip, 20:54, bshaurette <[EMAIL PROTECTED]> wrote: > For what it's worth, I finally came up with a simple working test forviews.   > Mytestswere written correctly all along, I just had to take > care of those errors related to the project settings.  It never > occurred me to just set constan

NEED HELP

2008-07-15 Thread Kadusale, Myles
Help! I am trying out Django but I get this error in my console C:\DjangoProj\UserApp>python manage.py syncdb Error: Couldn't install apps, because there were errors in one or more models: UserApp.UserProfile: invalid syntax (models.py, line 12)

Re: ImportError: No module named django.core.management

2008-07-15 Thread templar_knight
Thanks for the reply Karen. I think I'll upgrade to an SVN checkout of Django, as you advised. Thanks a lot for your advice. :-) On Jul 13, 9:54 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Jul 14, 2008 at 12:40 AM, tampler_knight <[EMAIL PROTECTED]> wrote: > > > Thank you so much f

capture http code 413 (file size too large)

2008-07-15 Thread [EMAIL PROTECTED]
I have used the LimitRequestBody directive in the apache conf to set it to 1 mb. so, any files biggers than 1 mb should be rejected. while testing it however, i found that when i try to upload a file larger than 1 mb, it ends up displaying my custom 500.html page.. how can I display another cust

Re: ANNOUNCE: Django search with Lucene.

2008-07-15 Thread Spike^ekipS
Hi, Ben. I already knew that project, djangosearch and at first my first candidate to use lucene in django is also djangosearch :) but it is under early stage of development and I need the one, which is /* more integrated with django queryset */, not raw lucene query, so I determined to write my

Re: ANNOUNCE: Django search with Lucene.

2008-07-15 Thread free won
mark it. thanks for your share. -- Vince Lombardi - "Winning is habit. Unfortunately, so is losing." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: ANNOUNCE: Django search with Lucene.

2008-07-15 Thread Ben Firshman
You might be interesting in my GSoC project! http://code.google.com/p/djangosearch/ Apparently PyLucene has problems with threading, which is why it is not a priority for djangosearch. Have you run into anything like that? Ben On 15 Jul 2008, at 06:45, Spike^ekipS wrote: > > Hi, django user

Question

2008-07-15 Thread Kadusale, Myles
Is there a way to put all models in one directory and all forms in another directory? I like to organize the placement of the files. Or is there are a better way to do it? Or standard placement? Like MyApp | | Models || ||mdlInventory ||mdlItem

Re: Unique Case Sensitivity

2008-07-15 Thread Russell Keith-Magee
On Wed, Jul 16, 2008 at 8:59 AM, Chris <[EMAIL PROTECTED]> wrote: > > I've run into a strange situation. I have a MySQL database with a > table called Feature, with a unique column called text. > > Given some text, I want to save a new record if hasn't been entered, > or retrieve the existing reco

RE: Inquiry

2008-07-15 Thread Kadusale, Myles
Thank you for the inputs! -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Brett Hoerner Sent: Tuesday, July 15, 2008 10:02 PM To: django-users@googlegroups.com Subject: Re: Inquiry On Tue, Jul 15, 2008 at 8:40 AM, Marty Alchin <[EMAIL PROT

Unique Case Sensitivity

2008-07-15 Thread Chris
I've run into a strange situation. I have a MySQL database with a table called Feature, with a unique column called text. Given some text, I want to save a new record if hasn't been entered, or retrieve the existing record if it already exists. Oddly enough, this code fails if the current text ha

Re: Complex queryset construction

2008-07-15 Thread Julien Phalip
How about: Item.objects.filter(categories__watching__user=request.user).distinct() I haven't tested it, but if it works it would return all items watched by the user. Then, to display items by category, I would use the regroup tag [1] in the template. [1] http://www.djangoproject.com/documentat

Re: url (reverse) as a filter

2008-07-15 Thread Julien Phalip
I guess you would have to preprocess the text with the template system, reversing all the URLs, and then pass it to markdown processing. So, you'd have: ({% url mylink %} "Check this link") On Jul 16, 3:11 am, gzy <[EMAIL PROTECTED]> wrote: > Hi, > > I like the idea of seperating the.. "address

Re: PATH problem?

2008-07-15 Thread Frantisek Malina
Awesome Daniel. That was the one. I've got the development server running on the deployment machine. However, there is another PATH problem with Apache / mod_python complaining about missing modules, even if those are on the spot: ImproperlyConfigured: Error importing middleware satchmo.shop.SSL

Re: legacy site in php

2008-07-15 Thread Jon Brisbin
Rather than the structure you suggest, it might be better to think about your exhibition projects not as django projects, but as django apps. Replace pyA and pyB with root/pyA and root/pyB (e.g. make your php directories a peer of the django root...conceptually, of course...you're Python f

legacy site in php

2008-07-15 Thread garycannone
I have what is a very naive question though I didn't find a close enough post that answered what I think is a very general question. I work at a museum and inherited a site done in php (the coding is very problematic but this is not the issue). I will overhaul the site and would like to use Pytho

Re: PATH problem?

2008-07-15 Thread Daniel Roseman
On Jul 15, 8:38 pm, Frantisek Malina <[EMAIL PROTECTED]> wrote: > Project is in the folder httpdocs, in this folder there is a symlink > to satchmo. > settings.py, manage.py, urls.py... files are placed in the httpdocs > folder. > > Can I set a project name to something else? > Have you got a bla

Re: documentation offline, which CSS?

2008-07-15 Thread Andre Meyer
hi David that looks nice, thanks. hope you can make it work again. thanks André On Tue, Jul 15, 2008 at 6:59 PM, David Larlet <[EMAIL PROTECTED]> wrote: > > > Le 15 juil. 08 à 11:58, Andre Meyer a écrit : > > > hi all > > > > like other people, i tried to get an offline copy of the django > >

Re: Quick question about switching to newforms-admin branch....

2008-07-15 Thread Jon Brisbin
I assumed that trunk would be moving in the newforms-admin direction, so I've switched already. I would rather do it now than have to backport stuff later... Thanks! Jon Brisibn http://jbrisbin.com On Jul 15, 2008, at 3:50 PM, Dan wrote: > Should I start with the nfa branch or with trunk a

Complex queryset construction

2008-07-15 Thread Burr Settles
Hey fellow djanglers, I am trying to construct a view that's a bit complicated, and struggling to create the proper queryset. Hopefully some of you have done something like this before, or otherwise have some ideas on how to tackle it efficiently. Imagine we have something like these models: cl

Re: Quick question about switching to newforms-admin branch....

2008-07-15 Thread Dan
Should I start with the nfa branch or with trunk and update the code when it is merged? Is there risks of breakage in nfa? Other issues? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: ImportError: No module named core

2008-07-15 Thread Evert
> I've been trying to setup Django on Dreamhost and I haven't had much > luck. My latest error / problem is this: > > django-admin.py > Traceback (most recent call last): >   File "/home/username/projects/django/trunk/django/bin/django- > admin.py", line 2, in ? >     from django.core import manag

Re: Strange error in admin interface when adding a new record (core.js and RelatedObjectLookups.js?)

2008-07-15 Thread Huuuze
Disregard. Odd issue with my ADMIN_MEDIA_PREFIX. On Jul 15, 2:13 pm, Huuuze <[EMAIL PROTECTED]> wrote: > When I click the button to add a new Person object (one of my objects, > not the User object) in the admin interface, I receive the following > error in my console window: > > ERROR:  invalid

Re: Dynamic form not running

2008-07-15 Thread Joshua Jonah
Cleaned and documented the views.py file: http://dpaste.com/hold/65184/ Joshua Jonah wrote: > Ok, here we go. I'm using the previous form to display lists of > categories of checkboxes *breath*. > > Here it is: http://www.hftvnetwork.com/ProIn/ > > I'm having problems getting it to only show the

Re: How to access the label of a model instance

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 2:08 PM, Arien <[EMAIL PROTECTED]> wrote: > Oh, I see, you want the verbose_name of each field. I suppose you > could write a templatetag that you could use like this: > > {% verbose_name layer.heating_temperature %} > {{ layer.heating_temperature }} > > After parsing th

Re: Quick question about switching to newforms-admin branch....

2008-07-15 Thread Rajesh Dhawan
On Jul 15, 3:30 pm, Jason <[EMAIL PROTECTED]> wrote: > ...and it is:  if I were to switch my current django project over to > newforms-admin branch, would it break all of the old admin pages? Yes. > Or > is there legacy support built in? It isn't. But the following snippet might help create q

Re: PATH problem?

2008-07-15 Thread Frantisek Malina
Project is in the folder httpdocs, in this folder there is a symlink to satchmo. settings.py, manage.py, urls.py... files are placed in the httpdocs folder. Can I set a project name to something else? On 15. Júl, 20:48 h., Joshua Jonah <[EMAIL PROTECTED]> wrote: > In your httpd.conf, there's thi

Quick question about switching to newforms-admin branch....

2008-07-15 Thread Jason
...and it is: if I were to switch my current django project over to newforms-admin branch, would it break all of the old admin pages? Or is there legacy support built in? Thanks mucho in advance! --~--~-~--~~~---~--~~ You received this message because you are sub

Re: Dynamic form not running

2008-07-15 Thread Joshua Jonah
Ok, here we go. I'm using the previous form to display lists of categories of checkboxes *breath*. Here it is: http://www.hftvnetwork.com/ProIn/ I'm having problems getting it to only show the amount of blanks it needs, it looks like it closes the last column div and then outputs even more bla

Re: How to access the label of a model instance

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 1:22 PM, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Arien writes: >> You'll have to make layer._meta.verbose_name available to the >> template under some other name. > > Unfortunately, I use model polymorphism and model inheritance in > this case and can't pass anything b

Re: writing unit tests for views?

2008-07-15 Thread bshaurette
For what it's worth, I finally came up with a simple working test for views. My tests were written correctly all along, I just had to take care of those errors related to the project settings. It never occurred me to just set constants at the top of the test file, but that's what worked. impor

Re: Dynamic form not running

2008-07-15 Thread Joshua Jonah
You're the man, and about the float() thing, i couldn't get it to work before and that fixed it believe it or not. I'm still having trouble with this but in another area, I'll dpaste a bunch and post it. Marty Alchin wrote: > On Tue, Jul 15, 2008 at 2:19 PM, joshuajonah <[EMAIL PROTECTED]> wrot

Re: Seperate project in a subdirectory (Apache 2.2 & mod_python)

2008-07-15 Thread Chris H.
I dunno what's different, but I seem to have it working today. Maybe I didn't restart Apache (I can be prone to dumb mistakes). Here's the final httpd.conf: SetHandler python-program PythonPath "['C:/django-projects'] + sys.path" PythonHandler django.core.handlers.modpython Se

Re: PATH problem?

2008-07-15 Thread Joshua Jonah
In your httpd.conf, there's this line: SetEnv DJANGO_SETTINGS_MODULE httpdocs.settings Is your project named "httpdocs"? thats should be the name of the project. I'm guessing it should be "satchmo". Frantisek Malina wrote: > settings.py > http://dpaste.com/65171/ > > vhost.conf > http://dpas

Re: Dynamic form not running

2008-07-15 Thread Marty Alchin
On Tue, Jul 15, 2008 at 2:19 PM, joshuajonah <[EMAIL PROTECTED]> wrote: > White forever, never loads in the browser. I have changed it today, > but i cannot figure out what i screwed up. > > http://dpaste.com/hold/65163/ > > It makes a ton of checkboxes in four columns, it then adds blank > fields

Re: PATH problem?

2008-07-15 Thread Frantisek Malina
settings.py http://dpaste.com/65171/ vhost.conf http://dpaste.com/65172/ Not that these are short and sweet, but I am running a similar setup on the local machine. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: PATH problem?

2008-07-15 Thread Frantisek Malina
settings.py http://dpaste.com/65171/ vhost.conf http://dpaste.com/65172/ Not that these are short and sweet, but I am running a similar setup on the local machine. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: PATH problem?

2008-07-15 Thread Joshua Jonah
Post your settings.py and the changes you made in the httpd.conf/vhost.conf Frantisek Malina wrote: > Correct link to mod_python error: > http://dpaste.com/65168/ > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: How to group by two fields simultaneously.

2008-07-15 Thread Malcolm Tredinnick
On Tue, 2008-07-15 at 11:24 -0700, Alex wrote: [...] > So my view throws out a list of teams, filtered to the person and my > template looks like this: > > {% for t in teams %} > {% for s in t.getStats %} > ** I WANT TO NOW DO SOMETHING LIKE: ** > {% for v in s.getStatValues(Person,s)

Re: PATH problem?

2008-07-15 Thread Frantisek Malina
Correct link to mod_python error: http://dpaste.com/65168/ --~--~-~--~~~---~--~~ 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 t

How to group by two fields simultaneously.

2008-07-15 Thread Alex
I have the following: Model Person Model Stat Model Stat Value Model Team A Team has a set of Stats relevant to it. A person is on multiple teams, and has stats for his/her performance on that team which are stored as Stat Values. Stat values are unique by Person, Stats, and Team. I want to b

Re: How to access the label of a model instance

2008-07-15 Thread Torsten Bronger
Hallöchen! Arien writes: > On Tue, Jul 15, 2008 at 12:00 PM, Torsten Bronger > <[EMAIL PROTECTED]> wrote: >> >> Arien writes: >> >>> On Tue, Jul 15, 2008 at 10:53 AM, Torsten Bronger >>> <[EMAIL PROTECTED]> wrote: >>> In a display template (not a form, just display), I write the follow

PATH problem?

2008-07-15 Thread Frantisek Malina
I am trying to deploy my app on the production server, however I am having some issues. The development server says: http://dpaste.com/65164/ Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File "/usr/lib/python2.5/site-packages/django/core/man

Dynamic form not running

2008-07-15 Thread joshuajonah
White forever, never loads in the browser. I have changed it today, but i cannot figure out what i screwed up. http://dpaste.com/hold/65163/ It makes a ton of checkboxes in four columns, it then adds blank fields for new options until it is divisible by 4 so that it fits the 4 column layout righ

Re: .pyc files not being created

2008-07-15 Thread Dana
Ok I think I got it now. Well, now to figure out why my application is eating up over 200mb's of memory without any users... Thanks, Dana On Jul 15, 11:08 am, Jeff Anderson <[EMAIL PROTECTED]> wrote: > Dana wrote: > > @Evert > > > Thanks for the information, Ill be looking into all that today.

Re: Help with Forms (Dynamic Fields)

2008-07-15 Thread Jeff FW
You have to pass the data into the form when instantiating it, eg: form = MyForm(request.POST) However, that means (for your example), the fields wouldn't exist yet-- move them into __init__ instead. Some other things to note: you don't need to "title" and "email" to the form dynamically--might

Strange error in admin interface when adding a new record (core.js and RelatedObjectLookups.js?)

2008-07-15 Thread Huuuze
When I click the button to add a new Person object (one of my objects, not the User object) in the admin interface, I receive the following error in my console window: ERROR: invalid input syntax for integer: "static_media/admin/js/ core.js" STATEMENT: SELECT "person_person"."id", "person_perso

Question about a custom inclusion tag

2008-07-15 Thread Matic Žgur
Hi, is there a way to pass an argument from urls.py to inclusion tag? For example, if I have a custom inclusion tag that prints some links to some pages and I don't want it to print the link to the page I'm currently visiting, how would I do it? Let's say that I'm visiting a page /posts/2008. O

Re: escape filter

2008-07-15 Thread Fernando Rodríguez
El mar, 15-07-2008 a las 10:33 -0700, Malcolm Tredinnick escribió: > > I'm definitely not saying you definitely don't need this, but make sure > that you're doing it for the right reasons. Sending UTF-8 in all of it's > non-entity-encoded glory is very normal practice. OK, thanks. :-) --~--

Re: .pyc files not being created

2008-07-15 Thread Jeff Anderson
Dana wrote: @Evert Thanks for the information, Ill be looking into all that today. @Graham, So there is no speed increase in using compiled python than using just strait python? So why is python ever compiled in the first place? There is a speed increase-- it's just not that big in this sit

Re: escape filter

2008-07-15 Thread Fernando Rodríguez
El mar, 15-07-2008 a las 12:30 -0500, Arien escribió: > Why do you need to use HTML entities for accented characters? What is > the problem you're trying to solve? > Aren't you suposed to display accented chars and stuff like ¡ or ¿ as html entities? --~--~-~--~~~---

Re: .pyc files not being created

2008-07-15 Thread Dana
@Evert Thanks for the information, Ill be looking into all that today. @Graham, So there is no speed increase in using compiled python than using just strait python? So why is python ever compiled in the first place? Thanks! On Jul 15, 6:27 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On

Re: how to use PythonAuthzHandler with django?

2008-07-15 Thread V
shyt, I was looking for these docs this morning! thanks for the poinger Graham, it seems to be very detailed, and once I forget the hassles I've survived today with mod_python, I'll probably give it a try btw, is there any reason why this documentation can't be found under http://www.djangoproje

Re: Seperate project in a subdirectory (Apache 2.2 & mod_python)

2008-07-15 Thread Chris H.
On Jul 15, 12:30 pm, V <[EMAIL PROTECTED]> wrote: > First of all Apache will look through all the directives, > and the later ones overwrite the former ones. So you should definitely > put the more precise one at the bottom. > > Probably your media files work, because you've added something like

ImportError: No module named core

2008-07-15 Thread [EMAIL PROTECTED]
I've been trying to setup Django on Dreamhost and I haven't had much luck. My latest error / problem is this: django-admin.py Traceback (most recent call last): File "/home/username/projects/django/trunk/django/bin/django- admin.py", line 2, in ? from django.core import management ImportErr

Re: escape filter

2008-07-15 Thread Malcolm Tredinnick
On Tue, 2008-07-15 at 19:22 +0200, Fernando Rodríguez wrote: > El mar, 15-07-2008 a las 12:25 -0400, Ned Batchelder escribió: > > > You're misunderstanding the role of the escape filter. It isn't meant > > to create HTML entities for accented characters. All it does is escape > > characters

Re: Don't see form errors in template

2008-07-15 Thread Brian Luft
> First of all, I want to say that I do not understand the relationship > between forms and models in Django. A form to ask and a model to > store? How to pass the form data to a model? Have I to pass it in > order to validate? There is not necessarily a relationship between the two. You are cor

Re: Seperate project in a subdirectory (Apache 2.2 & mod_python)

2008-07-15 Thread V
First of all Apache will look through all the directives, and the later ones overwrite the former ones. So you should definitely put the more precise one at the bottom. Probably your media files work, because you've added something like urlpatterns += patterns('', (r'^media/(?P.*)$',

Re: escape filter

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 12:22 PM, Fernando Rodríguez <[EMAIL PROTECTED]> wrote: > > El mar, 15-07-2008 a las 12:25 -0400, Ned Batchelder escribió: > >> You're misunderstanding the role of the escape filter. It isn't meant >> to create HTML entities for accented characters. All it does is escape >

Re: Multi-level template blocks

2008-07-15 Thread Gregg Lobdell
Thanks for the reply. It does work! Doh! I had a stupid error. In the middle template of the real templates, I had (%block layer_special %) instead of {%block layer_special%}. Parens instead of curly brace. Arg. Once again, thanks for the help. To know that it SHOULD work helped me find th

Re: timesince truncating

2008-07-15 Thread Malcolm Tredinnick
On Tue, 2008-07-15 at 00:38 -0700, Shantp wrote: > Hi all, > > This seems like it will have an obvious answer but I did a lot of > searching and can't find the answer. The timesince template tag > returns 2 outputs like "2 days, 3 hours". How can I limit the output > to only 1 thing? By writing

Re: Modules Imported Multiple Times

2008-07-15 Thread Malcolm Tredinnick
On Mon, 2008-07-14 at 23:30 -0700, django-m712 wrote: [...] > Has anyone else experienced this problem? There are a few places in Django where we need to access all the models in an app, for example. So we use __import__(), since that's the safest way to do this. This is the same as calling relo

Re: escape filter

2008-07-15 Thread Fernando Rodríguez
El mar, 15-07-2008 a las 12:25 -0400, Ned Batchelder escribió: > You're misunderstanding the role of the escape filter. It isn't meant > to create HTML entities for accented characters. All it does is escape > characters that could be dangerous for XSS attacks (" ' < > &). And by > the way

Re: How to access the label of a model instance

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 12:00 PM, Torsten Bronger <[EMAIL PROTECTED]> wrote: > > Hallöchen! > > Arien writes: > >> On Tue, Jul 15, 2008 at 10:53 AM, Torsten Bronger >> <[EMAIL PROTECTED]> wrote: >> >>> In a display template (not a form, just display), I write the >>> following: >>> >>>{% trans

url (reverse) as a filter

2008-07-15 Thread gzy
Hi, I like the idea of seperating the.. "address space" of a website from the templates. On the other hand I'm keeping most of the content in the db and displaying through the markup filter. So I'm looking for a way to feed the url_bit in markdown's [link] (url_bit "Title") to Django's {% url %}

Re: How to access the label of a model instance

2008-07-15 Thread Torsten Bronger
Hallöchen! Arien writes: > On Tue, Jul 15, 2008 at 10:53 AM, Torsten Bronger > <[EMAIL PROTECTED]> wrote: > >> In a display template (not a form, just display), I write the >> following: >> >>{% trans 'Temperature:' %} >>{{ layer.heating_temperature }} >> >> I'd like to use the verbose_n

Re: documentation offline, which CSS?

2008-07-15 Thread David Larlet
Le 15 juil. 08 à 11:58, Andre Meyer a écrit : > hi all > > like other people, i tried to get an offline copy of the django > docs. so, running rst2html from docutils works fine, but there is a > problem with the links (directing to the site instead of the local > docs) and it looks a lot l

Re: escape filter

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 11:00 AM, Fernando Rodríguez <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm using this simple template with flatpages: > > > >{{ flatpage.title|escape }} > > > >{{flatpage.title|escape}} >{{ flatpage.content|escape }} > > > > > I was ex

Re: Trying to install django

2008-07-15 Thread Ralph
Brillant, it all works now. Thanks Arien, you are a star. Ralph On Jul 15, 6:02 pm, Arien <[EMAIL PROTECTED]> wrote: > On Tue, Jul 15, 2008 at 9:58 AM, Arien <[EMAIL PROTECTED]> wrote: > > On Tue, Jul 15, 2008 at 9:27 AM, Ralph <[EMAIL PROTECTED]> wrote: > > >> I'm trying to install django

Re: newbie help

2008-07-15 Thread Mario Zorz
Thanks Joshua! I'll fetch the dev version of Django instead. I guess I was confused by the phrases "SVN release" and "official release". I just thought the SVN release would be the official release :p Thanks a log again - Original Message From: Joshua Jonah <[EMAIL PROTECTED]> To: djan

Re: newbie help

2008-07-15 Thread Mario Zorz
thanks a lot Matt! I'll fetch the dev version of Django instead. I guess I was confused by the phrases "SVN release" and "official release". I just thought the SVN release would be the official release :p Thanks a log again - Original Message From: Matt McClanahan <[EMAIL PROTECTED]>

Re: escape filter

2008-07-15 Thread Ned Batchelder
You're misunderstanding the role of the escape filter. It isn't meant to create HTML entities for accented characters. All it does is escape characters that could be dangerous for XSS attacks (" ' < > &). And by the way, in the latest code, escaping is automatic, so you may not need it at

Re: How to access the label of a model instance

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 10:53 AM, Torsten Bronger <[EMAIL PROTECTED]> wrote: > > Hallöchen! > > In a display template (not a form, just display), I write the > following: > >{% trans 'Temperature:' %} >{{ layer.heating_temperature }} > > I'd like to use the verbose_name of the model instanc

escape filter

2008-07-15 Thread Fernando Rodríguez
Hi, I'm using this simple template with flatpages: {{ flatpage.title|escape }} {{flatpage.title|escape}} {{ flatpage.content|escape }} I was expecting to see all accented chars in title and contents to be displayed properly escaped, however,

Re: integer digit limit

2008-07-15 Thread Bobby Roberts
>   some_field = forms.IntegerField(widget=forms.TextInput(attrs={'maxlength': PERFECT! I missed that attrs dictionary in the form widgets... man that is really awesome! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

How to access the label of a model instance

2008-07-15 Thread Torsten Bronger
Hallöchen! In a display template (not a form, just display), I write the following: {% trans 'Temperature:' %} {{ layer.heating_temperature }} I'd like to use the verbose_name of the model instance instead of hard-wiring the label in the template. How can I access it? Tschö, Torsten.

Re: integer digit limit

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 10:30 AM, Bobby Roberts <[EMAIL PROTECTED]> wrote: > I've got an IntegerField setup with a max_value of 20. I'm > wondering how to limit the initial input on the form field to no more > than 6 characters. You can pass the fields widget an optional attrs keyword argume

Re: Seperate project in a subdirectory (Apache 2.2 & mod_python)

2008-07-15 Thread Chris H.
On Jul 14, 8:23 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > What order are you including them in the Apache configuration? > > Have you tried switching the order? > > Graham I have tried. I thought if I placed the testproject directive first it would short circuit things, but it didn't see

integer digit limit

2008-07-15 Thread Bobby Roberts
hi I've got an IntegerField setup with a max_value of 20. I'm wondering how to limit the initial input on the form field to no more than 6 characters. They can enter 20 characters for example. When they hit the submit button of course it will error out but i'd like to limit the initial len

Re: Trying to install django

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 9:58 AM, Arien <[EMAIL PROTECTED]> wrote: > On Tue, Jul 15, 2008 at 9:27 AM, Ralph <[EMAIL PROTECTED]> wrote: >> >> I'm trying to install django for the first time. [...] > What I do is this: > > 1. check out the svn version to some directory, for example > c:\svn\django-

Re: Trying to install django

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 9:27 AM, Ralph <[EMAIL PROTECTED]> wrote: > > I'm trying to install django for the first time. > > I've read through at least 3 tutorials on how to install django and by > using parts of all three I managed to get the django files installed, > but I followed this command >

Trying to install django

2008-07-15 Thread Ralph
I'm trying to install django for the first time. I've read through at least 3 tutorials on how to install django and by using parts of all three I managed to get the django files installed, but I followed this command >>> import django I get Traceback File "", line 1, in ImportEr

Don't see form errors in template

2008-07-15 Thread Florencio Cano
Hello, I have a model Investor associated with a model User. Now I'm implementing the registration form. I want to store the name of the Investor in the Investor model and the rest of information in the User model. So I have username, password, name and email. I have a registration form in order t

Re: Request object in template HTML

2008-07-15 Thread Eric Abrahamsen
On Jul 15, 2008, at 9:55 PM, Nazmi ZORLU wrote: > Hi, > > I wonder if I can access request object in html template or absolute > page url that currently rendering. If you're not using generic views, you can pass "context_instance=RequestContext(request)" as a third argument to render_to_re

Re: Inquiry

2008-07-15 Thread Brett Hoerner
On Tue, Jul 15, 2008 at 8:40 AM, Marty Alchin <[EMAIL PROTECTED]> wrote: > Is it really > that bad a thing that users are in control of how they use your web > site? Exactly. Users can change the URL more easily than they can delete a cookie, so that one is effectively out (for his criteria). A

Request object in template HTML

2008-07-15 Thread Nazmi ZORLU
Hi, I wonder if I can access request object in html template or absolute page url that currently rendering. Thanks, Nazmi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Help with Forms (Dynamic Fields)

2008-07-15 Thread Srik
Hi Djangoers, I'm trying to generate a form dynamically using MyForm (Form class), but I'm stuck with validating or populating data. Form Class, View and template Code here: http://dpaste.com/65080/ (not too many lines I guess :) ) Good thing is I can see form (generating dynamically, based on

Re: Site wide date format

2008-07-15 Thread Adam Peacock
Thank you for the quick response - I think I'm going to go with the custom filter for maximum flexability On Jul 15, 9:25 am, "Brett Hoerner" <[EMAIL PROTECTED]> wrote: > On Tue, Jul 15, 2008 at 8:14 AM, Adam Peacock <[EMAIL PROTECTED]> wrote: > > Is this possible? > > Not with the current date

Re: Inquiry

2008-07-15 Thread Marty Alchin
On Mon, Jul 14, 2008 at 8:48 PM, Kadusale, Myles <[EMAIL PROTECTED]> wrote: > I don't want to use cookies because they can be disabled by the user. The alternatives I'm aware of are: * recording the session ID directly in the URL of every page, which just opens you up[1] to all sorts of problems

Re: Site wide date format

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 8:14 AM, Adam Peacock <[EMAIL PROTECTED]> wrote: > > I'm looking for a consistent way to format dates across my site, > without having to put the format into every template. Is it possible > to set a default date format for the "date" filter? For example, I > want {{ var.

Re: .pyc files not being created

2008-07-15 Thread Graham Dumpleton
On Jul 15, 8:29 am, blis102 <[EMAIL PROTECTED]> wrote: > Hey all, > > On my Ubuntu server with Apache2 +mod_python, I cant seem to get > the .py files to compile like they should (I see no .pyc files in my > "src" folder like I do locally). I believe I have proper permissions > set (775), but am

Re: Site wide date format

2008-07-15 Thread Brett Hoerner
On Tue, Jul 15, 2008 at 8:14 AM, Adam Peacock <[EMAIL PROTECTED]> wrote: > Is this possible? Not with the current date filter. You could make your own templatetag that just wraps the existing one, though. http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-tags

Re: how to use PythonAuthzHandler with django?

2008-07-15 Thread Graham Dumpleton
FWIW, authen/authz for Apache is much easier done in mod_wsgi. See: http://code.google.com/p/modwsgi/wiki/AccessControlMechanisms I have given up trying to help people with mod_python authen/authz because it is such a PITA. :-) Graham On Jul 15, 9:29 pm, "Viktor Nagy" <[EMAIL PROTECTED]> wro

Re: Inquiry

2008-07-15 Thread Brett Hoerner
On Mon, Jul 14, 2008 at 7:48 PM, Kadusale, Myles <[EMAIL PROTECTED]> wrote: > I don't want to use cookies because they can be disabled by the user. Can you name a method of maintaining a session can't be altered or changed by the user? Brett --~--~-~--~~~---~--~~

Site wide date format

2008-07-15 Thread Adam Peacock
I'm looking for a consistent way to format dates across my site, without having to put the format into every template. Is it possible to set a default date format for the "date" filter? For example, I want {{ var.date|date }} to format to {{ var.date|date:"l, F j Y" }} unless I specify otherwise

Re: wsgi and os.environ

2008-07-15 Thread Graham Dumpleton
On Jul 15, 9:54 pm, "Ian Lawrence" <[EMAIL PROTECTED]> wrote: > Hi, > I am experimenting with wsgi. I saw that this can be one way to enable it: > > os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' > > this seems a little strange to me setting something global to your > process. Is this be

Re: Setting the time on a datetimefield

2008-07-15 Thread Arien
On Tue, Jul 15, 2008 at 7:25 AM, Tim Sawyer <[EMAIL PROTECTED]> wrote: > In my form I have: > > datetime = > forms.DateField(widget=forms.TextInput({'class' : > 'date-pick'}),label="Available > date") > > yet it's a DateTimeField in the model. Why not use a DateTimeField in your form and change

Re: delete or update a model

2008-07-15 Thread titaniumlou
If you're talking about modifying your model definitions and then having those changes present in the backend database schema I don't believe you'll be able to do that with Django automatically but you can do it manually Start with the section titled "Making Changes to a Database Schema" on this

  1   2   >