Re: Django setup problem when executing syncdb

2009-03-10 Thread kk
Hi Karen, I'm having the same problem as ches and brita had. I downloaded the link that you have given, but I'm unable to run as it is an application. If you can guide me where to store that application and how to run that, I will be glad. Also, for the DATABASEHOST in settings do we need to giv

Category / Subcategory / Product

2009-03-10 Thread Muslu Yüksektepe
Hi guys; I am preparing one project with Django. i need to make one application. it must be categories. Like: Category1 ...Subcategory1 ..Video1 ..Video2 ...Subcategory2 ..Video3 ..Video4 Category2 ...Subcategory3 ..Video5 ..Video6 ...Subcategory4 ..Video7 ..Video

Re: Category / Subcategory / Product

2009-03-10 Thread Malcolm Tredinnick
On Tue, 2009-03-10 at 01:12 -0700, Muslu Yüksektepe wrote: > Hi guys; > I am preparing one project with Django. i need to make one > application. it must be categories. > Like: > > Category1 > ...Subcategory1 > ..Video1 > ..Video2 > ...Subcategory2 > ..Video3 > ..Video4 > > Categ

Formatted currency output question

2009-03-10 Thread Joshua Russo
I found this in my searches for formatting a decimal as a proper currency output: http://www.djangosnippets.org/snippets/552/ The problem I'm running into is that the setLocale() line seems to be choking on the non-base 128 characters that display in my site. I'm creating the site to display Port

Re: Category / Subcategory / Product

2009-03-10 Thread Muslu Yüksektepe
thanks your answer. i tryed 3 models but i dont know how can i use codes in templates. i setuped mptt but i dont understand anything oops 2009/3/10 Malcolm Tredinnick > > On Tue, 2009-03-10 at 01:12 -0700, Muslu Yüksektepe wrote: > > Hi guys; > > I am preparing one project with Django. i need t

Re: Formatted currency output question

2009-03-10 Thread Joshua Russo
Oh ya, I forgot to mention that I'm not using the snippet as advertised either. I'm trying to make a CurrencyField object. Of course then I realized that the formatting of at least the admin list display was done outside of the Field objects, this (I believe the file is called result_list.py) is w

Re: Different Database object behavior on Production and Development servers.

2009-03-10 Thread NoviceSortOf
It's clear now that __str__(self) or __unicode__ return a usable string to the view. But this does not on the surface appear to be a workable instance of the model itself, that would return fields that I can work with in the template...and/or i haven't figured how to get a handle on it. ie... t

Re: Different Database object behavior on Production and Development servers.

2009-03-10 Thread NoviceSortOf
It's clear now that __str__(self) or __unicode__ return a usable string to the view. But this does not on the surface appear to be a workable instance of the model itself, that would return fields that I can work with in the template...and/or i haven't figured how to get a handle on it. ie... t

Re: Formatted currency output question

2009-03-10 Thread Malcolm Tredinnick
On Tue, 2009-03-10 at 02:11 -0700, Joshua Russo wrote: > I found this in my searches for formatting a decimal as a proper > currency output: http://www.djangosnippets.org/snippets/552/ Oh, that's a really bad idea. :-( Calling setlocale() in multi-threaded applications is simply not something yo

Re: Different Database object behavior on Production and Development servers.

2009-03-10 Thread Malcolm Tredinnick
So this is the first time you've explained the real problem you're trying to solve. It certainly helps explain, a little bit, at least, which direction to point you for solutions. On Tue, 2009-03-10 at 02:28 -0700, NoviceSortOf wrote: > > It's clear now that __str__(self) or __unicode__ > return

django to appengine error

2009-03-10 Thread arbi
Hi, I am making the tutorial of google to "activate" django in app engine : http://code.google.com/intl/fr-FR/appengine/articles/appengine_helper_for_django.html I made "python manage.py runserver" and it worked : " INFO:root:Running application google-app-engine-django on port 8000: http://loca

re-usable applications

2009-03-10 Thread Robin Becker
We're trying to write some re-usable apps, but face some problems when it comes to configuring various bits of the application to run together. First off it seems reasonable to allow apps to locate their resources using settings.py. However, in one instance we're not able to do this. Specifica

Re: Overlapping date range test

