Re: Creating an empty queryset

2007-01-10 Thread Adam Seering
I would strongly second that. This seems to have fallen somewhat dead, though. Any thoughts?; anyone in favor of it?; anyone know of any reasons not to do it? Adam On Dec 27, 2006, at 1:42 PM, Adrian Holovaty wrote: > > On 12/27/06, medhat <[EMAIL PROTECTED]> wrote: >> Is there a way to

Re: Creating an empty queryset

2007-01-10 Thread Michael Radziej
Adam Seering schrieb: > I would strongly second that. This seems to have fallen somewhat > dead, though. Any thoughts?; anyone in favor of it?; anyone know of > any reasons not to do it? +1 from me. I have already missed it several times. The "where 1=0 solution" looks stupid. And the chan

Re: Proposed Changes

2007-01-10 Thread David Cramer
select_related() info moved: http://groups-beta.google.com/group/django-developers/browse_thread/thread/400bcdee7fedbb15?hl=en On Jan 10, 8:37 am, "David Cramer" <[EMAIL PROTECTED]> wrote: > http://dpaste.com/hold/4539/ > > I think I still have an issue with related fields that werent included >

Python 2.5

2007-01-10 Thread Carl Holm
Hello, After attempting to run Django with Python 2.5, I get the following after trying to connect: to dev server: 'Error loading MySQLdb module: No module named _mysql' Any further info would be appreciated. - CL --~--~-~--~~~---~--~~ You receiv

Re: Django and the magic reappearing debug flag

2007-01-10 Thread [EMAIL PROTECTED]
*bump* Any ideas? this is driving me nuts.. --Simon --~--~-~--~~~---~--~~ 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 thi

Re: Python 2.5

2007-01-10 Thread Brett Parker
On Wed, Jan 10, 2007 at 02:21:38AM -0800, Carl Holm wrote: > > Hello, > > After attempting to run Django with Python 2.5, I get the following > after trying to connect: to dev server: > > 'Error loading MySQLdb module: No module named _mysql' > > Any further info would be appreciated. L

Re: sorting the results of a queryset

2007-01-10 Thread Rob Slotboom
Sorted works great but I have problems using it im my custom manager. I'm trying and trying but I can't figure out how to handle the following situation. class SortedTestcatManager(models.Manager): def get_query_set(self): QS = super(SortedTestcatManager, self).get_query_set() SQS

Hi! Here's a new Django beginner with a few questions.

2007-01-10 Thread Sebastien Armand [Pink]
Hello everyone, I'm new to Django and trying to set up a small website with it. I've only started creating the model and already got a few troubles! 1. I need to relate an object to itself! For example if my object is a Person, I want to have a field mother which will be the key of an other Perso

Re: Hi! Here's a new Django beginner with a few questions.

2007-01-10 Thread Ivan Sagalaev
Sebastien Armand [Pink] wrote: > class Person(models.Model): > ... > mother = models.ForeignKey('Person') > ... > > Will this work? Use models.ForeignKey('self') > For example if I've got a Body class and a Legs class, I know that I'll > never have a body with more than 2 legs Did

Re: Django i18n How

2007-01-10 Thread johnny
I have read the django book at djangobook.com. What I wanted to know now is, how the database content related to the i18n handled. Do I have to create a separate tables for each language. I have looked at symfony-project.com i18n http://www.symfony-project.com/book/trunk/i18n, a php framework,

Re: Hi! Here's a new Django beginner with a few questions.

2007-01-10 Thread Sebastien Armand [Pink]
"Did you know about mutation? :-)" I was expecting this one! Well thanks a lot!! 2007/1/10, Ivan Sagalaev <[EMAIL PROTECTED]>: > > > Sebastien Armand [Pink] wrote: > > class Person(models.Model): > > ... > > mother = models.ForeignKey('Person') > > ... > > > > Will this work? > > Use

Query: Follow foreignkeys?

