Re: Changing field error messages

2008-09-22 Thread Donn
On Tuesday, 23 September 2008 08:47:10 Daniel Roseman wrote: > self.validate_unique() Ah! That's the magic. Thanks. \d --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Changing field error messages

2008-09-22 Thread Daniel Roseman
On Sep 22, 9:59 am, Donn <[EMAIL PROTECTED]> wrote: > Hi, > I would like to change the 'already exists' message when one adds a record > that duplicates a unique one in the table. > Nearest I can tell, the fields.error_messages do not offer a way to alter that > message. > > Here's my basic code:

Re: ModelChoiceField with Unique Results

2008-09-22 Thread Daniel Roseman
On Sep 22, 10:58 pm, BobZ <[EMAIL PROTECTED]> wrote: > Thanks dmorozov, that worked fine in the sense that it returned only > unique years in a select box, but it still didn't order them properly > (getting non-duplicate years as 1961, 1931, 2000, 1975, 1995, etc.). > > Somehow the order_by sectio

Re: Changing field error messages

2008-09-22 Thread Donn
bump... --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For mor

'next' value in comment post/preview

2008-09-22 Thread Eric Abrahamsen
Somewhat pursuant to this thread: http://groups.google.com/group/django-users/browse_thread/thread/a0c468f0c81bb197# a hidden 'next' field in the comment post form doesn't get carried over to the comment preview view. It seems like if you're going to have a manual 'next' value possible in the

Re: MooTools

2008-09-22 Thread Xenocide001
wow thanks i didn-t know that. imma check out Pinax too.. thanx --~--~-~--~~~---~--~~ 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

Re: update or add object?

2008-09-22 Thread John M
Dang, I knew there was something there! Thanks R. Gorman :) On Sep 22, 6:10 pm, "R. Gorman" <[EMAIL PROTECTED]> wrote: > get_or_create > > http://docs.djangoproject.com/en/dev/ref/models/querysets/#get-or-cre... > > R. > > On Sep 22, 7:55 pm, John M <[EMAIL PROTECTED]> wrote: > > > Is there a me

Re: Postgresql 'missing FROM-clause entry in subquery for table' error on lookup that spans relationships

2008-09-22 Thread Malcolm Tredinnick
On Mon, 2008-09-22 at 18:22 -0700, cfobel wrote: > Hello, > > I'm encountering an error when performing a lookup that spans > relationships. The query is as follows: > > myitems = > MyItem.objects_all.exclude(user__somemodel__created__gte=(datetime.now() > - timedelta(days=3))) > > With the f

Postgresql 'missing FROM-clause entry in subquery for table' error on lookup that spans relationships

2008-09-22 Thread cfobel
Hello, I'm encountering an error when performing a lookup that spans relationships. The query is as follows: myitems = MyItem.objects_all.exclude(user__somemodel__created__gte=(datetime.now() - timedelta(days=3))) With the following (stripped) models: class MyItem(models.Model): user = mo

Re: Accessing Settings from Flatpages

2008-09-22 Thread Chris
On Sep 22, 8:59 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Chris wrote: > > I have various global values, like SITE_NAME, defined in my > > settings.py. How would you make settings available inside Flatpage > > templates? For non-flatpages, I'm currently importing settings in my > > view and ex

Re: ModelChoiceField - remove empty-value

2008-09-22 Thread Brian Neal
On Sep 5, 11:19 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2008-09-05 at 03:11 -0700, mwebs wrote: > > Hello, > > > I use amodelchoicefieldand want to remove the entry that represents > > "no item selected"(--), because in my > > scenario I will only allow to select between ex

Re: update or add object?

2008-09-22 Thread R. Gorman
get_or_create http://docs.djangoproject.com/en/dev/ref/models/querysets/#get-or-create-kwargs R. On Sep 22, 7:55 pm, John M <[EMAIL PROTECTED]> wrote: > Is there a method I can call in a view that given a key, it checks to > see if that object exists and if it does returns that object, or if it

Re: Accessing Settings from Flatpages

2008-09-22 Thread Steve Holden
Chris wrote: > I have various global values, like SITE_NAME, defined in my > settings.py. How would you make settings available inside Flatpage > templates? For non-flatpages, I'm currently importing settings in my > view and explicitly passing it in render_to_response(). Do Flatpages > allow you