2009-03-10 Thread Gijs Nijholt
> > Assuming (start1, end1) is the range you want to validate against > SomeModel's time.end and time.start fields: > > SomeModel.objects.filter(time__end__gte=start1, > time__start__lte=end1).count() > > Basically, this is an implemenation of your above math rewritten this > way: > > ( end2 >= st

Re: re-usable applications

2009-03-10 Thread Malcolm Tredinnick
Hi Robin, On Tue, 2009-03-10 at 10:33 +, Robin Becker wrote: > We're trying to write some re-usable apps, but face some problems when it > comes > to configuring various bits of the application to run together. > > First off it seems reasonable to allow apps to locate their resources using

Writing a subclassable Django singleton model

2009-03-10 Thread shabda
I am trying to write a singleton model which can be subclassed. from django.db import models class Singleton(models.Model): name = models.TextField() def save(self): if self.__class__.objects.all().count(): #There exists another object in the DB obj = sel

Re: Different Database object behavior on Production and Development servers.

2009-03-10 Thread NoviceSortOf
Thanks Malcom, I re-read the links you sent along on forms and formsets. I'm now working with a form but instead of ___ > > [ ] Stevenson Collected Works > > [ ] Stevenson Treasure Island > > [ ] Stevenson Wild West Stories > > [Submit] I

Re: Different Database object behavior on Production and Development servers.

2009-03-10 Thread Malcolm Tredinnick
On Tue, 2009-03-10 at 04:07 -0700, NoviceSortOf wrote: > Thanks Malcom, > > I re-read the links you sent along on forms and formsets. > > I'm now working with a form but instead of > ___ > > > [ ] Stevenson Collected Works > > > [ ] Stevens

Re: Needed: a tidy model for varying numbers of multiple numerical values (page number refs)?

2009-03-10 Thread Dave E
First, thanks for the responses. Second, to answer the questions: 1. > - how would you like to handle (or not-handle) overlapping > ranges?  ("100 ..150, 120, 145-155") as above, in order, lowest number in range first 2. > - are ranges always specified the same way? (".." vs. "-") According to

Getting form and formsets to work with templates

2009-03-10 Thread NoviceSortOf
Glad to report taking a closer look at the code and documentation and a few minor edits of the code --now both single model instance and formset iterable html display are working. I did notice when looping with formset my html syntax had to be changed from "field" to "form" and from "form" to "f

Re: Django setup problem when executing syncdb

2009-03-10 Thread Karen Tracey
On Tue, Mar 10, 2009 at 1:54 AM, kk wrote: > > Hi Karen, > > I'm having the same problem as ches and brita had. I downloaded the > link that you have given, but I'm unable to run as it is an > application. If you can guide me where to store that application and > how to run that, I will be glad.

Re: django to appengine error

2009-03-10 Thread nivhab
Hi Arbi, Seems like a problem with the python path. Django should be a part of your google app-engine installation: Check under //lib and see if 'django' folder exist there. Also check to see that the appcfg.py file under the google_appengine directory contains the line: os.path.join(DIR_PATH,

KeyError on access to session variable

2009-03-10 Thread nivhab
Hi, I am trying to access a simple session attribute in the following way (this is inside a view function): def setSessionData(request): if not request.session.get('data_was_set', False): comLen=get_comment_count() request.session['alert_count'] = comLen

Insert insetad edition with model form

2009-03-10 Thread Dmitry Teslenko
Hello! I'm starting with django framework; I use django 1.0 and sqlite database backend. I've stumbled upon this thing: when editing model entry with ModelForm I get insert instead of update. Here's view procedure: = def

Forms: label translation fails

2009-03-10 Thread Jana Álvarez Muñiz
Hello! I want to use translation in Django forms (and ModelForms), but the only solution I've found is using the 'label' attribute in the form fields ('from django.utils.translation import ugettext as _' is omitted): forms.py: class MyForm(ModelForm): name = forms.CharField(label=_('Name'))

Reviews of pluggable apps? (Sphene Community Tools)

2009-03-10 Thread Gok Mop
Hi, Can anyone point me to a site where I can find reviews or futher information about pluggable apps available for Django? I found Sphene Community Tools (which looks like what I want for user discussion forums, user profiles, and several other things) but it's difficult to find any competition

Re: Insert insetad edition with model form