2007-01-10 Thread Adam Seering
Hi, I have two models, A and B. A.anchor is a foreignkey to B. I currently have the following code: B.objects.filter(id__in=[ x.anchor for x in A.function_that_applies_filter_to_A(data) ]) function_that_applies_filter_to_A is defined elsewhere, and I'm really not

sql debug

2007-01-10 Thread sandro.dentella
I'd like to know if it is possible to print the sql statement *before* issuing it, just to play with queryset and filtering. By the way I'm sure I read about the possibility to use cursor.queries, if DEBUG == True but I cant' find where I read it. Anyhow I'd prefer the first solution. TIA sandro

solidDB and Django

2007-01-10 Thread David Cramer
As we were having issues lately with handling database load, I'm looking at alternatives for MySQL/Innodb in the future. One thing that came up was solidDB. I'm curious as to if this would be possible to use with Django, or if anyone has used this in the past and has experiences they could tell ab

Starting with Django

2007-01-10 Thread [EMAIL PROTECTED]
Hi, I'm a C++, Delphi programmer. I've some quite large applications win32. I want to move on to web development. I already have some good experience in Python , and I just love this language really simple, elegant and powerful. For example a school management software, that is quite extensive. I

@login_required problem

2007-01-10 Thread [EMAIL PROTECTED]
HI, I am getting the old 'current transaction is aborted' when trying to process @login_required. basically I have a view method: @login_required def index(request): if request.GET.has_key('screen'): screen = request.GET['screen'].lower() else: screen = 'main' if scr

media files during developments

2007-01-10 Thread archie
Hi guys, I'm new to python & django but fascinated by the framework. I'm coming from C++ background so I know very little about web programming and it looks like python and django are quite smart tools for it. Few days into django and everything looks fine. However I have a little problem I don't

developing a new ajax website: places2go.org. some comments apreciated.

2007-01-10 Thread pedro
Hello guys, http://www.places2go.org: is a new site i'm developing, already available in a beta version. It allows you to store your favorite places in your home town or anywhere in the world. The initial idea was to do something like delicious but for physical places. You add places you like a

watched items and content type

2007-01-10 Thread [EMAIL PROTECTED]
I'm trying to allow users to watch items, and have that working. Problem is, on the template I want to sort by content type and have a header for each one, something like: Foo: item 1 item 2 Bar: item 1 item 2 In the model, I've established a generic relation: class Watch(models.Model)

Design Q: binding of model attributes to admin application

2007-01-10 Thread [EMAIL PROTECTED]
Hi guys, I'm writing a Django application that will introspect the available model in order to generate a graphical representation. The admin application also has to introspect, but it has the advantage that you can pass it directives for each field via keyword arguments when you declare them in

dividing up views.py into multiple files

2007-01-10 Thread Stefan Foulis
I searched around the django documentation and didn't find anything about this... what I'm trying to do is divide up the views.py file into multiple files because the single views.py file in some of my apps is getting very cluttered. I tried just making a views subdirectory and then placin

Design Q: Foreign keys from object.values()

2007-01-10 Thread [EMAIL PROTECTED]
Hi guys, I'm trying to get a better grip on Django design philosophy, and I'm a little confused as to why calls to a manager's " values() " function returns foreign keys as the value of their primary key rather than as django objects. For example: class Author (models.Model) : name = CharFiel

Re: dividing up views.py into multiple files

2007-01-10 Thread Nathan R. Yergler
Did you add a file named __init__.py to the views directory you created? This file tells Python to treat the directory as a package and allow traversal into the view file. NRY Stefan Foulis wrote: > I searched around the django documentation and didn't find anything > about this... > > what

Re: Python 2.5

2007-01-10 Thread Jeremy Dunck
On 1/10/07, Carl Holm <[EMAIL PROTECTED]> wrote: > After attempting to run Django with Python 2.5, I get the following > after trying to connect: to dev server: > > 'Error loading MySQLdb module: No module named _mysql' > > Any further info would be appreciated. OS? --~--~-~--~~

Re: Design Q: Foreign keys from object.values()