Re: OS path in python

2008-09-22 Thread Bobby Roberts
> import os > os.environ['SERVER_NAME'] > > See how that goes. I get: KeyError: 'SERVER_NAME' So i'm assuming we aren't --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Accessing Settings from Flatpages

2008-09-22 Thread Chris
I have various global values, like SITE_NAME, defined in my settings.py. How would you make settings available inside Flatpage templates? For non-flatpages, I'm currently importing settings in my view and explicitly passing it in render_to_response(). Do Flatpages allow you to specify what data ge

Re: OS path in python

2008-09-22 Thread gaz
On Sep 23, 10:01 am, Bobby Roberts <[EMAIL PROTECTED]> wrote: > I need to find the x part of the path which is the domain name > (whatever.com, ie).  I'm thinking that the only way to do this is to > get the current URL being viewed but I can't figure that out. Assuming you are using Python C

Re: OS path in python

2008-09-22 Thread Bobby Roberts
On Sep 22, 6:11 pm, Erik Allik <[EMAIL PROTECTED]> wrote: > Shouldn't that be os.path.abspath(os.path.dirname(__file__)) instead   > just in case the .py file is executed with a relative path? > > And Bobby, I would instead use the Sites framework to compute the URL   > of the site, not rely on

update or add object?

2008-09-22 Thread John M
Is there a method I can call in a view that given a key, it checks to see if that object exists and if it does returns that object, or if it doesn't, adds it to the DB and returns the new key? I could have sworn there was a shortcut for this. Thanks John --~--~-~--~~~---

docutils extra

2008-09-22 Thread aleray
Hey, I installed docutils svn version and I couldn't get the documention working (was in the python path) until I found I needed to register in my pythonpath the "extra" directory in the docutils package. Docutils team apparently moved in that directory some libraries needed for django documentio

Re: Impact of a CustomManager on the RelatedManager

2008-09-22 Thread gaz
Thanks Bruno, I'd already tried that - I noticed that with or without the use_for_related_field being set on the Custom Manager the effect was the same - ie. the RelatedManager fires off it's own code without actually using the MyCurrentSiteManager instance that is already associated with the Mod

Re: How to simulate recursive inlines in admin?

2008-09-22 Thread David Durham, Jr.
2008/9/22 Steve Holden <[EMAIL PROTECTED]>: > This all seems rather ambitious for the admin. Isn't it supposed to be a > simple application, and aren't those kind of functions supposed to be > implemented by other views? There's no point trying to make the admin > all things to all people - that w

suscribe

2008-09-22 Thread Ovnicraft
-- [b]question = (to) ? be : !be; .[/b] --~--~-~--~~~---~--~~ 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 this group, send em

Re: How to simulate recursive inlines in admin?

2008-09-22 Thread Steve Holden
David Durham, Jr. wrote: > On Mon, Sep 22, 2008 at 4:05 PM, Petar Marić <[EMAIL PROTECTED]> wrote: > >> I'm using the admin app for creating Questionnaires and I'd like to let users >> edit questions and answers in the same form. AFAIK recursive inlines aren't >> supported in Django (a hard pro

What's the best way to handle different login requirements

2008-09-22 Thread catsclaw
Hi all -- I'm having trouble figuring out how to properly design this in Django. I'm using the Django user system. I've got an application I'm writing that allows people to browse an SVN repository in Django. In order to do this, I need to hang on to their username and password so I can

Re: OS path in python

2008-09-22 Thread Erik Allik
Shouldn't that be os.path.abspath(os.path.dirname(__file__)) instead just in case the .py file is executed with a relative path? And Bobby, I would instead use the Sites framework to compute the URL of the site, not rely on a local folder name. Erik On 23.09.2008, at 0:51, Plamen Dragozov w

Updates not working

2008-09-22 Thread Adam Findley
So I have a pretty simple case here in a view: event = Event.Objects.get(id='23') event.end_date = datetime.now() event.save() It should just work right? When looking at the queries, the UPDATE command has all of the keys quoted, but not the values. This causes the query to fail. For some rea

Re: Install version .90 help

