Re: random Unhandled Exceptions

2007-09-12 Thread Peter Baumgartner
On 9/12/07, Iapain <[EMAIL PROTECTED]> wrote: > > It looks like yet another unicode bug. Could you tell me your Django > version. I've tried r6107 and r6050 and both seem to do it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: Temporary access to link in django

2007-09-12 Thread MikeHowarth
I think you may be complicating things unnecesarily by not creating a user. Why not look at creating a temporary user group, and maybe adding an additional check at login if this user is a temporary user, they cannot login 1 month after the date created of the user? On Sep 12, 7:50 am, Przemek G

form_for_instance + user profile

2007-09-12 Thread MikeHowarth
I've had a read through the docs and have created a UserProfile object with a ForeignKey to Djangos User object. What I want to be able to do is load the UserProfile so this can then be edits. I tried this last night (admittedly not very hard) and didn't seem to have any joy. Basic example: us

Re: Temporary access to link in django

2007-09-12 Thread Przemek Gawronski
> I think you may be complicating things unnecesarily by not creating a > user. Well, maybe that's why I'm asking for suggestions :) > Why not look at creating a temporary user group, and maybe adding an > additional check at login if this user is a temporary user, they > cannot login 1 month af

Re: Temporary access to link in django

2007-09-12 Thread Kenneth Gonsalves
On 12-Sep-07, at 1:51 PM, Przemek Gawronski wrote: > My main objection here is the pollution of user table. There > (hopefully) > will be quiet a few registrations. Since there is no need to have any > information about the visitor, after it'll be deleted after a month. take 5 minutes out to

HELP needed POST and Python

2007-09-12 Thread AniNair
Hi... I am trying to learn django and python, using django 0.97 ,pre with python 2.5.1. I am having a bit of a problem with 2 issues. 1. How to use POST? I mean I have a form that takes values. method=POST class Myform (forms.Form): u_email=forms.CharField(initial=ed_user.email) u_add=form

Re: 404 Page Help

2007-09-12 Thread Ryan K
Ok...so how do I pass my 'site_context' dictionary (which is just a dict with URL prefixes in it for static media) to the default 404 handler? On Sep 12, 4:24 am, Collin Grady <[EMAIL PROTECTED]> wrote: > You don't need a custom 404 handler in order to use RequestContext - > the default handler a

Re: 404 Page Help

2007-09-12 Thread Ryan K
Ok...nevermind. Jake is righttemplate context processors are my friend. Thanks! On Sep 12, 10:06 am, Ryan K <[EMAIL PROTECTED]> wrote: > Ok...so how do I pass my 'site_context' dictionary (which is just a > dict with URL prefixes in it for static media) to the default 404 > handler? > > On Se

Re: django-rendertext released

2007-09-12 Thread Ole Laursen
On 11 Sep., 13:55, AndyB <[EMAIL PROTECTED]> wrote: > Incidentally have you considered using a variant of the alt text as > the image filename rather than your GUID type filename? There may be > slight accessibility/SEO advantages to this. My primary concern is that the text might contain somethi

Re: Email model

2007-09-12 Thread wiz
On 9/11/07, Collin Grady <[EMAIL PROTECTED]> wrote: > > You are likely going to have to write that sort of app yourself. Or use dbmail as mail catcher to automaticaly catch all mail. Then you'll need only to tweak inspectdb's interfaces to dbmails' tables. --~--~-~--~~~---

Weird problem with Flatpages

2007-09-12 Thread shabda
I have deployed a app on Apache with mod_python. I have the flat pages app+middleware installed. If I let debug = True in my settings.py and try to access any flatpage url they work fine. But if I put the debug = False in settings.py, the flatpages return 500 http respnse. Any way I can try to deb

Re: Temporary access to link in django

2007-09-12 Thread Przemek Gawronski
> take 5 minutes out to create a temp user model and table You're suggesting to extend the User model? Something like: class TempUser(models.Model): user = models.ForeignKey(User) ... Przemek -- AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin info: http://tanr