2007-01-10 Thread Ivan Sagalaev
[EMAIL PROTECTED] wrote: > Hi guys, > > I'm trying to get a better grip on Django design philosophy, and I'm a > little confused as to why calls to a manager's " values() " function > returns foreign keys as the value of their primary key rather than as > django objects. For example: > > class

Re: media files during developments

2007-01-10 Thread Jeremy Dunck
On 1/9/07, archie <[EMAIL PROTECTED]> wrote: > In the settings.py file I set the MEDIA_ROOT to be the one > where the css is and I added to urls the command > (r'^site_media/(.*)$', Where django.views.static, {'document_root': > settings.MEDIA_ROOT, 'show_indexes': True}). > However no sign of dja

Re: solidDB and Django

2007-01-10 Thread Michael Radziej
David Cramer schrieb: > As we were having issues lately with handling database load, I'm > looking at alternatives for MySQL/Innodb in the future. One thing that > came up was solidDB. I'm curious as to if this would be possible to use > with Django, or if anyone has used this in the past and has

Django Projects and Subversion

2007-01-10 Thread Aidas Bendoraitis
I have an SVN-specific question which doesn't really fit into Django groups. Anyway, maybe somebody of you will have enough experience and competence to answer it. We are going to set our Django projects under version control on a dedicated server. We will also publicly run several Django website

Re: Design Q: binding of model attributes to admin application

2007-01-10 Thread Michael Radziej
Hi George, are you aware about the graphviz thing that does just what you are writing? http://code.djangoproject.com/wiki/DjangoGraphviz So long, Michael -- noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg - Tel +49-911-9352-0 - Fax +49-911-9352-100 http://www.noris.de - The

Re: dividing up views.py into multiple files

2007-01-10 Thread Rubic
Stefan Foulis wrote: > what I'm trying to do is divide up the views.py file into multiple > files because the single views.py file in some of my apps is getting > very cluttered. > > I tried just making a views subdirectory and then placing multiple > files with groups of views inside Ditto to wh

Re: Django Projects and Subversion

2007-01-10 Thread Julio Nobrega
What if someone commits something that brakes the live website? My recommendation is to checkout into the live folders the version/tag/branch you want. Or checkout somewhere, test the app, and then copy the files. Just don't run the website from a codebase where developers are commiting. On

Re: Django i18n How

2007-01-10 Thread Adrian Holovaty
On 1/10/07, johnny <[EMAIL PROTECTED]> wrote: > I have read the django book at djangobook.com. What I wanted to know > now is, how the database content related to the i18n handled. Do I > have to create a separate tables for each language. I have looked at > symfony-project.com i18n > http://ww

Re: Design Q: Foreign keys from object.values()

2007-01-10 Thread Kai Kuehne
Hi George, On 1/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > class Author (models.Model) : > name = CharField(maxlength=100) > class Story (models.Model) : > author = ForeignKey(Author) What about a relation, hm? :) Kai --~--~-~--~~~---~--~~ You re

Re: Removing SQL From Templates

2007-01-10 Thread Gustavo Picon
Why don't you just generate lists and dictionaries in the view and send those to your templates instead of data objects? -- Gustavo Picon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: Removing SQL From Templates

2007-01-10 Thread David Cramer
> Why don't you just generate lists and dictionaries in the view and send > those to your templates instead of data objects? I like having access to the models attributes, such as get_absolute_url, we use things like this quite a bit in our templates > 1. It'd be pretty easy to write a template t

Re: solidDB and Django

