Re: DB record retrieval from every N minutes

2008-10-15 Thread Thomas Guettler
grahamu schrieb: > I'd like to find an efficient method to retrieve a list of Django DB > records (model has a DateTimeField `timestamp`) between datetime > 'start' and datetime 'end' with a few conditions. First, we're looking > for a record once every 'interval' minutes. Second, I only want a >

Custom template tag problem: "No module named models"

2008-10-15 Thread Chris Amico
I have a simple bookmarks model based on the one in James Bennett's http://code.google.com/p/cab/source/browse/trunk/models.py? r=130">Cab application. I'm using a generic relation so it can live in its own app and a user can bookmark any object on the site (I'm planning on reusing this app on a c

Re: How to pass a string to a custom filter?

2008-10-15 Thread Mirto Silvio Busico
Well, a little step ahead: the filter receives an empty string. In the template the line: {{ request.path|dovesono }} passes to the "dovesono" filter a string with length 0. For completeness: The template: === {% extends

Re: How to pass a string to a custom filter?

2008-10-15 Thread bruno desthuilliers
On 15 oct, 09:40, Mirto Silvio Busico <[EMAIL PROTECTED]> wrote: > Well, a little step ahead: the filter receives an empty string. > > In the template the line: > {{ request.path|dovesono }} > > passes to the "dovesono" filter a string with length 0. > And what do you get *without* the filter

ImageField always invalid

2008-10-15 Thread Gollum
Here's my simple form: class AvatarForm(forms.Form): """Form for uploading avatars""" avatar = forms.ImageField() and here's the view that processes it: def avatar(request): """View to process avatar uploads""" import pdb; pdb.set_trace() if request.metho

Re: How to pass a string to a custom filter?

2008-10-15 Thread Malcolm Tredinnick
On Wed, 2008-10-15 at 09:40 +0200, Mirto Silvio Busico wrote: > In the template the line: > {{ request.path|dovesono }} > > passes to the "dovesono" filter a string with length 0. Let's start with the reasonable simplifying assumption that filters aren't totally broken in Django. So argum

Re: How to pass a string to a custom filter?

2008-10-15 Thread Mirto Silvio Busico
bruno desthuilliers ha scritto: > On 15 oct, 09:40, Mirto Silvio Busico <[EMAIL PROTECTED]> wrote: > >> Well, a little step ahead: the filter receives an empty string. >> >> In the template the line: >> {{ request.path|dovesono }} >> >> passes to the "dovesono" filter a string with length 0

Re: Custom template tag problem: "No module named models"

2008-10-15 Thread bruno desthuilliers
On 15 oct, 08:45, Daniel Roseman <[EMAIL PROTECTED]> wrote: (snip otherwise sound advises) > although I would also > recommend using full paths when importing (ie from > projectname.bookmarks.models). No. *Don't*. If you do so, imports will break when renaming the directory or trying to reuse

Re: check if request.url is a known string

2008-10-15 Thread pength
Maybe you can try {% ifequal request.META.PATH_INFO "/ricerca/" %}, but I think a templatetag will do this better. ;) On Oct 14, 3:53 pm, Alessandro <[EMAIL PROTECTED]> wrote: > I have a menu with a class="active" to insert when a page is loaded. > > I am searching a way to put this class="active

Re: Making queries guide, incomplete code.

2008-10-15 Thread bruno desthuilliers
On 15 oct, 01:57, KillaBee <[EMAIL PROTECTED]> wrote: > On Oct 14, 4:52 pm, bruno desthuilliers > (snip) > Check, I have read the lovely guide, and Didn't have to know real > Python until now. IOW : copy/paste, programming by accident, and ask other people to do your homework for you ? Yes, fine

login() logs in but somehow the login script overlaps all other Templates and Methodes

2008-10-15 Thread Stas
As mentioned in the title he logs in but blocks the rest of the methods. I also user @login_required in one of my view methods. But the login method even blocks the methods without @login_required. I´m trying for days now and can´t find my error. I created the project with a 1.1 alpha version of d

Re: Custom template tag problem: "No module named models"

2008-10-15 Thread Malcolm Tredinnick
On Wed, 2008-10-15 at 01:08 -0700, bruno desthuilliers wrote: [...] > FWIW, I just don't understand why each an every example in the > Django's manual insists on using this projectname.appname scheme. "Insists" is a rather strong word, since nowhere does it say "do this or else". Also, out of al

Re: Making queries guide, incomplete code.

2008-10-15 Thread bruno desthuilliers
On 15 oct, 13:09, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: (snip) > Ok - that's enough of that sort of tone. Yes, Killabee would be well > advised to read the fine manual, but there is no need to be rude while > asking him/her to do so. If you don't want to answer his/her > questions, wa

Re: Debugging with PyDev

2008-10-15 Thread Karen Tracey
On Wed, Oct 15, 2008 at 6:16 AM, Henrik Rediin <[EMAIL PROTECTED]> wrote: > Hi > > I'm new to Django and Python, but not to web development. > In my quest to create the best possible development environment, I've > installed Eclipse, PyDev and PyDev extensions on my windows machine. > Everything s

Re: how to assign a value to a model object field

2008-10-15 Thread Adi Jörg Sieker
Lenny wrote: > Hi! > How can I assign a value to a model object field where the field name > in a string? > Just like any other object as far as I know. setattr(obj, fieldname, value) adi --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Generating a file from lots of data

2008-10-15 Thread bruno desthuilliers
On 15 oct, 15:19, David Reynolds <[EMAIL PROTECTED]> wrote: > On 15 Oct 2008, at 1:00 pm, bruno desthuilliers wrote: > > > Did you profile to spot where the bottleneck really is? Not tested but > > here are a couple links on the topic: > >http://www.djangosnippets.org/snippets/186/ > >http://cod

Re: Django server crashes without error

2008-10-15 Thread ccpn
On Oct 15, 1:08 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Oct 15, 6:22 pm, ccpn <[EMAIL PROTECTED]> wrote: > > > We are building a django site that involves uploading and processing > > of files. We have found that in some instances the server quits after > > starting the upload proce

Re: Making queries guide, incomplete code.

2008-10-15 Thread KillaBee
On Oct 15, 6:25 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 15 oct, 13:09, "Russell Keith-Magee" <[EMAIL PROTECTED]> > wrote: > (snip) > > > Ok - that's enough of that sort of tone. Yes, Killabee would be well > > advised to read the fine manual, but there is no need to be rude while

Using Tutorial

2008-10-15 Thread maumir
I'm to start using the tutorial but during the steps about 'Writing your first Django app, part 1', specifically in 'Activating models' the command: ' python manage.py sql polls' produces: ' Error: No module named MySite' 'why is it happen? My installation of django is with SO MS VISTA business

Re: how to assign a value to a model object field

2008-10-15 Thread Christian Joergensen
Lenny wrote: > Hi! > How can I assign a value to a model object field where the field name > in a string? As with any other python object, you can use setattr: setattr(instance, "property", "value") Regards, -- Christian Joergensen http://www.technobabble.dk --~--~-~--~~--

Re: Using Tutorial

2008-10-15 Thread Keith Eberle
Did you name your project "MySite" or "mysite". There is a difference... keith On Wed, Oct 15, 2008 at 10:55 AM, maumir <[EMAIL PROTECTED]> wrote: > > I'm to start using the tutorial but during the steps about 'Writing > your first Django app, part 1', specifically in 'Activating models' > th

Re: Non-Programmer Help: filter_insterface error?

2008-10-15 Thread David
Thank you Karen. I've gotten a little further on this, here is my new error after downgrading to 0.96.3: [EMAIL PROTECTED]:/usr/local/surftrackr# ./manage.py syncdb Error: Couldn't install apps, because there were errors in one or more models: surftrackr.httpauth: __init__() got an unexpected ke

Re: RESTful API or SOAP in pre-magic

2008-10-15 Thread Dj Gilcrease
http://code.google.com/p/django-rest-interface/ Might be helpful to you Dj Gilcrease OpenRPG Developer ~~http://www.openrpg.com On Tue, Oct 14, 2008 at 10:03 PM, James Bennett <[EMAIL PROTECTED]> wrote: > > On Tue, Oct 14, 2008 at 10:39 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> Thank

Re: Non-Programmer Help: filter_insterface error?

2008-10-15 Thread David
Can you tell me what the last Revision from the SVN that supported the filter_interface. The Surftrackr docs specifically state that 0.96 is not support and to use the latest svn. This is in April of 2008. On Oct 14, 11:25 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 15, 2008 at 1:

Django events

2008-10-15 Thread Daniele Procida
Is there a good single source of information about Django-related events (training, workshops, conferences, wahtever)? I think a calendar of such things at would be handy... Thanks, Daniele --~--~-~--~~~---~--~~ You received this me

Re: Non-Programmer Help: filter_interface error?

2008-10-15 Thread Steve Holden
This is another incompatible change: older versions used "maxlength". Have you examined http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges This is there to help with situation like yours. regards Steve David wrote: > Thank you Karen. > > I've gotten a little further on this, h

Re: Non-Programmer Help: filter_insterface error?

2008-10-15 Thread Karen Tracey
On Wed, Oct 15, 2008 at 11:15 AM, David <[EMAIL PROTECTED]> wrote: > > Can you tell me what the last Revision from the SVN that supported the > filter_interface. > The Surftrackr docs specifically state that 0.96 is not support and to > use the latest svn. > This is in April of 2008. > Scanning t

Re: Problems serving static files with Apache and mod_python

2008-10-15 Thread Javi
I do tests using development server and everything is OK. But now, the app must be available to the users. If I musn't match the content static folder with a url, how must I rewrite the href to static file? I mean, using the development server the href to a css file is as follow: . How must I chan

Re: Data too long for column problem

2008-10-15 Thread zjffdu
finally I have resolved this problem. I changed the setting of mysql , change the character setting from latin1 to utf8. On Oct 15, 8:56 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-10-14 at 06:12 -0700, zjffdu wrote: > > but I found that I can not even store one Chinese wo

how to assign a value to a model object field

2008-10-15 Thread Lenny
Hi! How can I assign a value to a model object field where the field name in a string? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegro

Re: problem with i18n (blocktrans)

2008-10-15 Thread pihentagy
Ok, I have figured out. You should never use non-unix-style line-endings in your templates, because blocktrans will not work :-/ On Oct 15, 11:42 am, pihentagy <[EMAIL PROTECTED]> wrote: > Hi all! > > Can somebody please tell me what's wrong with my template and/or po > file? > > trans tags work

Re: Non-Programmer Help: filter_insterface error?

2008-10-15 Thread David
THANK YOU THANK YOU THANK YOU THANK YOU 7388 worked perfectly! On Oct 15, 8:40 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 15, 2008 at 11:15 AM, David <[EMAIL PROTECTED]> wrote: > > > Can you tell me what the last Revision from the SVN that supported the > > filter_interface. > >

Re: how to assign a value to a model object field

2008-10-15 Thread Daniel Roseman
On Oct 15, 12:54 pm, Lenny <[EMAIL PROTECTED]> wrote: > Hi! > How can I assign a value to a model object field where the field name > in a string? setattr(model_name, field_name, value) -- DR. --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Generating a file from lots of data

2008-10-15 Thread David Reynolds
On 15 Oct 2008, at 1:00 pm, bruno desthuilliers wrote: > Did you profile to spot where the bottleneck really is? Not tested but > here are a couple links on the topic: > http://www.djangosnippets.org/snippets/186/ > http://code.djangoproject.com/wiki/ProfilingDjango I've been trying the profili

Query over multivalue relationships

2008-10-15 Thread Katja Loeffler
Hi, I am relatively new to Django and I have a small problem making a query over the following Models ... class GeographicTemporalCoverage(models.Model): beginning_temporal_coverage_date = models.DateField() ending_temporal_coverage_date = models.DateField() class Coverage(models

App with time zones

2008-10-15 Thread Mozey
Hello everybody, My application requires me to store events from all over the world. Which would mean that i need the time that an event starts, up to the time that an event ends. So an example, May 3rd, 3:40 PM May 3rd, 3:50 PM GMT +4 I have a quick table with all of the countries/regions/subr

Debugging with PyDev

2008-10-15 Thread Henrik Rediin
Hi I'm new to Django and Python, but not to web development. In my quest to create the best possible development environment, I've installed Eclipse, PyDev and PyDev extensions on my windows machine. Everything seems to work, but debugging is not working proberly - or maybe I'm not using it right.

Re: Custom template tag problem: "No module named models"

2008-10-15 Thread Chris Amico
The templatetag file is indeed called bookmarks.py. I thought of that, tried renaming it as bookmark_tags.py, and got the same error. I'll add that the bookmarks app lives on my python path, not in any particular project, since I'm trying to make this as reusable as possible. At one point, I trie

Re: How to pass a string to a custom filter?

2008-10-15 Thread Daniel Roseman
On Oct 15, 9:29 am, Mirto Silvio Busico <[EMAIL PROTECTED]> wrote: > bruno desthuilliers ha scritto:> On 15 oct, 09:40, Mirto Silvio Busico > <[EMAIL PROTECTED]> wrote: > > >> Well, a little step ahead: the filter receives an empty string. > > >> In the template the line: > >>     {{ request.path

Re: How to pass a string to a custom filter?

2008-10-15 Thread Malcolm Tredinnick
On Wed, 2008-10-15 at 10:43 +0200, Mirto Silvio Busico wrote: > As said in my previous message you are right: I don't have a valid reques. > So I'm sure I'm doing something wrong. > Here is what I'm doing: > > In zsite/ancore/url.py: > (r'^$', 'zsite.ancore.views.indice'), > > In zsite/

Whether to use Model Manager class for DAO

2008-10-15 Thread Info Cascade
Hi -- I am new to Django programming, and need a few tips on how to accomplish something. What I need is to have a model that provides a data access layer to multiple databases. Something like what I have pseudocoded below. The idea is to just use the DataAccess layer (class) to access various

Re: App with time zones

2008-10-15 Thread Katja Loeffler
> I found couple of googlecode projects that seem like they may help me, > but they seem to be SERIOUSLY pre alpha!. > > Any pointers? or ideas on how i can go about this? anything would > help. When I had to deal with time zones once I used pytz for time zone conversions. http://pytz.sourcefor

[SOLVED] Re: How to pass a string to a custom filter?

2008-10-15 Thread Mirto Silvio Busico
Many thanks to all! Adding the django.core.context_processors.request solves the problem. For memory: In settings.py: TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n",

Django server crashes without error

2008-10-15 Thread ccpn
We are building a django site that involves uploading and processing of files. We have found that in some instances the server quits after starting the upload process, leaving us with a blank screen. The problem is that Django is not reporting any errors, and we have no clue what causes it. The pr

Re: How to pass a string to a custom filter?

2008-10-15 Thread Mirto Silvio Busico
As said in my previous message you are right: I don't have a valid reques. So I'm sure I'm doing something wrong. Here is what I'm doing: In zsite/ancore/url.py: (r'^$', 'zsite.ancore.views.indice'), In zsite/ancore/views.py: @login_required def indice(request): xxx=requ

Re: Query over multivalue relationships

2008-10-15 Thread Daniel Roseman
On Oct 15, 5:32 pm, Katja Loeffler <[EMAIL PROTECTED]> wrote: > Hi, > > I am relatively new to Django and I have a small problem making a query > over the following Models ... > > class GeographicTemporalCoverage(models.Model): >    beginning_temporal_coverage_date = models.DateField() >    ending

Django server crashes without reporting an error

2008-10-15 Thread ccpn
We are building a Django site that involves multiple file uploads, that are processed by separate python scripts. We have noticed that sometimes after clicking a submit button for uploading files the server quits without reporting an error and the screen goes blank. The problem is not in the files

Re: manage.py tab completion

2008-10-15 Thread Daniel Roseman
On Oct 14, 11:49 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Depending on your site's setup, there is a variety of extra manage.py > > commands that could be available. Is it possible to set up tab > > completion on these commands? for example: > > > ./manage.py syn

Re: login() logs in but somehow the login script overlaps all other Templates and Methodes

2008-10-15 Thread Stas
I found my mistake. I forgot the $ in the Url patterns :(. Well but still smthg realy strange going on. Now im able to redirect to other methods but those wich have login requiered have the ussername and Password form <.< even if the form for login isn´t declared in any template. So my forms neve

Generating a file from lots of data

2008-10-15 Thread David Reynolds
Hi, I have the requirement to output a lot of data (17,000 rows) as a CSV. I am using the templated system as required in the docs [0]. The generation of the CSV seems to be taking a lot of time to do (about 5 + minutes). Are there any ways I can tune this to make it run a bit quicker? If

Re: Django server crashes without error

2008-10-15 Thread Graham Dumpleton
On Oct 15, 6:22 pm, ccpn <[EMAIL PROTECTED]> wrote: > We are building a django site that involves uploading and processing > of files. We have found that in some instances the server quits after > starting the upload process, leaving us with a blank screen. The > problem is that Django is not re

Re: Query over multivalue relationships

2008-10-15 Thread Katja L.
> DataSet.objects.select_related().filter(coverage__geo_temp_coverage__ending_temporal_coverage_date__year__lt=max_year).order_by('dataset_id_nr') Thanks a lot :)! This helps more or less ;), because now I get a Field Error I don't understand ... "Join on field 'ending_temporal_coverage_date' not

problem with i18n (blocktrans)

2008-10-15 Thread pihentagy
Hi all! Can somebody please tell me what's wrong with my template and/or po file? trans tags work fine, but blocktrans isn't translated. http://dpaste.com/hold/84553/ thanks pihentagy --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: How to get additional dynamic data into ModelChoiceField and ModelMultipleChoiceField?

2008-10-15 Thread creecode
Hello Alexis, I don't have much to add other than I was in a similar situation to yours. I needed to generate an options choice list with radio buttons for a form on the fly and discovered the "dynamic choices in a ChoiceField" approach as well. It seems to be working OK. Make sure you populat

Re: Custom template tag problem: "No module named models"

2008-10-15 Thread RyanP
Seems like the problem's got to be with the "from bookmarks.models import Bookmark" line. The "No module named models" part of your error message suggests that Django doesn't know about your bookmarks/models.py ... if that app is on your Pyton path, any chance that it's just not listed in your IN

Re: Custom template tag problem: "No module named models"

2008-10-15 Thread Daniel Roseman
On Oct 15, 7:38 am, Chris Amico <[EMAIL PROTECTED]> wrote: > I have a simple bookmarks model based on the one in James Bennett's href="http://code.google.com/p/cab/source/browse/trunk/models.py? > r=130">Cab application. I'm using a generic relation so it can > live in its own app and a user can

Re: Populating form from existing model

2008-10-15 Thread Daniel Roseman
On Oct 15, 2:22 am, Adam <[EMAIL PROTECTED]> wrote: > I have a model called "myRegion" defined like so: > > class myRegion(models.Model): >         area = models.CharField(max_length=50, blank=False) >         state = models.CharField(max_length=2, blank=False) > >         def __unicode__(self): >

Re: Making queries guide, incomplete code.

2008-10-15 Thread Russell Keith-Magee
On Wed, Oct 15, 2008 at 4:19 PM, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > > On 15 oct, 01:57, KillaBee <[EMAIL PROTECTED]> > wrote: >> On Oct 14, 4:52 pm, bruno desthuilliers >> > (snip) >> Check, I have read the lovely guide, and Didn't have to know real >> Python until now. > > IOW : cop

Re: Generating a file from lots of data

2008-10-15 Thread bruno desthuilliers
On 15 oct, 13:29, David Reynolds <[EMAIL PROTECTED]> wrote: > Hi, > > I have the requirement to output a lot of data (17,000 rows) as a > CSV. I am using the templated system as required in the docs [0]. The > generation of the CSV seems to be taking a lot of time to do (about 5 > + minutes). > >

Re: Custom template tag problem: "No module named models"

2008-10-15 Thread Chris Amico
Wish it were that easy. The app is installed, and it works everywhere else. If I take out the {% load bookmarks %} from the template, the rest of the app works fine. I have a view that bookmarks an object, and it checks if a user has bookmarked that object first. This is how I did it in the view

Re: Query over multivalue relationships

2008-10-15 Thread Daniel Roseman
On Oct 15, 7:11 pm, "Katja L." <[EMAIL PROTECTED]> wrote: > > DataSet.objects.select_related().filter(coverage__geo_temp_coverage__ending_temporal_coverage_date__year__lt=max_year).order_by('dataset_id_nr') > > Thanks a lot :)! > This helps more or less ;), because now I get a Field Error I don't

Re: Query over multivalue relationships

2008-10-15 Thread Katja L.
> Hmm, that's weird. Does it work if you remove the select_related()? No, it doesn't ... I've made a workaround like this ... ds = DataSet.objects.select_related().filter(coverage__geo_temp_coverage__ending_temporal_coverage_date__lte=datetime.date(int(max_year), 12,31)).order_by('dataset_id_nr'

ifequal doesn't like spaces?

2008-10-15 Thread Frank Peterson
I have something like the following {% ifequal flatpage.title "Special Reports" %} http://example.com/icon_specialreports.png"; /> {% endifequal %} I get the error 'ifequal' takes two arguments so it doesn't like the fact that "Special Reports" has a space in it. Is there a way around t

Deploy application in bytecode

2008-10-15 Thread [EMAIL PROTECTED]
Hi, i'm new django user. I have a question, if i want to hidden my source code, which way i do this? I think about deploy the bytecode, this is correct? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

assigning variables in templates

2008-10-15 Thread bmt
hi, i'm trying to implement a dynamic table in django. every column of the table is coded as a python object and i want to pass a list of these objects to the template as the context. every object has a method which runs a rather expensive query on the database and returns a list which can be emp

Model design decision

2008-10-15 Thread nerdydork
I would like to get some feedback on a design decision I need to make. I’m writing an online document management solution. We currently have an application written in PHP, I’m rewriting it using python/django. I have the following models: • Folder • Field • Document A folder wil

Re: Deploy application in bytecode

2008-10-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi, i'm new django user. > I have a question, if i want to hidden my source code, which way i do > this? > > I think about deploy the bytecode, this is correct? > You could deploy only the .pyc files, yes. But unless you are distributing web applications for other peo

ImportError: Could not import settings 'settings'

2008-10-15 Thread Dana
Hey All, Im getting the error "ImportError: Could not import settings 'setting'" when running my Django project on a SliceHost server using Apache/mod_python. Here is my vhost file (located in /etc/apache2/sites-available/ myproject): ServerName www.example.com ServerAlias nahnooh.com

Is there a way to generate an API doc from docstrings?

2008-10-15 Thread barbara shaurette
I could swear that, pre 1.0 release, I came across a page on auto- generating documentation from docstrings, but I can't find it in the Django documentation anymore. Did a module that did that ever exist? Or am I crazy? Wait, don't answer that. I've also seen some old references to docstrings

onSubmit() on Model form not working as expected

2008-10-15 Thread Olhe
I am trying to execute the onsubmit code in a form on my model template. But it's not running as I expect. Could anyone see what is wrong? Isn't this form that is submited when Save [en-us] is pressed? change_form.html

Re: Django server crashes without error

2008-10-15 Thread Graham Dumpleton
On Oct 16, 1:34 am, ccpn <[EMAIL PROTECTED]> wrote: > On Oct 15, 1:08 pm, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > > > On Oct 15, 6:22 pm, ccpn <[EMAIL PROTECTED]> wrote: > > > > We are building a django site that involves uploading and processing > > > of files. We have found that in

Re: Problems serving static files with Apache and mod_python

2008-10-15 Thread bruno desthuilliers
On 15 oct, 17:42, Javi <[EMAIL PROTECTED]> wrote: > I do tests using development server and everything is OK. But now, the > app must be available to the users. If I musn't match the content > static folder with a url, how must I rewrite the href to static file? The way you should have done it

How to parse an XML file with django.

2008-10-15 Thread JFQueralt
Hi, there. Being a newbie in django maybe I am just missing something but I don´t seem to find any information about how to retrieve an XML file and parse it from django. My goal is to save some pieces of information in an external file and then load them into my templates if needed. Obviously,

rename or renaming a Django application

2008-10-15 Thread coderb
hi, being a newbie, this may be a stupid question: I've created an application using: manage.py startapp myapp I've done some coding on the project and within myapp but now I want to rename myapp to a more appropriate name. of course I cant simply rename the generated application directory n

get_object_or_404 error

2008-10-15 Thread jseleuco
Hi all, Just started today with the Python, Django and Google app engine and having some novice problems as well :) def detail(request, poll_id): p = get_object_or_404(Poll, pk=poll_id) return render_to_response('polls/detail.html', {'poll': p}) The get_object_or_404 method is crashin