I wrote about getting gettext set up properly on Mac OS X for the Django internationalization and like to share it with you.

2007-09-12 Thread Bert Heymans
I wrote about how I got gettext to work Mac OS X and just wanted to share it here on the Django users list. Here's the article: http://blog.heymans.org/index.php/2007/09/12/gettext-on-mac-os-x-for-an-internationalized-django/ Hope it can serve somebody, didn't find anything about it in the Djan

Re: Django deployment à lá Capistrano

2007-09-12 Thread Chris Hoeppner
El mar, 11-09-2007 a las 12:26 -0700, Jonas escribió: > Before that someone starts working about this, you must consider this: > > 1. It's already has been created a project with that intention. Its > name is capystrano [1] and althought has been not uploaded code -he > could be working offline-,

Dynamic newform and model constraints

2007-09-12 Thread PlanarPlatypus
I am making a build database where each product which can be built has come components which are required to build it. These components in turn have versions which are required for a particular build. The relevant parts of the models are reproduced below. class Component(models.Model): name

newb error: django tut 1 error with Opera

2007-09-12 Thread swivelhead
I got Django running at home and work, very easy BTW. However, the one hitch that I have at home is that Opera freezes when loading the first tutorial's website: http://127.0.0.1:8000/ Firefox and IE (both 32-bit and 64-bit) worked. I am running on XP x64. Any ideas? Thanks! --~--~---

Re: Problem installing django on windows

2007-09-12 Thread jorgehugoma
Dean, You have to add python to your system PATH variable or always give python full path (c:\python\python manage.py runserver). To add Python to your PATH variable do the following: 1 right click on my computer and select properties 2 click on the advanced tab 3 click on the Environment Varia

Getting an 'User' object has no attribute 'startswith' when trying to use django.contrib.auth.views.login

2007-09-12 Thread shabda
I am trying to loging a user after they fill a form, using code if request.method == 'POST': data = request.POST.copy() errors = form.get_validation_errors(data) if not errors: new_user = form.save(data) user_profile = UserProfile(user = new_use

Re: Django deployment à lá Capistrano

2007-09-12 Thread Kyle Fox
I really don't see a need for a huge project to accomplish the goals you've outlined: 0) Checking in the local source changes if they have not already been checked in (optional). 1) Logging into the deployment target. 2) Checking out the latest source. 3) Modifying the production database as nece

Re: HELP needed POST and Python

2007-09-12 Thread AniNair
Please help. Thanking you --~--~-~--~~~---~--~~ 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

Foreign key error "Reverse query name for field 'foo' clashes with field Foo.bar"

2007-09-12 Thread Jon Atkinson
Hello, I've found a few previous threads on this list which covered this problem, but none from which I found a satisfactory answer. Here is my model definition from an app called 'sites': class Site(models.Model): """This is a site.""" name = models.CharField(blank=True, maxleng

How To Get A Low Interest Credit Card

2007-09-12 Thread harry
Consumers often have the first credit card that they ever applied for, never really analizing how the interest rate affects their payments, but many other options exist and can help consumers decrease their payments and achieve financial stability. ... Read more at: http://onlinetips.info/tips/cr

Master Page Code

2007-09-12 Thread weissblitz
I'm a web developer and I'm developing my first application using Django. I'm very impressed with the MVC concept in Django. I'm addressing this group for some advice on how to organize my code for this web application. Basically, my application will have the typical master page that will conta

Re: Master Page Code

2007-09-12 Thread Iapain
Extend your base(master) template and write a context processor for your common data, or pass context varibales into your template. But I'd suggest you to use context processors. On Sep 12, 7:35 pm, [EMAIL PROTECTED] wrote: > I'm a web developer and I'm developing my first application using > Dja

Re: Master Page Code

2007-09-12 Thread MikeHowarth
Have a look at template inheritance http://www.djangoproject.com/documentation/templates/#template-inheritance This may give you more of any idea of how to structure your main template. [EMAIL PROTECTED] wrote: > I'm a web developer and I'm developing my first application using > Django. I'm

django-voting question