2007-01-10 Thread David Cramer
I've actually run out of ways I can optimize the database and I'm looking in the future. Most pages, after they've been cached, are cut down to 1-3 queries, the problem is we're a very dynamic content site so the cache has to be refreshed quite often. On Jan 10, 4:27 pm, Michael Radziej <[EMAIL P

Re: sql debug

2007-01-10 Thread James Bennett
On 1/9/07, sandro.dentella <[EMAIL PROTECTED]> wrote: > I'd like to know if it is possible to print the sql statement *before* > issuing it, just to play with queryset and filtering. If you don't mind delving a bit into the code, you'll find that the QuerySet class has a '_get_sql_clause' method

Re: Convert From Restructured Text to HTML

2007-01-10 Thread Stephen Mizell
So it seems the issue is with the restructured text. When using the restructured text filter on a template, it works just fine. When using restructured text in a view, it gives me tons of errors. Any ideas? --~--~-~--~~~---~--~~ You received this message becau

Re: Design Q: binding of model attributes to admin application

2007-01-10 Thread [EMAIL PROTECTED]
Beautiful; thanks! But this tool never asks questions about a field other than what its type is. Does anyone have an app that makes use of additional information in the model, such as additional keyword arguments to the field class or attributes added after field definition? --~--~-~--

Re: dividing up views.py into multiple files

2007-01-10 Thread Stefan Foulis
thanks for the reply... adding the empty __init__.py file worked. I like Rubics idea aswell. Importing extra utilities could prove very flexible. thanks again :) -- stefan On Jan 10, 2007, at 15:54, Nathan R. Yergler wrote: > > Did you add a file named __init__.py to the views directory you

Re: Design Q: Foreign keys from object.values()