Re: How to parse an XML file with django.

2008-10-15 Thread James Bennett
On Wed, Oct 15, 2008 at 5:27 PM, JFQueralt <[EMAIL PROTECTED]> wrote: > Being a newbie in django maybe I am just missing something but I don´t > seem to find any information about how to retrieve an XML file and > parse it from django. "Django" does not have any XML-parsing libraries, because Dja

Re: Is there a way to generate an API doc from docstrings?

2008-10-15 Thread James Bennett
On Wed, Oct 15, 2008 at 4:52 PM, barbara shaurette <[EMAIL PROTECTED]> wrote: > I could swear that, pre 1.0 release, I came across a page on auto- > generating documentation from docstrings, but I can't find it in the > Django documentation anymore. The admin would, once upon a time, display the

Re: rename or renaming a Django application

2008-10-15 Thread Tim Chase
> I've done some coding on the project and within myapp > > but now I want to rename myapp to a more appropriate name. > > of course I cant simply rename the generated application directory > name, I would also need to change all references to the myapp. > > So, then question is, do I need to d

Re: ifequal doesn't like spaces?

2008-10-15 Thread Karen Tracey
On Wed, Oct 15, 2008 at 4:02 PM, Frank Peterson <[EMAIL PROTECTED]>wrote: > > I have something like the following > > {% ifequal flatpage.title "Special Reports" %} >http://example.com/icon_specialreports.png"; /> > {% endifequal %} > > I get the error > 'ifequal' takes two arguments > so