2008-09-22 Thread KillaBee
On Sep 19, 8:18 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2008-09-19 at 09:48 -0700, KillaBee wrote: > > > On Sep 19, 9:18 am, KillaBee <[EMAIL PROTECTED]> > > wrote: > > > On Sep 18, 8:34 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > > > wrote: > > > > > On Thu, 2008-09-18 at 1

Re: ModelChoiceField with Unique Results

2008-09-22 Thread BobZ
Thanks dmorozov, that worked fine in the sense that it returned only unique years in a select box, but it still didn't order them properly (getting non-duplicate years as 1961, 1931, 2000, 1975, 1995, etc.). Somehow the order_by section of "set([(obj.year, obj.year) for obj in Vehicle.objects.al

Dictionary Issue in Django Template (Beginner)

2008-09-22 Thread [EMAIL PROTECTED]
Hi, The following are a few lines from my Django template which i cannot get to work.. {% for machine in web %} {% for status_message in status.machine %} {{status_message}} {% endfor %} {% endfor %} web [list()] - is a list of machines.. status [dict()] - is a dictionary of lists.

Re: OS path in python

2008-09-22 Thread Plamen Dragozov
From inside a python module: os.path.dirname(__file__) Best, Plamen Dragozov Bobby Roberts wrote: > > On Sep 22, 5:05 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > >> os.path.dirname() >> > > > Thanks. The main problem is that i have to dynamically get the url > i'm at so i can pass to

Re: Template help for new django.contrib.comments

2008-09-22 Thread macgregor
Think I may have just figured it out comment.content_object.get_absolute_url works for me. On Sep 22, 2:37 pm, Delta20 <[EMAIL PROTECTED]> wrote: > I have the exact same question. I also tried using > "object.get_content_object.get_absolute_url" but that didn't work > either. > > On Sep 22, 5:2

Re: How to simulate recursive inlines in admin?

2008-09-22 Thread David Durham, Jr.
On Mon, Sep 22, 2008 at 4:05 PM, Petar Marić <[EMAIL PROTECTED]> wrote: > I'm using the admin app for creating Questionnaires and I'd like to let users > edit questions and answers in the same form. AFAIK recursive inlines aren't > supported in Django (a hard problem by itself) so the only other wa

Re: MooTools

2008-09-22 Thread Erik Allik
You should consider Pinax at http://pinaxproject.com/. Cloud27.com is powered by Pinax. It's a community site platform you can customize to your needs. Erik On 22.09.2008, at 22:14, Xenocide001 wrote: > > i was wondering how to make django project along with Mootools, the > project itself i

Re: Template help for new django.contrib.comments

2008-09-22 Thread Delta20
I have the exact same question. I also tried using "object.get_content_object.get_absolute_url" but that didn't work either. On Sep 22, 5:25 pm, macgregor <[EMAIL PROTECTED]> wrote: > I have the new Comments app installed and working and want to modify > django/contrib/comments/templates/comment

Template help for new django.contrib.comments

2008-09-22 Thread macgregor
I have the new Comments app installed and working and want to modify django/contrib/comments/templates/comments/posted.html to include a link to the content object that a comment gets added to. For example: If someone posts a comment on a blog entry, the comment gets added and then the user is re

Re: Passing in a value from a url

2008-09-22 Thread djandrow
Thanks Karen, it works fine now. regards, Andrew --~--~-~--~~~---~--~~ 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 this grou

Re: OS path in python

2008-09-22 Thread Bobby Roberts
On Sep 22, 5:05 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > os.path.dirname() Thanks. The main problem is that i have to dynamically get the url i'm at so i can pass to that function ( Python returns that i'm missing 1 argument and I don't know how to dynamically pass that in.) --~--~---

Re: How to obtain the difference between two related querysets?