2009-03-10 Thread Alex Koshelev
What task_id do you send when editing the entry? On Tue, Mar 10, 2009 at 3:54 PM, Dmitry Teslenko wrote: > > Hello! > > I'm starting with django framework; I use django 1.0 and sqlite > database backend. > I've stumbled upon this thing: when editing model entry with ModelForm > I get insert inste

Re: Insert insetad edition with model form

2009-03-10 Thread Daniel Roseman
On Mar 10, 12:54 pm, Dmitry Teslenko wrote: > Hello! > > I'm starting with django framework; I use django 1.0 and sqlite > database backend. > I've stumbled upon this thing: when editing model entry with ModelForm > I get insert instead of update. > > Here's view procedure: > =

Re: django to appengine error

2009-03-10 Thread arbi
I have got this in appcfg.py file : "EXTRA_PATHS = [ DIR_PATH, os.path.join(DIR_PATH, 'lib', 'antlr3'), os.path.join(DIR_PATH, 'lib', 'django'), os.path.join(DIR_PATH, 'lib', 'webob'), os.path.join(DIR_PATH, 'lib', 'yaml', 'lib'), ] " So, for this point it is ok I think. For the other p

Re: Insert insetad edition with model form

2009-03-10 Thread Dmitry Teslenko
On Tue, Mar 10, 2009 at 16:06, Daniel Roseman wrote: > On Mar 10, 12:54 pm, Dmitry Teslenko wrote: >> Hello! >> >> I'm starting with django framework; I use django 1.0 and sqlite >> database backend. >> I've stumbled upon this thing: when editing model entry with ModelForm >> I get insert instead

Re: Forms: label translation fails

2009-03-10 Thread Ramiro Morales
On Tue, Mar 10, 2009 at 10:59 AM, Jana Álvarez Muñiz wrote: > > Hello! > > I want to use translation in Django forms (and ModelForms), but the only > solution I've found is using the 'label' attribute in the form fields > ('from django.utils.translation import ugettext as _' is omitted): You ne

Re: django to appengine error

2009-03-10 Thread Karen Tracey
On Tue, Mar 10, 2009 at 6:03 AM, arbi wrote: > > Hi, > > I am making the tutorial of google to "activate" django in app > engine : > > http://code.google.com/intl/fr-FR/appengine/articles/appengine_helper_for_django.html > > I made "python manage.py runserver" and it worked : > " INFO:root:Runnin

Re: django to appengine error

2009-03-10 Thread arbi
Thx Karen, In fact I tryed to find the solution before posting, but I didn't as you did. Now I will discuss on appengine forum, because I don't really understand the process. Thx! Arbi On 10 mar, 14:16, Karen Tracey wrote: > On Tue, Mar 10, 2009 at 6:03 AM, arbi wrote: > > > Hi, > > > I am ma

Re: Reviews of pluggable apps? (Sphene Community Tools)

2009-03-10 Thread Polat Tuzla
Not exactly what you ask, but below are two pages which compare forum apps and cms apps quite extensively; http://code.djangoproject.com/wiki/ForumAppsComparison http://code.djangoproject.com/wiki/CMSAppsComparison Regards, Polat Tuzla On Mar 10, 3:01 pm, Gok Mop wrote: > Hi, > > Can anyone p

Re: a little help on creating a 'global' file

2009-03-10 Thread Julián C . Pérez
ok thank u all i solved my problem using a request context ;) On 9 mar, 14:40, Briel wrote: > The problem you are seeing regarding the link i mentioned briefly in > my last post. Django does auto escapingbe default of all template vars > and values. In your case that means that you see the html

Re: KeyError on access to session variable

2009-03-10 Thread Daniel Roseman
On Mar 10, 12:45 pm, nivhab wrote: > Hi, > > I am trying to access a simple session attribute in the following way > (this is inside a view function): > > def setSessionData(request): >         if not request.session.get('data_was_set', False): >             comLen=get_comment_count() >          

Encode Html for correct display in tags?

2009-03-10 Thread jago
Hi, I want to show some HTML code 'literally' within tags. Characters such as < > etc. have to be encoded as > and < Can this be done automatically in Python or Django? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

Re: Insert insetad edition with model form