Re: How to parse an XML file with django.

2008-10-15 Thread Russell Keith-Magee
On Thu, Oct 16, 2008 at 6:27 AM, JFQueralt <[EMAIL PROTECTED]> wrote: > > Hi, there. > > Being a newbie in django maybe I am just missing something but I don´t > seem to find any information about how to retrieve an XML file and > parse it from django. Remember - Django isn't a programming langua

Re: assigning variables in templates

2008-10-15 Thread Tim Chase
> i have to check the method's return value first with an 'if' > tag than run the query again for the 'for' loop. this doubles > the load on the db what i don't like, not to mention that the > two queries may return different lists. Django's ORM should cache your query results, though it may need

Re: Is there a way to generate an API doc from docstrings?

2008-10-15 Thread barbara shaurette
Ah, thank you - admindocs is probably all I need, if not I'll take a look at epydoc. :) On Oct 15, 4:25 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 15, 2008 at 4:52 PM, barbara shaurette <[EMAIL PROTECTED]> wrote: > > I could swear that, pre 1.0 release, I came across a page on

Re: Deploy application in bytecode

2008-10-15 Thread [EMAIL PROTECTED]
Hi steve. I know if i have only the .pyc files i don't see the source. But then, if upload to the server only the .pyc and my application work correctly, then this solve my problem. Exists programs which convert .py files in .pyc? I want this because in the situation when i have only the .py fil