2008-09-22 Thread Ben Butler-Cole
On Aug 14, 8:57 pm, DrakerNet2 <[EMAIL PROTECTED]> wrote: > How do I obtain thedifferencebetweenQueryset1 and 2 (i.e. how do I > obtain all records fromQueryset1 that do not appear inQueryset2? I've been trying to work this out as well. I have an answer, but not one that I'm very happy with. To

Re: OS path in python

2008-09-22 Thread Jarek Zgoda
os.path.dirname() Wiadomość napisana w dniu 2008-09-22, o godz. 22:51, przez Bobby Roberts: > > i've got a setup like most people where i have directory structure > such as: > > home/sites/xxx/whatever > > > where xxx is the domain name > > If I have a file sitting in the "whatever" directory,

How to simulate recursive inlines in admin?

2008-09-22 Thread Petar Marić
Hi everybody, I'm creating a Django based web application for my Master thesis and I've got a hard problem. This is my model (greatly simplified): class Questionnaire(models.Model): title = models.CharField() description = models.TextField() created_by = models.ForeignKey(User, editab

OS path in python

2008-09-22 Thread Bobby Roberts
i've got a setup like most people where i have directory structure such as: home/sites/xxx/whatever where xxx is the domain name If I have a file sitting in the "whatever" directory, how can i find the domain name under which the file resides? Thanks for helping a noob. --~--~-~--~-

Re: Abstract Superclass and Foreign Keys

2008-09-22 Thread Peter Bailey
Well a good session with my db made it apparent why this looked like it was working in Admin but not my other code - I had a join table pointing to the item superclasses, and thus their names showed up - OK - I feel even sillier now! So, I am proceeding with the generic keys/relations and so far

Re: function import errors model import in other file

2008-09-22 Thread Gerard Petersen
Norman, Seems so simple when you point it out .. :-)I know what happens, but it still seems fuzzy. This means I can not place anything anywhere even though I needed the stuff where I imported it. I think I'll draw some schematics to get a clearer view on what goes where. Thanx a lot!! Regard

Re: MySQL case sensitivity

2008-09-22 Thread tcp
Karen, Thank you for the detailed answer. Currently I am following the Sams Django in 24 Hours book. The example there gives an uppercase folder name. >From your response I can see that it would be good practice to stick to lowercase folders (I will follow that path). I found that support upper

Re: MySQL case sensitivity

2008-09-22 Thread Karen Tracey
On Mon, Sep 22, 2008 at 2:29 PM, tcp <[EMAIL PROTECTED]> wrote: > > Hi, > > Getting started. > > I've got a MySQL database running on Windows (MySQL on Windows is not > case sensitive) > > I create a model called People which has a Class called Person. > Your terminology is confusing here. I thin

Re: MooTools

2008-09-22 Thread Horst Gutmann
Django itself doesn't really care what JavaScript library you want to use. Simply include it in your templates and use it like you would any other static file :-) In this regard it doesn't really matter if you want to use MooTools, jQuery, YUI, Prototype or whatever other JS library you want to us

MooTools

2008-09-22 Thread Xenocide001
i was wondering how to make django project along with Mootools, the project itself it-s nothing now (no code just a doodle in my notebook and an idea).. i-ve seen a lot of django powered comunnity sites.. and i was looking for making one.. i know a bit of javascript.. and mootools so i like some l

Re: ModelChoiceField with Unique Results

2008-09-22 Thread [EMAIL PROTECTED]
You can try something like this: class SearchForm(forms.ModelForm): year = forms.ChoiceField() def __init__(self, *args, **kwargs): super(SearchForm, self) .__init__(*args, **kwargs) self.fields['year'].choices = \ set([(obj.year, obj.year) for obj in \

Re: ModelChoiceField with Unique Results

2008-09-22 Thread [EMAIL PROTECTED]
You can try something like this: class SearchForm(forms.ModelForm): year = forms.ChoiceField() def __init__(self, *args, **kwargs): super(SearchForm, self) .__init__(*args, **kwargs) self.fields['year'].choices = \ set([(obj.year, obj.year) for obj in \

Re: MySQL case sensitivity

2008-09-22 Thread Juan Hernandez
I've got a MySQL database running on Windows (MySQL on Windows is not > case sensitive) That does not depends on the OS, depends on the Charset established in the DB. Check the charset being used at the DB and then run syncdb again --~--~-~--~~~---~--~~ You receiv

MySQL case sensitivity

2008-09-22 Thread tcp
Hi, Getting started. I've got a MySQL database running on Windows (MySQL on Windows is not case sensitive) I create a model called People which has a Class called Person. I sync the database and it creates a table "people_person" If I immediately run syncdb again, it errors out with: Creatin

Re: function import errors model import in other file

2008-09-22 Thread Norman Harman
Gerard Petersen wrote: > Hi All, > > I'm trying to import a function. When adding this statement I get a Model > import error in a completely different place, not even related. I've added > the files from my app directory and their import statements below. > > Are there any unauthorized impor

Re: djangoamf doesn't work with models with ImageField

2008-09-22 Thread euglena
I'm now using django 1.0 and djangoamf 0.6. Maybe this djangoamf version is conflicted to the new django version? Has anyone tried the two together? This error occurs whenever I try to return a queryset with a "ImangeField". This is the whole traceback: Traceback (most recent call last): File

Re: ANN: Updated Django Cheat Sheet

2008-09-22 Thread Andrew Durdin
We've updated the cheat sheet to correct two typos: - The "default_if_none" filter is now correctly spelt (thanks to Aaron C. de Bruyn for pointing it out). - The "ForeignKey" model field is now correctly named (thanks to Nikos Delibaltadakis for pointing it out). Grab it from http://www.me

function import errors model import in other file

2008-09-22 Thread Gerard Petersen
Hi All, I'm trying to import a function. When adding this statement I get a Model import error in a completely different place, not even related. I've added the files from my app directory and their import statements below. Are there any unauthorized imports being done? Do I need to specify m

Re: Custom tags and "extends"

2008-09-22 Thread Karish
In short, the question is: How does a custom tag in a parent template access the nodes of the derived template in its render() function? Thanks! On Sep 22, 8:21 am, Karish <[EMAIL PROTECTED]> wrote: > I wrote a very simple custom tag, called oneline, which stips all > newline characters from wh

Re: Change text box to a drop down box in the admin interface?

2008-09-22 Thread Karen Tracey
On Mon, Sep 22, 2008 at 12:49 PM, Jason <[EMAIL PROTECTED]> wrote: > > Thanks for the reply Karen. > > With that being said I would still like to know just how easy or hard > it is to switch something like this around. In real terms its only a > minor change. Can this be achieved with a few lines

Re: MySQLdb + AMD64

2008-09-22 Thread TheIvIaxx
I understand this isnt a django specific question, but i figured someone out there might have tried starting a django project with mysql on an AMD64 platform. If so, how did they accomplish it. On Sep 8, 7:19 pm, Martin Diers <[EMAIL PROTECTED]> wrote: > Perhaps you should direct this to a MySQL

Re: _get_next_or_previous_ usage

2008-09-22 Thread Rafael Beccar Barca
On Sun, Sep 21, 2008 at 9:46 PM, Rafael Beccar Barca <[EMAIL PROTECTED]> wrote: > On Sun, Sep 21, 2008 at 9:23 PM, Malcolm Tredinnick > <[EMAIL PROTECTED]> wrote: >> >> >> On Sun, 2008-09-21 at 17:36 -0300, Rafael Beccar Barca wrote: >>> Hi, >>> >>> I didn't find documentation for _get_next_or_pre

Re: Querysets and includes

2008-09-22 Thread Norman Harman
Charles Choiniere wrote: > On Mon, Sep 22, 2008 at 10:46 AM, Norman Harman <[EMAIL PROTECTED] > > wrote: > > > nek4life wrote: > > How would I go about getting a queryset into an include? Say I > have a > > blog and I have a page for the post detail.

Re: Change text box to a drop down box in the admin interface?

2008-09-22 Thread Jason
Thanks for the reply Karen. With that being said I would still like to know just how easy or hard it is to switch something like this around. In real terms its only a minor change. Can this be achieved with a few lines in my admin.py file or would I have to do this another way? On Sep 22, 5:04

Re: Abstract Superclass and Foreign Keys

2008-09-22 Thread Peter Bailey
Malcolm, (or any other knowledgeable soul), I have been experimenting with both abstract classes and Generic Foreign Keys and Relations to solve my issues, and I still have some problems and questions. There are not a lot of examples of those, and what I really need is for this all to work properl

ModelChoiceField with Unique Results

2008-09-22 Thread BobZ
What I'm trying to do seems relatively simple, but I have yet to find a proper solution for it. I'm trying to query a list of years from a database of registered vehicles in my county and display them in a drop-down select menu in a form. Since the registered vehicles database has many cars of

Re: View error in tutorial 3 (URLCONF)

2008-09-22 Thread Karen Tracey
On Mon, Sep 22, 2008 at 11:52 AM, Caisys <[EMAIL PROTECTED]> wrote: > > Hi, > I am following the tutorials on django website. My problem is that > when i create url conf for views that do not exist, the admin site > ceases to work. > Mysite\urls.py includes: > (r'^admin/(.*)', admin.site.root), >

Re: Change text box to a drop down box in the admin interface?

2008-09-22 Thread Karen Tracey
On Mon, Sep 22, 2008 at 11:51 AM, Jason <[EMAIL PROTECTED]> wrote: > > Could someone help with this? > > The admin panel is automatically generating my model. This is my > model. > > title = models.CharField(...) > parent = models.CharField(..., null = True) > > The admin panel is currently displa

View error in tutorial 3 (URLCONF)

2008-09-22 Thread Caisys
Hi, I am following the tutorials on django website. My problem is that when i create url conf for views that do not exist, the admin site ceases to work. Mysite\urls.py includes: (r'^admin/(.*)', admin.site.root), (r'^polls/', include('mysite.polls.urls')), Mysite\Polls\urls.py includes: urlpatter

Change text box to a drop down box in the admin interface?

2008-09-22 Thread Jason
Could someone help with this? The admin panel is automatically generating my model. This is my model. title = models.CharField(...) parent = models.CharField(..., null = True) The admin panel is currently displaying 2 text input boxes. What I want to display is a single text input box for the

How to?: My micro-isv website, django style

2008-09-22 Thread mamcxyz
Ok, I'm doing a new version of a system I made to take orders in mobile device and I'm working now for reach the global market (latinamerica, USA & maybe some of europa). My current website is not very informative. I wanna have a decent ISV website & plan do it all with django. I'm looking in the

Re: ModelForm, one form, two models

2008-09-22 Thread Joseph Kocherhans
On Mon, Sep 22, 2008 at 8:57 AM, diN0bot <[EMAIL PROTECTED]> wrote: > > Seems like Joseph's problem is typical for User/Profile work. > > Initially I used the same inheritance model as he does. Working with a > single form in the view and template is a win for code re-use and > simplicity. > > I l

Re: Django + Active Directory + Firebird DB ???

2008-09-22 Thread mamcxyz
Also, depending in your situation, you can use a "master" database and use remote views to consolidate the diferents databases and code just like was a single one. This is a feature on Sql Server and I think is sure that exist for postgress. --~--~-~--~~~---~--~~ Yo

Re: Is possible this hack for the admin? Get user & current item in the save

2008-09-22 Thread mamcxyz
Any idea in how do this? How catch the request on the save method? --~--~-~--~~~---~--~~ 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 unsubscri

Custom tags and "extends"

2008-09-22 Thread Karish
I wrote a very simple custom tag, called oneline, which stips all newline characters from whatever is inside it. I want to use it in a base template like this (base.txt): {% load text %}{% oneline %} {% block body %}{% endblock %} {% endoneline %} In the derived template (derived.txt) I just do:

Re: Authentication: user_passes_test() - issue

2008-09-22 Thread R. Gorman
I'm not 100% sure I understand your question, but I believe you're asking how to pass the model object to the view that will verify if the request was made by a certain user. If so, you should look at using the url template tags (http://docs.djangoproject.com/en/dev/ref/ templates/builtins/#url).

Re: ordering results of a queryset by foreign fields

2008-09-22 Thread Rajesh Dhawan
> Thank you too, Karen, for your help. > In fact i am using the 0.96 and the problem is that i can't upgrade to > the 1.0 right now because the project i'm working on started months > ago and we are near the end date.. we can't rewrite the application to > be compatible with the 1.0 in such a few

Re: Querysets and includes

2008-09-22 Thread Charles Choiniere
On Mon, Sep 22, 2008 at 10:46 AM, Norman Harman <[EMAIL PROTECTED]>wrote: > > nek4life wrote: > > How would I go about getting a queryset into an include? Say I have a > > blog and I have a page for the post detail. On the sidebar I would > > like to have the blog categories dynamically built or

Re: Model/admin page problem

2008-09-22 Thread tsmets
Correct I, of course, added after synching and it looked everything was fine Tx, \T, On Sep 22, 3:29 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Sep 22, 2008 at 9:10 AM, tsmets <[EMAIL PROTECTED]> wrote: > > I am running 1.0 on sqlite3 and I keep on getting > > [snip] > > Temp

Re: Querysets and includes

2008-09-22 Thread Norman Harman
nek4life wrote: > How would I go about getting a queryset into an include? Say I have a > blog and I have a page for the post detail. On the sidebar I would > like to have the blog categories dynamically built or have recent > articles, or recent comments, etc... What would be the best approach

Re: ordering results of a queryset by foreign fields

2008-09-22 Thread Vokial
Mmmmh both of you made it clear: i've got to upgrade to django 1.0... Again thank you for your help, i'll see what i can do about that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: ordering results of a queryset by foreign fields

2008-09-22 Thread Vokial
Thank you too, Karen, for your help. In fact i am using the 0.96 and the problem is that i can't upgrade to the 1.0 right now because the project i'm working on started months ago and we are near the end date.. we can't rewrite the application to be compatible with the 1.0 in such a few time.. Ju

Querysets and includes

2008-09-22 Thread nek4life
How would I go about getting a queryset into an include? Say I have a blog and I have a page for the post detail. On the sidebar I would like to have the blog categories dynamically built or have recent articles, or recent comments, etc... What would be the best approach to build these "widgets

Re: ordering results of a queryset by foreign fields

2008-09-22 Thread Rajesh Dhawan
On Sep 22, 10:04 am, Vokial <[EMAIL PROTECTED]> wrote: > Thank you for the answer. > > I already read the page you linked me (the django documentation is > becoming my second home :) ) and i tried what you said but i got this > error: > OperationalError at /search/1/ > (1054, "Unknown column > '

Re: ordering results of a queryset by foreign fields

2008-09-22 Thread Karen Tracey
On Mon, Sep 22, 2008 at 10:04 AM, Vokial <[EMAIL PROTECTED]> wrote: > > Thank you for the answer. > > I already read the page you linked me (the django documentation is > becoming my second home :) ) and i tried what you said but i got this > error: > OperationalError at /search/1/ > (1054, "Unkno

Re: ordering results of a queryset by foreign fields

2008-09-22 Thread Vokial
Thank you for the answer. I already read the page you linked me (the django documentation is becoming my second home :) ) and i tried what you said but i got this error: OperationalError at /search/1/ (1054, "Unknown column 'images_version.shoot__subject__photographer__surname' in 'order clause'"

Re: ModelForm, one form, two models

2008-09-22 Thread diN0bot
Seems like Joseph's problem is typical for User/Profile work. Initially I used the same inheritance model as he does. Working with a single form in the view and template is a win for code re-use and simplicity. I looked into formsets but haven't gotten it to work with multiple model types. It se

Re: ordering results of a queryset by foreign fields

2008-09-22 Thread Rajesh Dhawan
Hi, > I can't order the results of a queryset by a field in a related > table.. Have you seen: http://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by-fields > I have this set of applications (they are far more complex, i'm > cutting out all the unnecessary parts): > > images app:

Re: Model/admin page problem

2008-09-22 Thread Karen Tracey
On Mon, Sep 22, 2008 at 9:10 AM, tsmets <[EMAIL PROTECTED]> wrote: > I am running 1.0 on sqlite3 and I keep on getting > [snip] > TemplateSyntaxError at /admin/ > > Caught an exception while rendering: no such table: django_admin_log > > [snip] > What is wrong in my set up ... ? > It seems you di

Re: Model/admin page problem

2008-09-22 Thread tsmets
I am running 1.0 on sqlite3 and I keep on getting [snip] TemplateSyntaxError at /admin/ Caught an exception while rendering: no such table: django_admin_log Original Traceback (most recent call last): File "C:\Python25\lib\site-packages\django\template\debug.py", line 71, in render_node

ordering results of a queryset by foreign fields

2008-09-22 Thread Vokial
Hi! I can't order the results of a queryset by a field in a related table.. I have this set of applications (they are far more complex, i'm cutting out all the unnecessary parts): images app: class Subject(models.Model): photographer = models.ForeignKey(Author) [... a lot more stuff..] class S

Re: Django + Active Directory + Firebird DB ???

2008-09-22 Thread Bubblegum
Hi Erik, Thank you a lot for your reply. I looked more deeply into Django + LDAP + Active Directory connectivity and it looks that an authentication/authorization is viable and can be achieved. Here is the link for potential solution: http://www.djangosnippets.org/snippets/501/ Thnks a lot for l

Authentication: user_passes_test() - issue

2008-09-22 Thread mwebs
Hi, I my scenario users can only edit some model if thy are also the authors. With the permission_required_decorator this is not possible. So what about the user_passes_test-decorator. I want to do something like this: def user_can_edit(user, model): if user.is_authenticated and user == mode

Authentication: user_passes_test() - issue

2008-09-22 Thread mwebs
Hi, I my scenario users can only edit some model if thy are also the authors. With the permission_required_decorator this is not possible. So what about the user_passes_test-decorator. I want to do something like this: def user_can_edit(user, model): if user.is_authenticated and user == mode

Re: Impact of a CustomManager on the RelatedManager

2008-09-22 Thread bruno desthuilliers
On 22 sep, 01:49, gaz <[EMAIL PROTECTED]> wrote: (snip) > I have overloaded the default manager in my model to use a slight > variant of the CurrentSiteManager, shown below. > (snip) > What I am seeing is that the following queries work and present only > the objects which are on the site (Venue)

Re: Django -- very very basic query !

2008-09-22 Thread bruno desthuilliers
On 21 sep, 16:20, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am basically c/c++/Unix dev, and knowing little python stuff. And > little bit about xhtml. > I just wanted to know to learn/develop site using Django, Do i have to > master of Python, Xhtml , Javascript ? Well... (x)htm

Re: Cookie problem

2008-09-22 Thread M.Ganesh
plungerman wrote: > On Sep 19, 11:40 am, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > >> Getting the following error message when I try to access the admin page >> of my spanking new django 1.0 installation : >> "Looks like your browser isn't configured to accept cookies. Please >> enable cookies, r

Re: Where can a save confirmation page be hooked into the admin? (similar to delete confirmation)

2008-09-22 Thread Erik Allik
You can check out how auth.UserAdmin does it, for example. I used that as a reference. Erik On 22.09.2008, at 14:27, Jacob Rigby wrote: > > That's a good idea. It looks I can get by with raising a > ValidationError in a custom ModelAdmin form; it's almost as clear as a > confirmation page and

Re: Where can a save confirmation page be hooked into the admin? (similar to delete confirmation)

2008-09-22 Thread Jacob Rigby
That's a good idea. It looks I can get by with raising a ValidationError in a custom ModelAdmin form; it's almost as clear as a confirmation page and just a few lines of code. Thanks, Jacob On Sep 22, 6:40 pm, Erik Allik <[EMAIL PROTECTED]> wrote: > You should check out the ModelAdmin class and

Re: ANN: Updated Django Cheat Sheet

2008-09-22 Thread Andrew Durdin
On Sep 21, 8:23 am, "Nikos Delibaltadakis" <[EMAIL PROTECTED]> wrote: > Shouldn't ForeignKeyField to be just ForeignKey? > Am I missing something? No, you're absolutely correct -- thanks for spotting the error! We'll get a corrected version out ASAP. Cheers, Andrew. --~--~-~--~~---

Re: Cookie problem

2008-09-22 Thread plungerman
On Sep 19, 11:40 am, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > Getting the following error message when I try to access the admin page > of my spanking new django 1.0 installation : > "Looks like your browser isn't configured to accept cookies. Please > enable cookies, reload this page, and try agai

Re: custom tag for html fragment with dynamic content

2008-09-22 Thread christian
This is how i am now doing it i call the template: {% instance block %} {% include_feed "http://localhost:8080/feeds/news/"; 5 feeds/ test.html %} {% endinstance %} my code is: @register.tag(name="instance") def make_instance(parser, token): try: tag_name, arg = token.

Re: Where can a save confirmation page be hooked into the admin? (similar to delete confirmation)

2008-09-22 Thread Erik Allik
You should check out the ModelAdmin class and how to override certain parts of it such as the save_model, change_view and add_view methods. Hope that helps. Erik On 22.09.2008, at 13:08, Jacob Rigby wrote: > > I want to emulate the delete confirmation page behavior before saving > certain mo

  1   2   >