2007-09-12 Thread [EMAIL PROTECTED]
I'm trying to use django-voting's get_top function: ``get_top(Model, limit=10, reversed=False)`` -- Gets the top ``limit`` scored objects for a given model. If ``reversed`` is ``True``, the bottom ``limit`` scored objects are retrieved instead. Yields ``(object, score)``

Files permissions

2007-09-12 Thread Alessandro Ronchi
I need to put under login the download of file attachments of my models. How can I do that? If anyone knows the url of the file, it's not handled by django and it has no user login to protect the file. How can I protect the file too? Thanks in advance, best regards. -- Alessandro Ronchi Skype:

ManyToMany and save()

2007-09-12 Thread Alessandro Ronchi
I neet to get the ManyToManyField content in my save() operation, because i need the system send an email to address in that field after the instance of the model is saved in admin panel. But ManyToMany fields are empty in save(). Is it possible? Can I easily add another button in admin to execu

Re: Getting an 'User' object has no attribute 'startswith' when trying to use django.contrib.auth.views.login

2007-09-12 Thread shabda
I found the error, In my instance at the server I had added a line like, from django.contrib.auth.views import login, logout which was conflicting with the import I was expectating, from django.contrib.auth import authenticate, login I had added this after deployment to the server. On Sep 12, 7:

django + sqlalchemy = ?

2007-09-12 Thread Ken Kuhlman
Cross-posted to django & sqlalchemy lists What is the state of SQLAlchemy integration with Django? I saw somewhere that it was possible to use them together, but the author didn't provide any details, and the SQLAlchemy branch of Django hasn't had any commits since late last year. Was the origin

subclassing flatpages model

2007-09-12 Thread Milan Andric
Hi, I would like to add tinymce to my flatpages in the admin. But the only way I can figure out how to do this is modifying django/contrib/ flatpages/models.py. Is there a way I can subclass the flatpages model and reference it from the django flatpage app? I'm confused. Thanks for your hel

1000 visitors

2007-09-12 Thread newbar
Hello, I am the webmaster of New-Bar.com , Many people seek to make publicity on Internet without really knowing the prices on our premises no suprise bus our prices are clear, simple and precise. For hardly 2 dollars 1000 visits assured in less 24h... + in no-claims bonus a banière conceived b

Re: Only Simplified Chinese translation not working?

2007-09-12 Thread Ryan K
Anyone? I have the site translated and working in Spanish, French, Italian and Russian yet simplified Chinese does not work. Any clues? This is my first attempt at internationalization. On Sep 11, 10:11 pm, Ryan K <[EMAIL PROTECTED]> wrote: > Hi. I have a few languages I've translated my site int

Re: Contact Form not Rendering Properly