Re: Django events

2008-10-15 Thread Malcolm Tredinnick
On Wed, 2008-10-15 at 16:35 +0100, Daniele Procida wrote: > Is there a good single source of information about Django-related events > (training, workshops, conferences, wahtever)? > > I think a calendar of such things at would > be handy... Such things are an *enor

Re: problem with i18n (blocktrans)

2008-10-15 Thread Malcolm Tredinnick
On Wed, 2008-10-15 at 08:52 -0700, pihentagy wrote: > Ok, I have figured out. > > You should never use non-unix-style line-endings in your templates, > because blocktrans will not work :-/ Hmm. That doesn't sound very convenient, since it basically means you can't use a normal Windows editor. I

Re: ImportError: Could not import settings 'settings'

2008-10-15 Thread Malcolm Tredinnick
On Wed, 2008-10-15 at 14:15 -0700, Dana wrote: > Hey All, > > Im getting the error "ImportError: Could not import settings > 'setting'" when running my Django project on a SliceHost server using > Apache/mod_python. > > Here is my vhost file (located in /etc/apache2/sites-available/ > myproject

Custom submit buttons on admin form

2008-10-15 Thread Delta20
What's the cleanest way to customize the submit buttons that appear on an admin change_form? If there's a way to override submit_row on change_form, that would be the simplest approach, I think, but I'm very much a django beginner so I would appreciate some guidance. To provide some context, here

Re: get_object_or_404 error

2008-10-15 Thread felix
you are doing it correctly for normal django. its something to do with the Poll model that you are getting from google app engine sorry I can't help more than that. -felix jseleuco wrote: > Hi all, > > Just started today with the Python, Django and Google app engine and > having some novice pr

Re: assigning variables in templates

2008-10-15 Thread Malcolm Tredinnick
On Wed, 2008-10-15 at 18:21 -0500, Tim Chase wrote: > > i have to check the method's return value first with an 'if' > > tag than run the query again for the 'for' loop. this doubles > > the load on the db what i don't like, not to mention that the > > two queries may return different lists. > >

Re: assigning variables in templates

2008-10-15 Thread bmt
thanks, I forgot to mention that these are raw sql queries (because of aggregates), so the ORM cache won't help me here, but at least now I understand the reasoning behind the design more. I used a similar workaround to that what you suggested, so i read the list out in the view and passed the li

Re: ifequal doesn't like spaces?

2008-10-15 Thread Malcolm Tredinnick
On Wed, 2008-10-15 at 19:39 -0400, Karen Tracey wrote: > On Wed, Oct 15, 2008 at 4:02 PM, Frank Peterson > <[EMAIL PROTECTED]> wrote: > > I have something like the following > > {% ifequal flatpage.title "Special Reports" %} > src="http://

Re: Query over multivalue relationships

2008-10-15 Thread Malcolm Tredinnick
On Wed, 2008-10-15 at 11:11 -0700, Katja L. wrote: > > DataSet.objects.select_related().filter(coverage__geo_temp_coverage__ending_temporal_coverage_date__year__lt=max_year).order_by('dataset_id_nr') > > Thanks a lot :)! > This helps more or less ;), because now I get a Field Error I don't > und