2009-03-10 Thread Daniel Roseman
On Mar 10, 1:14 pm, Dmitry Teslenko wrote: > On Tue, Mar 10, 2009 at 16:06, Daniel Roseman > wrote: > > How is the view getting the task_id parameter? Your form is always > > posting to edit/, with no parameter, so there's no way it can pass the > > task_id to the view. Presumably your URLconf ha

Re: Encode Html for correct display in tags?

2009-03-10 Thread Jacob Kaplan-Moss
On Tue, Mar 10, 2009 at 8:55 AM, jago wrote: > Can this be done automatically in Python or Django? Yes; Django automatically escapes HTML values in templates: http://docs.djangoproject.com/en/dev/topics/templates/#id2 Jacob --~--~-~--~~~---~--~~ You received thi

Re: Encode Html for correct display in tags?

2009-03-10 Thread jago
I am restricted to Django 0.96 On Mar 10, 2:59 pm, Jacob Kaplan-Moss wrote: > On Tue, Mar 10, 2009 at 8:55 AM, jago wrote: > > Can this be done automatically in Python or Django? > > Yes; Django automatically escapes HTML values in > templates:http://docs.djangoproject.com/en/dev/topics/templa

Re: Encode Html for correct display in tags?

2009-03-10 Thread jago
Ok...the text in the docu also describes it for 0.96. Thanks! --~--~-~--~~~---~--~~ 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 fro

Re: Insert insetad edition with model form

2009-03-10 Thread Dmitry Teslenko
On Tue, Mar 10, 2009 at 16:58, Daniel Roseman wrote: > On Mar 10, 1:14 pm, Dmitry Teslenko wrote: >> On Tue, Mar 10, 2009 at 16:06, Daniel Roseman >> wrote: >> > How is the view getting the task_id parameter? Your form is always >> > posting to edit/, with no parameter, so there's no way it can

Re: Different Database object behavior on Production and Development servers.

