Re: redirect after post caches anchor?

2009-09-12 Thread Tiago Serafim
Hi Margie, I misunderstood you first post. What I said is valid, but it doesn't relate to your problem. Now that I get it: FF scrolls back to the same position after a reload. I don't know how to work around this issue unless you return a anchor "#top"(like you did with the another one) and add

Re: redirect after post caches anchor?

2009-09-12 Thread Margie
Hi Tiago, Thanks very much for your response. So is there a way I can tell the client that I don't want to retain the same anchor? IE, tell the client to act as it would act if the client had initiated a new GET? Where would I find documentation on this? Or not necessarily doc but just someth

Re: docstring format documentation for the admin doc contrib?

2009-09-12 Thread Andrew R
Thanks, that is what I was looking for. I also found this: http://docutils.sourceforge.net/docs/user/rst/quickref.html -Andrew On Sep 12, 9:26 pm, Tiago Serafim wrote: > Hi, > > These docs are in ReST (ReStructured Text) format, and each text file > > > corresponds to a Web page on the officia

Re: docstring format documentation for the admin doc contrib?

2009-09-12 Thread Tiago Serafim
Hi, These docs are in ReST (ReStructured Text) format, and each text file > corresponds to a Web page on the official Django site. > source: http://docs.djangoproject.com/en/dev/faq/general/#how-can-i-download-the-django-documentation-to-read-it-offline On Sun, Sep 13, 2009 at 12:21 AM, Andrew

docstring format documentation for the admin doc contrib?

2009-09-12 Thread Andrew R
The built in templates and filters have formatted docstrings (``, ===, etc.). I don't see anywhere where this syntax is documented. Where can I find information on this. Example docstring: def yesno(value, arg=None): """ Given a string mapping values for true, false and (optionally) N

Re: ImageField anti-duplication

2009-09-12 Thread A. Rossi
I had not considered writing a custom Storage class. I may try that if there are no other alternatives. Any other ideas/solutions? On Sep 12, 5:31 am, vinilios wrote: > Have you read this ? > > http://docs.djangoproject.com/en/dev/howto/custom-file-storage/ > > haven't used any custom file stor

Re: redirect after post caches anchor?

2009-09-12 Thread Tiago Serafim
Hi, This is the expected, as HTTP clients doesn't pass the #anchors to the server. On Sat, Sep 12, 2009 at 10:20 PM, Margie Roginski wrote: > > I'm seeing some strange behavior related to anchors that I can't > really explain. I'm going to give an example of what I'm seeing and > I'm hoping th

Re: Query with left join?

2009-09-12 Thread Joshua Russo
On Sat, Sep 12, 2009 at 8:55 PM, Daniel Roseman wrote: > > On Sep 12, 9:53 pm, tom wrote: > > Hi, > > > > i want to produce a left-join query with the django orm. Can anybody > > help howto do the following query? > > > > SELECT S.value, D.value from data as S left join data as D on > > S.entry_i

Updating request.POST

2009-09-12 Thread koranthala
Hi, I have the following scenario. I am creating a custom admin page for one of the models. I am adding few extra fields. If the extra fields are set, then the user does not need to set the model fields. An example is given below: Model A: val1 models.ForeignKey(A1) val2 models.Fore

redirect after post caches anchor?

2009-09-12 Thread Margie Roginski
I'm seeing some strange behavior related to anchors that I can't really explain. I'm going to give an example of what I'm seeing and I'm hoping that someone can point me in the right direction. Let's say I do a post and my views.py code that services the post returns like this: return Ht

Re: html template usage

2009-09-12 Thread aftalavera
I mean like one HTML template like the ones you download from monstertemplates. On Sat, 2009-09-12 at 13:59 -0700, tom wrote: > What do you mean with "existing HTML template" ? > > > On 12 Sep., 21:19, aftalavera wrote: > > Hi there, > > > > All I need is a sample (if available) or a working e

Re: How to server static media secured by Django authentication

2009-09-12 Thread Graham Dumpleton
On Sep 13, 2:30 am, Jim Myers wrote: > I had looked at that page before, but had thought it only applied to > mod_python. > Does it also apply to mod_wsgi?  If so, the page could be made > clearer. It doesn't. Read instead: http://code.google.com/p/modwsgi/wiki/AccessControlMechanisms This