Re: rename or renaming a Django application

2008-10-15 Thread coderb
hi tim, thanks for the quick response. I will convert your bash commands to my (whisper) "windows" equivalents to manually rename all instances. I have tools like windows grep etc.. Doing batch renames, search replaces etc .. should be fine, although I'll be confirming before each change until I

html in feed description

2008-10-15 Thread felix
For either RSS and Atom feeds, I want to return html in the feed item's description: post_feed_description.html but the content including the CDATA tag is escaped: ... Re: Custom template tag problem: "No module named models"
this gets me every time. the error is yes because the template tag is called bookmarks.py and its inside a module called bookmarks.py rename it to bookmarks_tags.py ... and now DELETE THE DAMNED OLD bookmarks.pyc file ! python is still finding the old compiled file. its happened to me

Re: Deploy application in bytecode

[EMAIL PROTECTED] wrote: > Hi steve. > I know if i have only the .pyc files i don't see the source. > > But then, if upload to the server only the .pyc and my application > work correctly, then this solve my problem. > > Exists programs which convert .py files in .pyc? I want this because > in the

Re: How to get additional dynamic data into ModelChoiceField and ModelMultipleChoiceField?

Finally I got my code working by using an __init__ method in my class form to populate my ChoiceField fields as described in this post: http://groups.google.com/group/django-users/browse_thread/thread/98bde0a6d818e627 I also tried Malcolm's suggestion: http://www.pointy-stick.com/blog/2007/03/2

Re: mptt + contrib.comments?

So, I've gotten a bit of code up and running so you can see a little of what I have. I've pared everything down to just focus on the MPTT bit: class Comment(models.Model): #core fields text = models.TextField(blank = "True", null = "True") #left and right nodes for traversal le

Re: ImportError: Could not import settings 'settings'

Hi Malcolm, First off, thanks for taking the time to help out. I had an inkling that it was a permission problem, so I decided to remove everything and start again. After creating a new user and creating the folders as that user (lets call the user "bob") I still get the same issue. I have upload

Re: ImportError: Could not import settings 'settings'

On Wed, 2008-10-15 at 19:20 -0700, D. Woodman wrote: > Hi Malcolm, > > First off, thanks for taking the time to help out. > > I had an inkling that it was a permission problem, so I decided to > remove everything and start again. After creating a new user and > creating the folders as that user

  1   2   >