2007-01-10 Thread [EMAIL PROTECTED]
Thanks; this works for me -- though I have to do Author.objects.filter(story__id__isnull=False).distinct() Or it repeats each author for each of his stories. This still confuses me, because there is no "story" field in the Author model to specify how to do the join (Author:Story is One:Man

Re: sorting the results of a queryset

2007-01-10 Thread Brian Beck
Rob Slotboom wrote: > Because I cant handle my prefered sorting in a query, I need to sort > the result afterward. > I could define some other functions in the custom manager to handle all > and filter > But this isn't a solution: > > allcats = Cat.sorted_objects.all() > allcats.filter(var='val')

Re: In Model or Manager? (Sorting, calculations, and non-savable fields)

2007-01-10 Thread ringemup
Thanks, that helps. I like that there are multiple ways to do things. Hopefully with a little more experience I'll have a better idea of where to put things for best re-usability. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: edit_inline disables slug prepopulation?

2007-01-10 Thread ringemup
Hmmm... I suppose this could also be done by overriding the save() method to generate a slug if there isn't one already? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Django made a mistake by not serving static file ?

2007-01-10 Thread pragmaticObjects
I think it might be a mistake that Django does not want to serve static file. Here's what I mean. When I switch to SSL mode (thanks to the SSLMiddleware by Anotnio Cavedoni), since not the entire page is served by Django (i.e. some images are from the admin media), so Firefox, for example does not

Re: Django made a mistake by not serving static file ?

2007-01-10 Thread Jeremy Dunck
On 1/10/07, pragmaticObjects <[EMAIL PROTECTED]> wrote: > To the casual users who are trained > to look for those security indicators on the browsers but do not > understand better, they get paranoid. It's not just casual users. Serving any part of a page out of SSL is insecure. Media not served

Re: Design Q: Foreign keys from object.values()

2007-01-10 Thread Ivan Sagalaev
[EMAIL PROTECTED] wrote: > Thanks; this works for me -- though I have to do > > Author.objects.filter(story__id__isnull=False).distinct() > > Or it repeats each author for each of his stories. > > This still confuses me, because there is no "story" field in the Author > model to specify ho

Re: Django made a mistake by not serving static file ?

2007-01-10 Thread Waylan Limberg
On 1/10/07, pragmaticObjects <[EMAIL PROTECTED]> wrote: > > I think it might be a mistake that Django does not want to serve static > file. Here's what I mean. When I switch to SSL mode (thanks to the > SSLMiddleware by Anotnio Cavedoni), since not the entire page is served > by Django (i.e. some

quick admin view question

2007-01-10 Thread Mae
Hi all, This might have been answered before, but I can't seem to find the answer. If I'm repeating another topic, I apologize in advance. Here's what I'd like to do: I have a model that goes: # represents a reference document in the library class Reference(models.Model): name = models

Announce: Portable Python v1.0 beta

2007-01-10 Thread Perica Zivkovic
Hi there, I would like to announce the *first* beta release of the Portable Python 1.0 beta. From today Portable Python website is also online and you can find it on the location www.PortablePython.com. About: Portable Python is a Python programming language preconfigured to run directly from a

Re: quick admin view question

2007-01-10 Thread Mae
Oh, that's exactly what I was looking for! W! Thank you, Mae --~--~-~--~~~---~--~~ 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 unsubsc

Re: quick admin view question

2007-01-10 Thread Honza Král
have a look at verbose_name: http://www.djangoproject.com/documentation/model_api/#verbose-name class Meta: verbose_name = 'Some Fancy Title' On 1/10/07, Mae <[EMAIL PROTECTED]> wrote: > > Hi all, > > This might have been answered before, but I can't seem to find the > answer. If I'm repe

Re: developing a new ajax website: places2go.org. some comments apreciated.

2007-01-10 Thread Vadim Macagon
So it's built on Rails and you're spamming the Django group? -+ enlight +- pedro wrote: > Technically, the site is built on Rails and i try to use AJAX as much > as > possible to make it as simple to use as possible. --~--~-~--~~~---~--~~ You received this me

Re: Convert From Restructured Text to HTML

2007-01-10 Thread Stephen Mizell
Well, I gave up on the automation. I couldn't get restructuredtext to work right in my views, so I swallowed my pride and went into copy/paste mode. I simple did this: {% load markup %} {% for post in posts %} {{ post.id }}

error: (32, 'Broken pipe')

2007-01-10 Thread David Abrahams
I see this often when running the development server. All the pages seem to render correctly. Can anyone explain what's going on, and tell me whether I should be concerned? I note that others have asked this question in the past, but the explanation given at http://groups.google.com/group/djan

Re: Convert From Restructured Text to HTML

2007-01-10 Thread James Bennett
On 1/9/07, Stephen Mizell <[EMAIL PROTECTED]> wrote: > This started throwing all kinds of errors at me about encodings, such > as: > 'latin-1' codec can't encode characters in position 19-20: ordinal not > in range(256) Almost every time I've seen this (not quite every time, but almost every time

Re: Convert From Restructured Text to HTML

2007-01-10 Thread Stephen Mizell
That's exactly what happened, but strange thing was it worked just fine using the filter. I even tried making some SQL queries to fix them for me, but that didn't work. Oh well, it's over now ;) On 1/10/07, James Bennett <[EMAIL PROTECTED]> wrote: > > > On 1/9/07, Stephen Mizell <[EMAIL PROTECTE

Re: Design Q: Foreign keys from object.values()

2007-01-10 Thread George Davis
Great -- 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 from this group, send email to [EMAIL PROTECT

Re: Announce: Portable Python v1.0 beta

2007-01-10 Thread Jeremy Dunck
On 1/10/07, Perica Zivkovic <[EMAIL PROTECTED]> wrote: > I would like to announce the *first* beta release of the Portable > Python 1.0 beta. From today Portable Python website is also online and > you can find it on the location www.PortablePython.com. Very nice, thanks. :) --~--~-~--~

Re: developing a new ajax website: places2go.org. some comments apreciated.

2007-01-10 Thread [EMAIL PROTECTED]
On Jan 10, 9:22 pm, Vadim Macagon <[EMAIL PROTECTED]> wrote: > So it's built on Rails and you're spamming the Django group? It must be to show how slow it is compared to Django! :) L. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Importing models from outside applications

2007-01-10 Thread Russell Keith-Magee
On 1/10/07, johnnie pittman <[EMAIL PROTECTED]> wrote: > I'm looking to find out if there's a method to access django models in other > applications outside of the django project structure. What I'm looking to > do is import a model from one of the apps in my project: > > from project.app impor

Re: Creating an empty queryset

2007-01-10 Thread Russell Keith-Magee
On 1/10/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > > Adam Seering schrieb: > > I would strongly second that. This seems to have fallen somewhat > > dead, though. Any thoughts?; anyone in favor of it?; anyone know of > > any reasons not to do it? > > +1 from me. I have already missed it sev

Re: Importing models from outside applications

2007-01-10 Thread Waylan Limberg
On 1/10/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 1/10/07, johnnie pittman <[EMAIL PROTECTED]> wrote: > > > I'm looking to find out if there's a method to access django models in other > > applications outside of the django project structure. What I'm looking to > > do is import

Re: Hi! Here's a new Django beginner with a few questions.

2007-01-10 Thread Kenneth Gonsalves
On 10-Jan-07, at 6:13 PM, Sebastien Armand [Pink] wrote: > class Person(models.Model): > ... > mother = models.ForeignKey('Person') yes or use 'self' -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ Y

Re: Django Projects and Subversion

2007-01-10 Thread Kenneth Gonsalves
On 10-Jan-07, at 8:58 PM, Aidas Bendoraitis wrote: > We are going to set our Django projects under > version control on a dedicated server. We will also publicly run > several Django websites on the same server. So what is a better > practice -- to use the code under source > control for the pub

Re: Importing models from outside applications

2007-01-10 Thread johnnie pittman
Hey Russ and Waylan, Thanks for the responses. Russ, I actually did that: import sys sys.path.append("path/to/project") from project.app import models complained about environment settings. But when I dug into fixing that, I over complicated the matter. Waylan's response saw through my over c

form_for_model and default values

2007-01-10 Thread [EMAIL PROTECTED]
Hi everybody, I'm newbie at django but I think is awesome. I use newforms and I had two questions: 1) I have a model with a FileField so everything at the admin interface works fine, but when I get the form using form_for_model the widget isn't a FileInput(). Is this the right behaviour? or it's

Re: Django Projects and Subversion

2007-01-10 Thread Cam
To deploy into production you should run all tests, tag a release and have the webserver check out your tag. cheers, Cam. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

<<= END OF THE WORLD =>>

2007-01-10 Thread SHEETAL
[image: Ending Began]End of the World !!! Begins[image: Ending Began] [image: Cracking Starts]<

Differences between two methods of declaring a decorator

2007-01-10 Thread Collin Grady
While not strictly a django issue, this is relating to a ticket I found when looking into why login_required won't accept a login_url param. In http://code.djangoproject.com/ticket/903 Adrian says that changing the definition would break backwards compatibility, and not knowing tons about python,

Empty related sets = Page not found?

2007-01-10 Thread John M
OK, again I'm stumpped. I have the following models: class Portfolio(models.Model): user= models.ForeignKey(User) description = models.CharField(maxlength=50) notes = models.CharField(maxlength=200) class Holding(models.Model): porfolio = models.Fo

Re: Empty related sets = Page not found?

2007-01-10 Thread Brian Beck
Hi, object_list takes an allow_empty argument, try settings it to True. >From the docs: allow_empty: A boolean specifying whether to display the page if no objects are available. If this is False and no objects are available, the view will raise a 404 instead of displaying an empty page. By defa

Re: Empty related sets = Page not found?

2007-01-10 Thread John M
Brian Beck wrote: > Hi, > > object_list takes an allow_empty argument, try settings it to True. > >From the docs: > > allow_empty: A boolean specifying whether to display the page if no > objects are available. If this is False and no objects are available, > the view will raise a 404 instead of

Re: Empty related sets = Page not found?

2007-01-10 Thread John M
Yup, that did it! Thanks again Brian! --~--~-~--~~~---~--~~ 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 e

Re: @login_required problem

2007-01-10 Thread Collin Grady
I don't know about your issue, but I wanted to offer you a little nifty thing about dicts that might shrink your view a bit :) Instead of an if/else to have a default value, use .get() on the dict, like so: screen = request.GET.get('screen', 'main') If the key "screen" exists, it returns that,