2007-09-12 Thread rskm1
> The html code isn't being rendered properly. I'm assuming this is a slightly-noobish question (I'm still a novice myself, so if the problem is something more subtle, nevermind me). Your template seems a little light on the use of the "|escape" filter. So if any of the values in your database

Re: subclassing flatpages model

2007-09-12 Thread Thomas Badran
I do exactly this by adding a template admin/flatpages/flatpage/change_form.html That simply looks like (your tiny_mce location may vary): {% extends "admin/change_form.html" %} {% block extrahead %}{{ block.super }} {% endblock %} Hope that helps Tom On Wed, 2007-09-12 at 17:02 +, M

Re: django + sqlalchemy = ?

2007-09-12 Thread James Bennett
On 9/12/07, Ken Kuhlman <[EMAIL PROTECTED]> wrote: > What is the state of SQLAlchemy integration with Django? I saw somewhere > that it was possible to use them together, but the author didn't provide any > details, and the SQLAlchemy branch of Django hasn't had any commits since > late last year

Re: ERROR: permission denied for relation

2007-09-12 Thread [EMAIL PROTECTED]
Any Ideas on this?? Thanks On Sep 11, 4:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi I am getting this error when I try to do this: > > get_list = some_table.get_list(where=['user_id=%s' % > request.user.id]) > > I get this error: (and assuming the users are logged in) > > ERROR: p

Decoupling templates

2007-09-12 Thread Florian Lindner
Hello, I've just started with Django and have worked through the excellent tutorial. At chapter 2 [1] of the tutorial it says to set: TEMPLATE_DIRS = ( "/home/my_username/mytemplates", ) Which makes me putting all templates of all apps in my project into this directory (resp. subdirectorie

Re: Decoupling templates

2007-09-12 Thread James Bennett
> Which makes me putting all templates of all apps in my project into this > directory (resp. subdirectories of this dir) > How can I decouple my templates to an app specific directoy? The way that my > apps are self contained also regarding their templates? http://www.djangoproject.com/documenta

Re: Decoupling templates

2007-09-12 Thread RajeshD
> How can I decouple my templates to an app specific directoy? The way that my > apps are self contained also regarding their templates? That feature is built in to Django. Create a templates sub-directory in your app directory and place your app specific templates in there. Look at the the djan

Re: Decoupling templates

2007-09-12 Thread Thomas Badran
Personally, i have a templates directory in my app directory: project/templates project/blog/templates project/otherapp/templates etc. In my settings, i build the template dirs by definng all my dirs as relative paths, and doing some magic (hosted is worked out elsewhere, and is just the differen

Re: Decoupling templates

2007-09-12 Thread Thomas Badran
Better suggestion than mine, you learn something new every day .. I'm converting to using this now. Thanks Rajesh Tom On Wed, 2007-09-12 at 18:54 +, RajeshD wrote: > > > How can I decouple my templates to an app specific directoy? The way that my > > apps are self contained also regarding

Re: django-voting question

2007-09-12 Thread RajeshD
> > Problem is, I can't manage to do anything with posts in my template. What exactly are you trying to do that's not working? > When I view source, I see an object reference, so I know it's getting > there, and I know this is probably a terribly dumb question, but how > do I access posts? How

Re: form_for_instance + user profile

2007-09-12 Thread RajeshD
> > Basic example: > > user = User.objects.get(id=1) > user_profile = user.get_profile() This should work if you have settings.AUTH_PROFILE_MODULE pointing to your UserProfile model. See: http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/ --~--~-~--~~---

Re: form_for_instance + user profile

2007-09-12 Thread MikeHowarth
Yep all working now! On Sep 12, 8:11 pm, RajeshD <[EMAIL PROTECTED]> wrote: > > Basic example: > > > user = User.objects.get(id=1) > > user_profile = user.get_profile() > > This should work if you have settings.AUTH_PROFILE_MODULE pointing to > your UserProfile model. > See:http://www.b-list.org

Re: django-voting question

2007-09-12 Thread [EMAIL PROTECTED]
> How about something like this: > > {% for p in posts %} > {{ p.headline }} > {{ p.body }} > {% endfor %} That's what I thought SHOULD work, but it's not. I think I may just take a different route with it. --~--~-~--~~~---~--~~ You received this

Re: django-voting question

2007-09-12 Thread Samuel Adam
Try this : {% for p in posts %} {{ p.0 }} {{ p.1 }} {% endfor %} :P --~--~-~--~~~---~--~~ 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@googlegro

Add actions to models in admin interface

2007-09-12 Thread Alessandro Ronchi
It would be a great feature the possibility to add a button with an action near "save", "save and...", and call a method on the model. If one instance needs some elaboration after save, the only possibility now is to add to the save() function that code. But if that involves ManyToMany fields the

error: psycopg requires a datetime module

2007-09-12 Thread [EMAIL PROTECTED]
I can't seem to get past this error. I just installed the latest Python package and it didn't help. I've been trying to use Django and Python for about a week first with MySQL (more errors/missing modules) and now with PostgreSQL. I've tried setting this up on three different OSX systems but with

Re: error: psycopg requires a datetime module

2007-09-12 Thread Collin Grady
If it's complaining about mxDateTime, you need to install that separately - I do not think it is included in most python distributions. This isn't anything against python itself though - every piece of software has pre-requisites, and you have to install them to use the software :) --~--~--

Re: subclassing flatpages model

2007-09-12 Thread Collin Grady
For the record, you cannot subclass django models yet :) --~--~-~--~~~---~--~~ 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 t