Re: Load Templates from outside TEMPLATE_DIRS

2009-09-12 Thread mviamari
The template in question is to format my test results, and I didn't want to have lump it in with the production templates, or have the template directory permanently attached to the TEMPLATE_DIR So instead I've just loaded a new settings file with a modified TEMPLATE_DIR before I do my tests. Wo

Complex Query Optimization

2009-09-12 Thread Phil
I am trying to minimize the database hits. Take this example... from django.contrib.auth.models import User class Group(models.Model): # a bunch of fields here user = models.ForeignKey(User, related_name="groups") class Member(models.Model): # a bunch of fields here user = model

Re: Query with left join?

2009-09-12 Thread Daniel Roseman
On Sep 12, 9:53 pm, tom wrote: > Hi, > > i want to produce a left-join query with the django orm. Can anybody > help howto do the following query? > > SELECT S.value, D.value from data as S left join data as D on > S.entry_id=D.entry_id; > > Cheers tom What's the point of this query? What are yo

Re: Return something specific on 404's on a particular path

2009-09-12 Thread Wiiboy
> If they upload the image, you likely have the name of the file in your > database.  Put a little IF statement in your templates.  If you find > the name of the image in the db/context, serve it up.  If you don't > find it, server up your default/placeholder image.  Does that not > work? Yup. -

Re: Can I dereference a field in the output of a filter?

2009-09-12 Thread W.P. McNeill
The with tag worked. Thanks. On Sep 12, 12:10 pm, Daniel Roseman wrote: > On Sep 12, 8:08 pm, "W.P. McNeill" wrote: > > > > > > > I have a view that renders a table.  The "table" object is a list > > rows, which are themselves lists of model objects.  These objects have > > a parameter called

Re: html template usage

2009-09-12 Thread tom
What do you mean with "existing HTML template" ? On 12 Sep., 21:19, aftalavera wrote: > Hi there, > > All I need is a sample (if available) or a working example on how to use > an existing HTML template into the Django template system. Am I on the > wrong track integrating both? > > Thanks --~-

Query with left join?

2009-09-12 Thread tom
Hi, i want to produce a left-join query with the django orm. Can anybody help howto do the following query? SELECT S.value, D.value from data as S left join data as D on S.entry_id=D.entry_id; Cheers tom --~--~-~--~~~---~--~~ You received this message because y

html template usage

2009-09-12 Thread aftalavera
Hi there, All I need is a sample (if available) or a working example on how to use an existing HTML template into the Django template system. Am I on the wrong track integrating both? Thanks --~--~-~--~~~---~--~~ You received this message because you are sub

Re: Can I dereference a field in the output of a filter?

2009-09-12 Thread Daniel Roseman
On Sep 12, 8:08 pm, "W.P. McNeill" wrote: > I have a view that renders a table.  The "table" object is a list > rows, which are themselves lists of model objects.  These objects have > a parameter called label. > > Inside the template > > {{ object.label }} > > render's an objects label and > > {

Re: How to invoke hasNoProfanities?

2009-09-12 Thread Daniel Roseman
On Sep 12, 5:26 pm, Angel Cruz wrote: > I use the contribs.comments module, and in its clean_comment method: > > if settings.COMMENTS_ALLOW_PROFANITIES == False: >             bad_words = [w for w in settings.PROFANITIES_LIST if w in > comment.lower()] >             if bad_words: >              

Can I dereference a field in the output of a filter?

2009-09-12 Thread W.P. McNeill
I have a view that renders a table. The "table" object is a list rows, which are themselves lists of model objects. These objects have a parameter called label. Inside the template {{ object.label }} render's an objects label and {{ row|first }} renders the first object in the row. I want

Re: Editors of choice

2009-09-12 Thread Haroldo Stenger
I, like Nicolay, am using emacs too, with some nice packages that I've found along the way. Rope is installed in my ubuntu, but I don't know how to really use it yet. I hope I do. Learning Emacs pays a lot , especially since Emacs 23.1 ... , some of my packages are new versions of CEDET, etc. best

Re: Make a bold row in a table

