Re: Multiple one-to-one relationships for a single class

2007-08-31 Thread pength
I am not very sure if I have any misunderstanding about your situation, but I am doing a similiar "multi-oneotoone-relation" in my project. My models are like these: class Daemon_Event_List(models.Model): ###this is a basic event list, but only record the event time event_type = models.Positi

Add a FREE text link to your web site!!!!

2007-08-31 Thread harry
Add a FREE text link to your web site: http://mmo.isgreat.org/modules.php?name=Web_Links --~--~-~--~~~---~--~~ 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@googl

Re: Unicode JSON Serialization Bug?

2007-08-31 Thread mynameisgabe
After doing more searching I ran across this post, claiming that the ensure_ascii argument was worthless and caused the bug. I removed it from the argument list and all is well!! http://groups.google.com/group/django-users/browse_thread/thread/87b1478c02d743e0/e4849fcf74147466?lnk=gst&q=unicode+

Re: Unicode JSON Serialization Bug?

2007-08-31 Thread mynameisgabe
Does anyone have any idea about this one? I'm kind of in a bind on this one. Thanks! Gabe On Aug 30, 2:12 pm, mynameisgabe <[EMAIL PROTECTED]> wrote: > Hello All- > > I've been told that I may have encountered abug- I'm trying to > serialize a model that includes fields that could beunicodedat

500 error email to admins - user information is missing...

2007-08-31 Thread Udi
If a user was authenticated at the time of the error, it would be great to know who it was so we can let them know when the problem is fixed. I see the request object has 'REMOTE_USER': self._req.user, in meta, but I'm getting None there despite the fact that only authenticated users are us

Re: DRY violation: site name in project files

2007-08-31 Thread James Bennett
On 8/31/07, Davidov <[EMAIL PROTECTED]> wrote: > This means that project should have some knowledge about parent site. > This makes it difficult to move projects from site to site. Also this > violates DRY (you have to write site name again). For sake of convenience, the tutorial walks you throug

Re: auth.view.login acting very weird

2007-08-31 Thread James Bennett
On 8/31/07, jfagnani <[EMAIL PROTECTED]> wrote: > I can't figure out what's going on, the form obviously works in some > circumstances, and the log-in data is also correct. You're running into the issue in ticket #3393[1]. I keep meaning to put together a better patch, but other things keep comin

Re: Django-based forum software?

2007-08-31 Thread Jonathan Buchanan
Aaron Maxwell wrote: > Hi, > > Does anyone know of a django forum app? I.e., to build a site providing a > user forum. > > This is kind of hard to search on - try googling for "django forum"... > I've been hacking on a forum app [1] (because the world really needs another one) over the last

Re: template context issue with "with"

2007-08-31 Thread omat
Thanks for the reply Alex... I appended the user_answer as an attribute to the Question() QuerySet and it works fine now. That's one of the things I love about Django: It enforces better design... On 31 Ağustos, 21:40, Alex Koshelev <[EMAIL PROTECTED]> wrote: > {%with%} tag creates only alias

Re: send_mail() doesn't handle extra headers?

2007-08-31 Thread Alex Koshelev
Yes, you may use EmailMessage class that is more flexible then send_mail function http://www.djangoproject.com/documentation/email/#the-emailmessage-and-smtpconnection-classes --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: DRY violation: site name in project files

2007-08-31 Thread Alex Koshelev
This is not site name, it is project name. This is a big difference. You can skip project name and write only app_name.module_name but this is not save and can cause name conflict. No, it doesn't make any difficult to move into another production environment. You can make application sets with som

send_mail() doesn't handle extra headers?

2007-08-31 Thread Greg Donald
I don't see a way to add extra headers to send_mail(), so what's the best way to add them otherwise? I started digging through the Django source and found send_mail() calls EmailMessage() where it looks like I can probably add most everything I need. Am I headed down the right path or is there a

DRY violation: site name in project files

2007-08-31 Thread Davidov
Hello, I am learning Django now. It's seems very strange to me that in tutorial (http://www.djangoproject.com/documentation/tutorial03/) view file contains line like this: from mysite.polls.models import Poll This means that project should have some knowledge about parent site. This makes it diff

Re: auth.view.login acting very weird