2009-03-10 Thread NoviceSortOf
> and when I try changing it to > {% for field in formsets %} > i get an error message saying formset is not iterable I was able to get closer the results I want by simply changing the html template from > {% for field in forms %} to {% for form in formset.forms %} {{ form.selected }}{{ form

How to apply filter to included template?

2009-03-10 Thread jago
Can I somehow apply an filter to an included template? {% include "header_viz_js.html" %} how? --~--~-~--~~~---~--~~ 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@

RE: Forms: label translation fails

2009-03-10 Thread Jana Álvarez Muñiz
> On Tue, Mar 10, 2009 at 10:59 AM, Jana Álvarez Muñiz > wrote: > > > > Hello! > > > > I want to use translation in Django forms (and ModelForms), but the only > > > > solution I've found is using the 'label' attribute in the form fields > > ('from django.utils.translation import ugettext as _

Re: urlize

2009-03-10 Thread Emily Rodgers
On Feb 10, 3:17 am, Malcolm Tredinnick wrote: > On Mon, 2009-02-09 at 07:29 -0800, Emily Rodgers wrote: > > Hi, > > > I have written a django app that manages 'change requests' (and > > approvals) for IT infrastructure changes in our company, and I am > > using theurlizefilter when displaying c

Re: Formatted currency output question

2009-03-10 Thread Joshua Russo
On Mar 10, 8:29 am, Malcolm Tredinnick wrote: > On Tue, 2009-03-10 at 02:11 -0700, Joshua Russo wrote: > > I found this in my searches for formatting a decimal as a proper > > currency output:http://www.djangosnippets.org/snippets/552/ > > Oh, that's a really bad idea. :-( > > Calling setlocale()

Re: KeyError on access to session variable

2009-03-10 Thread nivhab
Managed to get it to work in the meanwhile. Seems like the problem is that all of a sudden I need to restart the server each time I do a change otherwise the change is not taking affect. Not sure why this is though... On Mar 10, 3:51 pm, Daniel Roseman wrote: > On Mar 10, 12:45 pm, nivhab wrote

Solving "delete on cascade" problem with signals? / Hierarchical structure of users by userprofile possible?

2009-03-10 Thread delaydac...@googlemail.com
Hello Django-Users, it is my first post here so i inroduce my self. I'm from berlin, germany and working on a little django-project (one person). I choose django because i love python and django seems the best choice. I would classify myself as a beginner, but I have much fun with django and beco

Re: How to apply filter to included template?

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 9:22 AM, jago wrote: > > Can I somehow apply an filter to an included template? > > {% include "header_viz_js.html" %} > > how? > > > This is untested but the filter tag would probably work {% filter myfilter %} {% include "template.jhtml" %} {% endfilter %} -- "I disap

Re: Encode Html for correct display in tags?

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 9:06 AM, jago wrote: > > Ok...the text in the docu also describes it for 0.96. Thanks! > > > Django .96 doesn't have HTML autoescaping. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the high

[XP] Django 1.0.2 Final fails to install

2009-03-10 Thread Vincent
Hello I have ActivePython 2.5.1.1 installed on an XPSP2 host. I downloaded and untarred Django 1.0.2 Final, but when I type "setup.py install", I get the following error: === C:\Downloads\Django-1.0.2-final>setup.py install Traceback (most recent call last): File "C:\Downloads\Django-1.0.2

Re: Category / Subcategory / Product

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 4:17 AM, Muslu Yüksektepe wrote: > thanks your answer. i tryed 3 models but i dont know how can i use codes in > templates. > > i setuped mptt but i dont understand anything > oops > > 2009/3/10 Malcolm Tredinnick > > >> On Tue, 2009-03-10 at 01:12 -0700, Muslu Yüksektepe

Inline Formset Question

2009-03-10 Thread Ardesco
Hi everyone. I still consider myself to be fairly new to Django, and I was wondering if the following was possible with inline formsets in the admin: I want to create a little questionnaire app in the admin that is pre- populated with 25 questions in a specific order such that all the user has to

Re: Category / Subcategory / Product

2009-03-10 Thread Muslu Yüksektepe
okey thanks for everything. i made it now. www.yuksektepe.com i use it in "videolar" its okey now. 2009/3/10 Alex Gaynor > > > On Tue, Mar 10, 2009 at 4:17 AM, Muslu Yüksektepe < > musluyuksekt...@gmail.com> wrote: > >> thanks your answer. i tryed 3 models but i dont know how can i use codes >

Re: Getting form and formsets to work with templates

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 7:01 AM, NoviceSortOf wrote: > > > Glad to report taking a closer look at the code and documentation and > a few minor edits of the code --now both single model instance and > formset iterable html display are working. > > I did notice when looping with formset my html synt

Re: Different Database object behavior on Production and Development servers.

2009-03-10 Thread NoviceSortOf
Alex: I tried another custom widget method earlier today without any effect, then I tried yours as outlined in your blog, there are no errors but there is no change in how the field is displayed. It makes me wonder if there is another step involved (CSS?) with this, or if there is something I mu

Order_by number of foreign key joins

2009-03-10 Thread Chris McCormick
Hi, I want to do something like: Thing.objects.all().order_by("otherthing__count") So there's a many-to-many between Thing and Otherthing, and I want to get a list of Things in the order of most-otherthings joined - is there some easy, Djangoish way to do it, or should I create a new field in T

traceback - no local variables

2009-03-10 Thread George Lund
We have a live server crash issues for which we are receiving emails from Django from our server, which is great. But I'm having trouble debugging the problem because the local variables don't seem to be included in the email. All I can see is call stack followed by a object - but nothing else.

Re: How to create new User with Profile in elegant way

2009-03-10 Thread Ross Dakin
On Mar 9, 1:06 am, myst3rious wrote: > > If you're setting all these things in the User object, then reverse the > > logic slightly: > > >         new_user = User.objects.create(username=username, > >             email=email, > >             is_active=True, > >             first_name=firstname, >

Strange behaviour with templates, dictionarys, key/value, tuple as key and nested for loop Bug?

2009-03-10 Thread johan.uhIe
I have the following hierarchical data structure making use of the datetime-object, dictionarys, arrays and tuples all at once. { datetime : { (datetime, datetime) : [,] } } So a dictionary, holding datetime objects as keys and another dictionary as value. The sec

Django blog for google app engine

2009-03-10 Thread Flank
where can i get open source blog on django for GAE? --~--~-~--~~~---~--~~ 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 gr

Re: Order_by number of foreign key joins

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 11:35 AM, Chris McCormick wrote: > > Hi, > > I want to do something like: > > Thing.objects.all().order_by("otherthing__count") > > So there's a many-to-many between Thing and Otherthing, and I want to get a > list of Things in the order of most-otherthings joined - is ther

problem uploading favicon.ico to an ImageField field

2009-03-10 Thread Michael Repucci
Hi Django'ers, I get a strange bug, which seems to be a problem/conflict between PIL (Python Imaging Library) and the ImageField model field. I have a standard ImageField, but when a user tries to upload an ico file (created either at http://www.html-kit.com/favicon/ or http://www.favicon.cc/), d

Re: problem uploading favicon.ico to an ImageField field

2009-03-10 Thread Michael Repucci
Actually, sorry, this works fine with ico files created at http://www.favicon.cc/, just not with those created from an image at http://www.html-kit.com/favicon/. So nevermind I guess. On Mar 10, 1:10 pm, Michael Repucci wrote: > Hi Django'ers, > > I get a strange bug, which seems to be a proble

rank newbie - working thru 2.0 Book- basic template Tags give 'syntax error' on {%

2009-03-10 Thread Jonquille
python manage.py shell Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> {% if 1 %} File "", line 1 {% if 1 5} ^ SyntaxError: invalid syntax What am I mis

Re: rank newbie - working thru 2.0 Book- basic template Tags give 'syntax error' on {%

2009-03-10 Thread James Bennett
On Tue, Mar 10, 2009 at 1:58 PM, Jonquille wrote: > What am I missing please, and thank you. You're missing the idea that templates are not Python code and are not typed at a Python prompt -- they're placed in template files and templates are loaded and rendered according to the documentation.

Re: rank newbie - working thru 2.0 Book- basic template Tags give 'syntax error' on {%

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 1:58 PM, Jonquille wrote: > > python manage.py shell > Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit > (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > (InteractiveConsole) > >>> {% if 1 %} > File "", line

Re: css framework

2009-03-10 Thread bruno desthuilliers
On 10 mar, 07:01, xankya wrote: > does django prefer any kind of css framework. Nope. Django doesn't care about any client-side stuff (css, js etc). > Which css framework do u > use? I played a bit with blueprint for a given (personal) project. Found it helpful to work on design (not having gr

Re: rank newbie - working thru 2.0 Book- basic template Tags give 'syntax error' on {%

2009-03-10 Thread Jonquille
Great - the 2.0 book/Chap. 4, moves smoothly from code examples to Tags without that mention. Thanks for the quick responses. Jon On Mar 10, 3:02 pm, Alex Gaynor wrote: > On Tue, Mar 10, 2009 at 1:58 PM, Jonquille wrote: > > > python manage.py shell > > Python 2.5.2 (r252:60911, Mar 27 2008, 1

Swapping existing stacked inlines and 'add new inline' presentation

2009-03-10 Thread Alfonso
I've got a list of products with a stacked inline showing their (foreign key related) selling prices which are different depending on the customer. My client has asked if I can change the look and feel so that the inline facility to add a new price is at the top with the previous selling prices b

Values from Reverse Generic Relations on multiple objects

2009-03-10 Thread Adam Nelson
http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#reverse-generic-relations I'm working with Reverse Generic Relations and I was wondering if there is a way to get the related objects for multiple objects in a simple way. For instance, based on the bookmark example of that link, I'd

Re: creating a join of 2 models in a view, and accessing such an object collection in a template

2009-03-10 Thread Mario Zorz
Okay I got it by using QuerySet's API extra() method http://docs.djangoproject.com/en/dev/ref/models/querysets/ All I wanted after all is to get some fields from one model, get some fields from some other model (which is related to the first model through a foreignkey), and show that through th

Best practise of using custom sql with Stored Procedure

2009-03-10 Thread timc3
Hi, I have built my models and so forth, but I have the need to check whether the user requesting an instance or set of instances from the database has permission to do so. For this I have a stored procedure (saved procedure) in the database that when I give it a user id, it then returns the ite

use apache with mod_python

2009-03-10 Thread nenduvel
hello, I'm trying to run a apache-server with my django code. Starting apache with "sudo apachectl start" gives next output: telenetPC:~ root# apachectl start httpd: apr_sockaddr_info_get() failed for telenetPC httpd: Could not reliably determine the server's fully qualified domain name, using

built-in views - register()

2009-03-10 Thread neri...@gmail.com
Hello, It seems like there should be a built-in register view since there's already login, logout, etc. as well as a UserCreationForm, is there a register view located somewhere? Thanks, J --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: built-in views - register()

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 4:56 PM, neri...@gmail.com wrote: > > Hello, > > It seems like there should be a built-in register view since there's > already login, logout, etc. as well as a UserCreationForm, is there a > register view located somewhere? > > Thanks, > > J > > > No, to my knowledge there

Re: Best practise of using custom sql with Stored Procedure

2009-03-10 Thread Adam N
Tim, Here is how I do it with a different query. Using the fetchall() and getting it into a list works nicely. I know that there should be a better way to do this so that we're not making a list twice - but this works: query = """SELECT b.created_on, SUM(a.vote)

Getting stuck in transactions

2009-03-10 Thread Tom Davis
I have a command-line script that uses Django's ORM. For reasons beyond my comprehension, it has a tendency to get "stuck" in transactions. When I check the postgre server status, it simply shows a connection that is "idle in transaction" and never completes. The script ends up hitting this wall s

Re: Order_by number of foreign key joins

2009-03-10 Thread Adam N
You can do this by changing the Thing model: http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#reverse-generic-relations class Thing(models.Model): ... otherthing = generic.GenericRelation(OtherThing) For each thing, when you run thing.otherthing.all(), you'll get

Re: Best practise of using custom sql with Stored Procedure

2009-03-10 Thread timc3
Well I tried that: def get_perm(self, *args, **kwargs): from django.db import connection cursor = connection.cursor() cursor.execute(""" SELECT * FROM permfindernew(2, 132); """) result_list = [] for row in cursor

Re: Best practise of using custom sql with Stored Procedure

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 5:30 PM, timc3 wrote: > > Well I tried that: > >def get_perm(self, *args, **kwargs): >from django.db import connection >cursor = connection.cursor() >cursor.execute(""" >SELECT * FROM permfindernew(2, 132); >

Re: Values from Reverse Generic Relations on multiple objects

2009-03-10 Thread Daniel Roseman
On Mar 10, 7:50 pm, Adam Nelson wrote: > http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#revers... > > I'm working with Reverse Generic Relations and I was wondering if > there is a way to get the related objects for multiple objects in a > simple way.  For instance, based on the b

Localhost does not work with django web server but works with Tomcat

2009-03-10 Thread CG
Using dango 1.0.2 final on windows vista. I have tried starting up tomcat and using http://localhost:8000 and it shows the tomcat default page which means localhost is being resolved correctly on the machine. Any ideas why I am not able to use http://localhost:8000 with django? I started the webse

PYTHONPATH stuck on 2.3.5

2009-03-10 Thread neri...@gmail.com
Hello, I installed python 2.5.4 using macports and edited my .profile by adding: export PYTHONPATH=/opt/local/var/macports/sources/rsync.macports.org/ release/ports/lang/python25:${PYTHONPATH} ...which wasn't reflected in the shell when env was run, so I tried: export PYTHONPATH=${PYTHONPATH}:

Mod_python configuring to apache..

2009-03-10 Thread x_marine
I've instaled Django 1.0.2 and I'm having problems configuring it with Apache at the httpd.conf Everying Else is up and running except localhost fail to run but 127.0.01. works!!! instead. I'm currently using Windows Vista I created mysite project in c:/django my code other config is SetHa

how to use django-profiles?

2009-03-10 Thread Viktor Nagy
Hi, I just can't figure out how to use django-profiles. I've an application called ``membership``, and there I have a models.py file containing: class UserProfile(models.Model): user = models.ForeignKey(User, unique=True) affiliation = models.TextField(blank=False,

Re: PYTHONPATH stuck on 2.3.5

2009-03-10 Thread Graham Dumpleton
On Mar 11, 10:51 am, "neri...@gmail.com" wrote: > Hello, > > I installed python 2.5.4 using macports and edited my .profile by > adding: > > export PYTHONPATH=/opt/local/var/macports/sources/rsync.macports.org/ > release/ports/lang/python25:${PYTHONPATH} > > ...which wasn't reflected in the she

DateTime field always inserted as 0000-00-00 00:00:00

2009-03-10 Thread Theme Park Photo, LLC
Folks: I'm stumped over this one. I have a model: class QuestionAsked(models.Model): user = models.ForeignKey(User) asked = models.ForeignKey(QuestionTable) date = models.DateTimeField() choice = models.CharField(max_length=1) correct = models.BooleanFie

Using Model name in the url

2009-03-10 Thread Michael Strickland
I currently have a base model called Content, with models such as Article, Image, and Video subclassing Content. Currently, get_absolute_url works only when it is located in Content - if I try placing get_absolute_url in any of the inherited models, instead of the base model, it returns an empty s

Re: Using Model name in the url

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 7:40 PM, Michael Strickland wrote: > > I currently have a base model called Content, with models such as > Article, Image, and Video subclassing Content. Currently, > get_absolute_url works only when it is located in Content - if I try > placing get_absolute_url in any of t

Re: Using Model name in the url

2009-03-10 Thread Michael Strickland
It seems to be working now... I can't say what went wrong, however - the legacy code I copied over looked exactly the same as the current code :/. But thanks! -Michael On Mar 10, 8:44 pm, Alex Gaynor wrote: > On Tue, Mar 10, 2009 at 7:40 PM, Michael Strickland > wrote: > > > > > > > I currentl

Re: [XP] Django 1.0.2 Final fails to install

2009-03-10 Thread Karen Tracey
On Tue, Mar 10, 2009 at 11:57 AM, Vincent wrote: > I have ActivePython 2.5.1.1 installed on an XPSP2 host. I downloaded > and untarred Django 1.0.2 Final, but when I type "setup.py install", I > get the following error: > > === > C:\Downloads\Django-1.0.2-final>setup.py install > Traceback (m

Re: Mod_python configuring to apache..

2009-03-10 Thread Karen Tracey
On Tue, Mar 10, 2009 at 7:56 PM, x_marine wrote: > > I've instaled Django 1.0.2 and I'm having problems configuring it with > Apache at the httpd.conf > Everying Else is up and running except localhost fail to run but > 127.0.01. works!!! instead. > I'm currently using Windows Vista > You're th

Re: Localhost does not work with django web server but works with Tomcat

2009-03-10 Thread Karen Tracey
On Tue, Mar 10, 2009 at 7:12 PM, CG wrote: > > Using dango 1.0.2 final on windows vista. > I have tried starting up tomcat and using http://localhost:8000 and it > shows the tomcat default page which means localhost is being resolved > correctly on the machine. > Any ideas why I am not able to us

Re: Using Model name in the url

2009-03-10 Thread Michael Strickland
So I've actually run into a new problem: declaring the permalink for only the inherited models works fine, but whenever I query the database using the base model's manager (so I can get results from all of the inherited models), the resulting objects that are returned use the base model's permalin

Filter ALL requests before dispatching via URLs.py?

2009-03-10 Thread Joshua K
Hello, Is there a way to filter all requests before URLS.py dispatches the request? I am developing a Pinax application. I have some custom menu tabs across the top, and I limit the visibility of those tabs depending on flags present in the user's account. I do this by enabling custom fields i

Re: Filter ALL requests before dispatching via URLs.py?

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 10:18 PM, Joshua K wrote: > > Hello, > > Is there a way to filter all requests before URLS.py dispatches the > request? > > I am developing a Pinax application. I have some custom menu tabs > across the top, and I limit the visibility of those tabs depending on > flags pr

Re: Filter ALL requests before dispatching via URLs.py?

2009-03-10 Thread Chris Czub
What you are describing are Django "Context Processors". http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#id1 Basically you'd make a new context processor to set the variables you need in your context and have it included for all of your views. You can do this on an applicat

Re: Filter ALL requests before dispatching via URLs.py?

2009-03-10 Thread Malcolm Tredinnick
On Tue, 2009-03-10 at 20:18 -0700, Joshua K wrote: > Hello, > > Is there a way to filter all requests before URLS.py dispatches the > request? > > I am developing a Pinax application. I have some custom menu tabs > across the top, and I limit the visibility of those tabs depending on > flags pr

view help

2009-03-10 Thread nixon66
I'm trying to filter information for a page by year and can't seem to get the view to work correctly. The view below should get the list of counties and years so that I can show detailed information for vendors by year. The url seems to work but I get a page without vendor data. Could anyone point

  1   2   >