2009-09-12 Thread Daniel Roseman
On Sep 12, 3:12 pm, adelaide_mike wrote: > Django 1.0.2   In the following template I intend to make rows that > have an empty second column bold.  Hence trying 2 in row.  My syntax > is wrong due to inexperience with Python, and possibly my methodology > also. > > {% extends "base.html" %} > {%

app for user statistics of submissions/ activity/ etc ? app for geotagging?

2009-09-12 Thread pcrutch
is there an app out there that keeps track of user submissions / activity related to your models ? we want some sort of way of giving user feedback. whats the status of geotagging ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: How to server static media secured by Django authentication

2009-09-12 Thread Jim Myers
I had looked at that page before, but had thought it only applied to mod_python. Does it also apply to mod_wsgi? If so, the page could be made clearer. On Sep 11, 10:49 pm, Gabriel Gunderson wrote: > On Fri, Sep 11, 2009 at 3:03 PM, Jim Myers wrote: > > I have a requirement to serve static fil

Re: How to invoke hasNoProfanities?

2009-09-12 Thread Angel Cruz
I use the contribs.comments module, and in its clean_comment method: if settings.COMMENTS_ALLOW_PROFANITIES == False: bad_words = [w for w in settings.PROFANITIES_LIST if w in comment.lower()] if bad_words: The file is in: Python25\Lib

Re: Make a bold row in a table

2009-09-12 Thread Maksymus007
On Sat, Sep 12, 2009 at 4:12 PM, adelaide_mike wrote: > > Django 1.0.2   In the following template I intend to make rows that > have an empty second column bold.  Hence trying 2 in row.  My syntax > is wrong due to inexperience with Python, and possibly my methodology > also. > > {% extends "base.

Make a bold row in a table

2009-09-12 Thread adelaide_mike
Django 1.0.2 In the following template I intend to make rows that have an empty second column bold. Hence trying 2 in row. My syntax is wrong due to inexperience with Python, and possibly my methodology also. {% extends "base.html" %} {% block content %} Agent summary report The most recen

Re: Editors of choice

2009-09-12 Thread Mark Freeman
Mostly Netbeans for me, however I do tend to use VIM quite a bit. --~--~-~--~~~---~--~~ 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 unsubscrib

Re: Couple of basic Django questions

2009-09-12 Thread Mark Freeman
Dan, this link helped me a lot for using my stylesheet and images on the test server. http://docs.djangoproject.com/en/dev/howto/static-files/ Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Django and CouchDB

2009-09-12 Thread Suno Ano
Hi folks, I am too very fond of non-SQL databases (no fixed schema, built-in replication, built-in webserver, RESTful API, etc.). So far, in order to use Django with CouchDB here is what I have come across so far - http://lethain.com/entry/2008/aug/18/an-introduction-to-using-couchdb-with-djan

Re: ImageField anti-duplication

2009-09-12 Thread vinilios
Have you read this ? http://docs.djangoproject.com/en/dev/howto/custom-file-storage/ haven't used any custom file storage yet but maybe using a custom file- storage with a dummy save method when file exists is what you need. On Sep 12, 1:43 pm, "A. Rossi" wrote: > I have an application where

Re: Generic view 'archive_year' not working

2009-09-12 Thread Matthew
See thread http://groups.google.com/group/django-users/browse_thread/thread/f6f78545989cfbab On Aug 9, 1:31 pm, Matthew wrote: > I am using Django's generic views to create a blog site.  The > templates I created, entry_archive_day, entry_archive_month, > entry_archive, and entry_detail all wor

Re: Generic view 'archive_year' produces blank HTML page

2009-09-12 Thread Matthew
Here is more information: http://stackoverflow.com/questions/1257943/generic-view-archiveyear-produces-blank-page On Aug 10, 8:35 pm, Alasdair wrote: > archive_year doesn't add a list of objects to the context by default. > Instead, it adds date_list, a list of months that have objects > availa

ImageField anti-duplication

2009-09-12 Thread A. Rossi
I have an application where users can upload images, then the image is renamed to a SHA256 hash of the file's contents. Here is the relevant snippet of the model class ImagePost(Post): def imgurl(self, filename): import hashlib, os.path extension = os.path.splitext(filename)

Re: How to invoke hasNoProfanities?

2009-09-12 Thread Daniel Roseman
On Sep 11, 10:40 pm, Brandon wrote: > Uh, where? I see the definition in settings.py, but I can certainly > enter any of the words on the profanities list in: > django.conf.global_settings.py into a text field and it will not throw > an exception. > I actually think that this is a left-over sett