2007-08-31 Thread jfagnani
I don't think that's it, as the full login page I'm referring to isn't the admin login, but my own login.html template based on the example in the authentication docs: http://www.djangoproject.com/documentation/authentication/#the-login-required-decorator Logging in from that template works every

Re: admin site and parent/child relationship

2007-08-31 Thread Ariel Mauricio Nunez Gomez
Have you looked at the admin filter option, it's not exactly waht you're asking for, but could do the job? In the admin view (change_list for call ) if you append: ?client=MyClient to the url, the data get's filtered. --~--~-~--~~~---~--~~ You received this messag

Re: newforms.form_for_model() does not map CharField with choices into SELECT

2007-08-31 Thread picky
I found it. In seems this fonctionnality works only with dev version (0.97pre). PIcky On 31 août, 15:04, picky <[EMAIL PROTECTED]> wrote: > I have exactly the same problem. > > Hope someone could help. > > On 27 août, 22:03, sagi s <[EMAIL PROTECTED]> wrote: > > > I am generating a form for a mo

Re: auth.view.login acting very weird

2007-08-31 Thread Florian Apolloner
Yeah one idea: Is what the default admin login page contains, so maybe adding this will be enough, or you would need to write a custom view (I am a little bid concerned about the post_data as it seems to be some random string for security). Florian On Aug 31, 9:23 pm, jfagnani <[EMAIL

ObjectPaginator Performance in Busy Sites

2007-08-31 Thread Sebastian Macias
I'm building an app that requires pagination. I looked at the official pagination documentation I found at: http://www.djangoproject.com/documentation/models/pagination/ I followed the tutorial and basically: paginator = ObjectPaginator(Article.objects.all(), 5) is where all the "magic" happens.

Re: ObjectPaginator Performance in Busy Sites

2007-08-31 Thread James Bennett
On Aug 31, 9:11 pm, Sebastian Macias <[EMAIL PROTECTED]> wrote: > What I'm concerned about is that Article.objects.all() will return a > query_set with all of the records. If I have millions of records it > means the returned query_set will be huge and I'm affraid performance > will be poor in and

Re: ObjectPaginator Performance in Busy Sites

2007-08-31 Thread Florian Apolloner
There should be no problem at all (taken from the paginator source http://code.djangoproject.com/browser/django/trunk/django/core/paginator.py#L39): An queryset like Category.objects.all() would result in (see above link): >>> from django.db import connection >>> Category.objects.all()[5:10] [, ,

auth.view.login acting very weird

2007-08-31 Thread jfagnani
I'm trying to add a login widget to a site that will appear on every page for an unauthenticated user, much like on slashdot. It seems pretty straight forward, but I'm getting some really strange behavior from django.contrib.auth.views.login My widget consists of a form like this: Username: Pa

Re: template context issue with "with"

2007-08-31 Thread Alex Koshelev
{%with%} tag creates only alias to variable. You cannot use it as parameter and "regular" context variable too. So you have to redesign you code. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: admin site and parent/child relationship

2007-08-31 Thread Diego
Si, disculpame. Ej: cliente y llamadas del cliente La interface admin automatica genera interfaces para clientes y para llamadas, yo quiero que un usuario al seleccionar un cliente, pueda acceder a las llamadas hechas por el cliente (mediante un link), es decir que vea las llamadas hechas solo po

template context issue with "with"

2007-08-31 Thread omat
Hi, In a template context, I have: - user_answers, that hold previously given answers by the user in a format like: {1:'yes', 2:'yes', 3:'no'}, where 1,2 & 3 are the question ids. - question, that is a Question() instance When displaying a list of questions, I would like to check if the question

Re: admin site and parent/child relationship

2007-08-31 Thread Lic. José M. Rodriguez Bacallao
podrias ser un poco mas explicito, entiendo vagamente tu idea, podrias ponerme un ejemplo? On 8/31/07, Diego <[EMAIL PROTECTED]> wrote: > > > Hola José, necesito representar un modelo similar al Country/State, > pero quiero que a un determinado State se acceda solo a traves de la > interface del C

Re: ManyToManyField and order_by

2007-08-31 Thread Viraj Alankar
Anyone have ideas on this? I can do it with extra(): http://www.djangoproject.com/documentation/db-api/#extra-select-none-where-none-params-none-tables-none But this is seems bad to resort to sql. This seems like such a common operation to do. Thanks, Viraj. On Aug 24, 2:13 pm, Viraj Alankar

detecting when loading a fixture in the post_save signal

2007-08-31 Thread Graham Carlyle
I'm writing an application which has some of its data translated to different languages. I've achieved this with a corresponding model to each main model that just holds translated data, much like the django-multilingual library (on google code). But much of my data is not translated and so I

Re: newforms form processing

2007-08-31 Thread Tim Chase
> How can i best program a view that both adds and updates certain > values in a table. I know that django can tell the difference when you > want to update and when to insert. I tried using the > Classname.objects.create(args)...but this doesn't seem to work...it > just inserts instead of updatin

django facebook app

2007-08-31 Thread [EMAIL PROTECTED]
I'm looking for someone to build a facebook app for my django based site. If anyone is interested, please send me a private message. Thanks, Mike Howsden --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: WordPress to Django Migration App

2007-08-31 Thread Peter Baumgartner
Practically, you should just build your own app and manually import your data. WPs database structure is less than ideal. My goal for this app was to lower the bar as much as possible for WP users wanting to try out Django. This is the path of least resistance for WP users to get their feet wet w

Re: Strange encoding behavior

2007-08-31 Thread Anderson Santos
Ahhh, finally! Thank you very much, it worked now =D I didn't know about the __unicode__ trick And I am not sure if it is it that you want to know, but I still not using the encoding header on the top of the files. I thought it was more to the enconding chars of the file and not an advanced set

Web startup looking for Django/Python programmers in Atlanta, GA.

2007-08-31 Thread Richard Coleman
I hope no one minds this job ad. This is the only message I will send about this. If anyone wants additional information, please send me a private email message. I work for a web startup in Atlanta, GA. called WebSingularity. We are a well funded startup that is currently in stealth mode.

newforms form processing

2007-08-31 Thread Rufman
How can i best program a view that both adds and updates certain values in a table. I know that django can tell the difference when you want to update and when to insert. I tried using the Classname.objects.create(args)...but this doesn't seem to work...it just inserts instead of updating a record

models and newforms: exclude one field = one Model attribute

2007-08-31 Thread dwich
Hi boys, hi girls, I would like to ask you if there is a way how can I retrieve model's data except few attributes. I have a model class Example(models.Model): lookup1 = models.ForeignKey(Lookup1) lookup2 = models.ForeignKey(Lookup2) lookup3 = models.ForeignKey(Lookup3)

Re: admin site and parent/child relationship

2007-08-31 Thread Diego
Hola José, necesito representar un modelo similar al Country/State, pero quiero que a un determinado State se acceda solo a traves de la interface del Country al que pertenece. Tenes idea como puedo hacer eso utilizando la interface admin?? Muchas gracias, saludos desde Argentina On 30 ago, 16:0

[no subject]

2007-08-31 Thread Salah U Shamsi
*LEATHER FASHION HAND BAGS/ PURSES** * *Click to Read: * * * *http://www.gobsmack.info/SKD/hand-bags/* * * ** * * --~--~-~--~~~---~--~~ Yo

Re: admin site and parent/child relationship

2007-08-31 Thread Diego
Yes, but my idea is to use admin interface without writing my own views etc, because of I have a lot this similar situations...and I´m new using Django! Thanks On 31 ago, 09:50, eXt <[EMAIL PROTECTED]> wrote: > You can write your own view and template that will implement this > functionality. T

newforms and DateField

2007-08-31 Thread picky
Hi, I would like to know if there is a way to have the same javascript calendar of admin pages when I use newforms from a model containing DateField ? I try to create a form with forms.form_for_model but I just get a text widget for my DateField object. Thanks for your help Picky --~--~-

Re: Django-based forum software?

2007-08-31 Thread [EMAIL PROTECTED]
I'm using a modified (OK, heavily modified) version of diamanda on my site: http://gretschpages.com/forum/ On Aug 31, 3:07 am, "老一套" <[EMAIL PROTECTED]> wrote: > 2007/8/31, Aaron Maxwell <[EMAIL PROTECTED]>: > > > > > Thanks, everyone. > > -Aaron > > > On Thursday 30 August 2007 09:47:41 Aaron Ma

Re: WordPress to Django Migration App

2007-08-31 Thread ludo
On Aug 31, 1:20 pm, Margaret <[EMAIL PROTECTED]> wrote: > If only admin the database of wordpress, why not using mysql admin tools, Because the admin has to perform a few key data manipulations before publishing. And the mysql admin tools have no support for "nice" editing of HTML, and lots of ot

Re: newforms.form_for_model() does not map CharField with choices into SELECT

2007-08-31 Thread picky
I have exactly the same problem. Hope someone could help. On 27 août, 22:03, sagi s <[EMAIL PROTECTED]> wrote: > I am generating a form for a model that contains a CharField withchoices. > According to the documentation I expect to see this > translated into a SELECT form field but all I get i

Re: admin site and parent/child relationship

2007-08-31 Thread eXt
You can write your own view and template that will implement this functionality. Then override Admin's urls with yours for the specific view. For more information look at djangobook.com and find a relevant chapter there. -- Jakub Wiśniowski On 30 Sie, 21:05, "Lic. José M. Rodriguez Bacallao" <[E

Re: HttpMethodsMiddleware and mod_python (REST)

2007-08-31 Thread Benjamin Slavin
On 8/31/07, David Larlet <[EMAIL PROTECTED]> wrote: > > request.method = request.REQUEST[_MIDDLEWARE_KEY].upper() > > AttributeError: can't set attribute > > Hello David, I don't have a mod_python install I can easily test on, but could you try this for me: request._req.method = request.REQUEST

Re: Strange encoding behavior

2007-08-31 Thread Michael Radziej
On Fri, Aug 31, Anderson Santos wrote: > > Here the code: > > > class Download(models.Model): > """ Disponibilização de arquivos para download """ > > descricao = > models.CharField(verbose_name='Descrição',maxlength=250) > data_do_arquivo = models.DateField() > caminho_do_arq

Re: problem with importing "Template" module

2007-08-31 Thread Alex Koshelev
You can do in django interactive shell. http://www.djangoproject.com/documentation/django-admin/#shell Or set DJANGO_SETTINGS_MODULE environment variabale ot your project settings.py http://www.djangoproject.com/documentation/templates_python/#configuring-the-template-system-in-standalone-mode R

Re: Strange encoding behavior

2007-08-31 Thread Anderson Santos
Here the code: class Download(models.Model): """ Disponibilização de arquivos para download """ descricao = models.CharField(verbose_name='Descrição',maxlength=250) data_do_arquivo = models.DateField() caminho_do_arquivo = models.CharField(maxlength=400) atualizar_versao_com

Re: HttpMethodsMiddleware and mod_python (REST)

2007-08-31 Thread David Larlet
2007/8/29, David Larlet <[EMAIL PROTECTED]>: > Hello all, > > I wonder if there is an alternative of the HttpMethodsMiddleware > snippet http://www.djangosnippets.org/snippets/174/ which works with > mod_python because for the moment it raises an AttributeError when you > try to modify the request

Re: problem with importing "Template" module

2007-08-31 Thread James Bennett
On 8/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > can anyone help me? any idea? Read the Django tutorial, which will explain how to create a Django settings file and specify it for use when importing/using parts of Django. -- "Bureaucrat Conrad, you are technically correct -- the best

Re: WordPress to Django Migration App

2007-08-31 Thread Margaret
If only admin the database of wordpress, why not using mysql admin tools, If use django, why not using django replace wordpress. I want to use django development a blog system base on wordpress database,UI. Maybe you like this way. On 8/31/07, ludo <[EMAIL PROTECTED]> wrote: > > On Aug 31, 8:56

problem with importing "Template" module

2007-08-31 Thread [EMAIL PROTECTED]
hi, i am new to Django and i use Python 2.5.1 and Django 0.96(from official package). when i want to import "Template" class at Python interactive interpreter, i get this error: >>> from django.template import Template Traceback (most recen

Re: Releated data from models

2007-08-31 Thread sect2k
I guess was what i was looing for, i wrote a subquery for getting a user's vote and now it works. Thanks. Cheers, Mitja James Bennett wrote: > > > On 8/31/07, sect2k <[EMAIL PROTECTED]> wrote: >> One way of doing it would be to use template tags, but that would amount >> to >> redundant SQL

Re: Releated data from models

2007-08-31 Thread sect2k
Wow, that was fast :) I was just looking at that, but i'm not sure it's what i'm looking for, but then again, i'm both new at django and python, so sometimes i'm a bit lost. the result i would like to get is someting similar to what this query would return: select ss.*, sv.vote from stories_s

Re: non unicode

2007-08-31 Thread Robin Becker
Malcolm Tredinnick wrote: > On Wed, 2007-08-29 at 14:58 +0100, Robin Becker wrote: >> Hi, we're having some troubles with latest django that are caused by the >> switch >> to unicode string output. In particular since we were already carefully >> handling >> the conversion and encoding of the

Re: Preferred way to expand User Model?

2007-08-31 Thread James Bennett
On 8/31/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > There's also a blog entry about this: > > http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model Which reminds me I need to add a link from that entry to the relevant bit in the book. -- "Bureaucrat Conrad, you are tech

Re: Releated data from models

2007-08-31 Thread James Bennett
On 8/31/07, sect2k <[EMAIL PROTECTED]> wrote: > One way of doing it would be to use template tags, but that would amount to > redundant SQL queries for each story. I guess another way of doing it would > be to write custom SQL using JOIN. > > What I would like to know is what is the django way of

Re: Multiple one-to-one relationships for a single class

2007-08-31 Thread Nis Jørgensen
Malcolm Tredinnick skrev: > On Tue, 2007-08-21 at 21:21 -0700, Catriona wrote: > >> What I have is an event which has about 12 fields. Optionally any >> combination of a single weather record, a single event detail record, >> a single survey record and one of four event subclass records may be

Releated data from models

2007-08-31 Thread sect2k
Hi! I have a dilema. I have two models, one is a user (a custom one, not the one from django.contrib.auth), the other one is story model. Since users are able to vote on stories, i also have a vote model, that has two foreign keys (user, story) and also some metadata for the vote (date, type o

Re: Preferred way to expand User Model?

2007-08-31 Thread Michael Radziej
On Fri, Aug 31, Rotlaus wrote: > > On Aug 31, 11:02 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > > > what is the preferred way to expand the user model? I would use a > > > model with a OneToOne Field, but documentation says i should not. What > > > should i do instead? > > > > A foreign key

Re: WordPress to Django Migration App

2007-08-31 Thread ludo
On Aug 31, 8:56 am, "Peter Baumgartner" <[EMAIL PROTECTED]> wrote: > > This will app will hook into an existing WordPress database and create > models for all the relevant content. It provides WP users with an > extremely lazy way to convert their site to Django or could be used to > manage a WP i

Re: Preferred way to expand User Model?

2007-08-31 Thread Rotlaus
On Aug 31, 11:02 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > > what is the preferred way to expand the user model? I would use a > > model with a OneToOne Field, but documentation says i should not. What > > should i do instead? > > A foreign key with unique=True, as covered in the Django boo

Re: Preferred way to expand User Model?

2007-08-31 Thread James Bennett
On 8/31/07, Rotlaus <[EMAIL PROTECTED]> wrote: > what is the preferred way to expand the user model? I would use a > model with a OneToOne Field, but documentation says i should not. What > should i do instead? A foreign key with unique=True, as covered in the Django book. -- "Bureaucrat Conra

Preferred way to expand User Model?

2007-08-31 Thread Rotlaus
Hi, what is the preferred way to expand the user model? I would use a model with a OneToOne Field, but documentation says i should not. What should i do instead? Regards, Andre --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: Django-based forum software?

2007-08-31 Thread 老一套
2007/8/31, Aaron Maxwell <[EMAIL PROTECTED]>: > > > Thanks, everyone. > -Aaron > > On Thursday 30 August 2007 09:47:41 Aaron Maxwell wrote: > > Hi, > > > > Does anyone know of a django forum app? I.e., to build a site providing > a > > user forum. > > > > This is kind of hard to search on - try go

Re: Trigger a django user password change...

2007-08-31 Thread Jens Diemer
Jens Diemer schrieb: > I would like to do something if the django user password has been set or > update. > So i trigger signals.post_save with the User class, like this: > === > from django.db.models import signals > fro