Re: Master Page Code

2007-09-12 Thread Collin Grady
Another option is to use template tags. Different apps can provide template tags that can be embedded in other pages. Specifically, inclusion tags basically render a stub template with their own context, so something like a polls app, for example, could render a poll form wherever you do {% show_

Re: ManyToMany and save()

2007-09-12 Thread Collin Grady
While I believe you were the one asking this in IRC, I will answer here for anyone else stumbling across this :) ManyToManyField entries are just two IDs - one for each object. As such, it's impossible to add an m2m link until the object is saved - this means that admin's code can't possibly set

Re: HELP needed POST and Python

2007-09-12 Thread Collin Grady
1) The newforms documentation shows you how to pass request.POST into the form (see the view example): http://www.djangoproject.com/documentation/newforms/ 2) You don't need to put the user in your form in order to do initial data. Just pass the form an initial dict when you make an instance of

Re: error: psycopg requires a datetime module

2007-09-12 Thread Russell Keith-Magee
On 9/13/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I can't seem to get past this error. I just installed the latest > Python package and it didn't help. I've been trying to use Django and > Python for about a week first with MySQL (more errors/missing modules) > and now with PostgreSQL.

Re: Foreign key error "Reverse query name for field 'foo' clashes with field Foo.bar"

2007-09-12 Thread Russell Keith-Magee
On 9/12/07, Jon Atkinson <[EMAIL PROTECTED]> wrote: > > Hello, > > Why is this? I don't see what the clash is. I apologise if I need this > explaining in simple language for a five-year-old, but sometimes I'm > stupid :-) I'm willing to bet that if you look at your INSTALLED_APPS setting, you wil

Re: Foreign key error "Reverse query name for field 'foo' clashes with field Foo.bar"

2007-09-12 Thread Malcolm Tredinnick
On Thu, 2007-09-13 at 08:16 +0800, Russell Keith-Magee wrote: [...] > The long term solution is to find a way to do the equivalent of 'from > foo import bar as whiz'. This has been suggested previously; I believe > the sticking point has been finding a syntax that is backwards > compatible, but al

Re: Foreign key error "Reverse query name for field 'foo' clashes with field Foo.bar"

2007-09-12 Thread Joseph Kocherhans
On 9/12/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Thu, 2007-09-13 at 08:16 +0800, Russell Keith-Magee wrote: > [...] > > The long term solution is to find a way to do the equivalent of 'from > > foo import bar as whiz'. This has been suggested previously; I believe > > the sticking

Re: Only Simplified Chinese translation not working?

2007-09-12 Thread beck917
Pay attention to this question~ 2007/9/13, Ryan K <[EMAIL PROTECTED]>: > > Anyone? I have the site translated and working in Spanish, French, > Italian and Russian yet simplified Chinese does not work. Any clues? > This is my first attempt at internationalization. > > On Sep 11, 10:11 pm, Ryan K

Re: error: psycopg requires a datetime module

2007-09-12 Thread Kenneth Gonsalves
On 13-Sep-07, at 4:32 AM, [EMAIL PROTECTED] wrote: > I can't seem to get past this error. I just installed the latest > Python package and it didn't help. I've been trying to use Django and > Python for about a week first with MySQL (more errors/missing modules) > and now with PostgreSQL. I've t

can i design django template visually ?

2007-09-12 Thread z_axis
In the past, we use dreamwaver to design HTML visually. What i want to know is how to design django template visually ? Any suggestion is appreciated ! -- z_axis 2007-09-13 --~--~-~--~~~---~--~~ You received this mes

Re: can i design django template visually ?

2007-09-12 Thread James Bennett
On 9/12/07, z_axis <[EMAIL PROTECTED]> wrote: > In the past, we use dreamwaver to design HTML visually. What i want to know > is how to design django template visually ? You can quite easily build out your design using placeholder content (e.g., "lorem ipsum"), and then add in the appropriate Dj