Re: psycopyg setup error: no build_ext

2009-07-18 Thread walty
thx, it solves my problem (psycopg2-2.0.11 on OSX) right away :) just drop a few more words: if installed the postgresql 8.4 using mac binary, the line of configuration (inside setup.cfg) should be: pg_config=/Library/PostgreSQL/8.4/bin/pg_config On Jul 7, 6:17 am, Justin Johnson

Re: How to implement a custom field (or relation) which supports List of Strings

2009-07-18 Thread Dudley Fox
On Fri, Jul 17, 2009 at 3:45 PM, Sam Tregar wrote: > On Fri, Jul 17, 2009 at 3:23 PM, Dudley Fox wrote: >> >> Should I have posted this to the developer's list? I ask because I >> have received no responses yet. Not even a "...you shouldn't do that." >> :)

Re: looking for a clean, easy way to force user to change password on first login

2009-07-18 Thread Shawn Milochik
If I understand correctly, you can do this without having to re- implementing the login. You will have to make a (very simple) login template, and write a login view that contains these: from django.contrib.auth import login login(request, form.get_user()) Then you

Re: newbie questions: common components in django

2009-07-18 Thread Alex Gaynor
On Sat, Jul 18, 2009 at 8:08 PM, online wrote: > > Hi all, > > I know i can have common stuff like this in django > > > > {% include "header.html" %} > > > blah > > > {% include "footer.html" %} > > > but it seems i need to pass data footer.html and header.html

newbie questions: common components in django

2009-07-18 Thread online
Hi all, I know i can have common stuff like this in django {% include "header.html" %} blah {% include "footer.html" %} but it seems i need to pass data footer.html and header.html every time i include these pages? Thanks --~--~-~--~~~---~--~~ You

Django-whoosh

2009-07-18 Thread chrisdev
Hi Has the django-whoosh project been withdrawn or something?? http://github.com/ericflo/django-whoosh/ I get an error when ever i try to download I also notice its no longer on ericflo list of projects on git hub I liked the approach adopted by this project but... Chris

Re: Model Validation

2009-07-18 Thread Joshua Russo
On Sat, Jul 18, 2009 at 9:03 PM, sjtirtha wrote: > class AbstractContent(models.Model): > viewed = models.PositiveIntegerField(max_length=7, > blank=True, null=True) > #rating = > #ranking = > created_by =

Re: User login

2009-07-18 Thread Joshua Russo
On Sat, Jul 18, 2009 at 8:51 PM, AKK wrote: > > hi, > > i have a form like this: > > >User name: > >Password: > id="password"> > > > > > > > and the next field is where the user should be redirected assuming > they have the correct details.

Model Validation

2009-07-18 Thread sjtirtha
Hi, I try to call manage.py syncdb for my models, but I always get error Lasttime, I solve the problem, by defining related_name for changedBy attribute. But now, I got the same problem after I define the model as abstract. Error: One or more models did not validate: person.person: Accessor for

Re: User login

2009-07-18 Thread Almir Karic
what is wrong with absolute urls? :) python/django hacker & sys admin http://almirkaric.com & http://twitter.com/redduck666 On Sat, Jul 18, 2009 at 2:51 PM, AKK wrote: > > hi, > > i have a form like this: > >   >    User name: >     >    Password: >    

Re: Row-specific user permissions

2009-07-18 Thread Alex Gaynor
On Sat, Jul 18, 2009 at 4:23 PM, nkulmati wrote: > > Hi Django users, > > It's been a while since I used Django, so I need an update on the > following question. > > Has anyone found a generic solution to django-admin's huge flaw - > specifically, not being able to limit

User login

2009-07-18 Thread AKK
hi, i have a form like this: User name: Password: and the next field is where the user should be redirected assuming they have the correct details. When they login i want them to be redirected to myurl.com/blog/ but what i have above redirects them to

Django, MySQL - bug?

2009-07-18 Thread Tomasz Zieliński
I prepared following repro case, just paste to models.py to an empty project: --- from MySQLdb import Warning as Warning from django.db import models import unittest class TestModel(models.Model): char_field =

Row-specific user permissions

2009-07-18 Thread nkulmati
Hi Django users, It's been a while since I used Django, so I need an update on the following question. Has anyone found a generic solution to django-admin's huge flaw - specifically, not being able to limit view/edit/delete activities based on object-specific (not model-specific)

Re: Stuck re:Practical Django Projects 2nd E...

2009-07-18 Thread Rob B
Huge thanks Tanja - worked a treat. Any ideas why the book has it the other way around? 2009/7/18 klaut > > > > On Jul 18, 6:30 pm, "Rob B (uk)" wrote: > > Bit stumped on chapter 4. > > > > Every thing is working except I'm getting a 'Page not

Re: Stuck re:Practical Django Projects 2nd E...

2009-07-18 Thread klaut
On Jul 18, 6:30 pm, "Rob B (uk)" wrote: > Bit stumped on chapter 4. > > Every thing is working except I'm getting a 'Page not found (404)' > when I try to view any entries. > > View: > def entry_detail(request, year, month, day, slug): >         import datetime, time

Re: Stuck re:Practical Django Projects 2nd E...

2009-07-18 Thread Lakshman Prasad
If you get a page not found, verify the slug (the entire url pattern for that pattern), either from the console or admin, that it exists. On Sat, Jul 18, 2009 at 4:30 PM, Rob B (uk) wrote: > > Bit stumped on chapter 4. > > Every thing is working except I'm getting a

Re: how add email field to user registration?

2009-07-18 Thread V
On Jul 18, 3:54 pm, Asinox wrote: > Hi guys, im new with Django, i want to know how ill add a email field > to the registration form from the User model. > > thanks please, give some more details, as there is no "registration form from the User model", AFAIK for registrations

Re: looking for a clean, easy way to force user to change password on first login

2009-07-18 Thread pjv
thanks for your reply, shawn. that's a good idea, and i already have a one-to-one table inherited from User where i can stash the initial encrypted password. the only thing i don't like about doing it this way is that i am currently trying to use as much generic, built-in django as i can and that

Stuck re:Practical Django Projects 2nd E...

2009-07-18 Thread Rob B (uk)
Bit stumped on chapter 4. Every thing is working except I'm getting a 'Page not found (404)' when I try to view any entries. View: def entry_detail(request, year, month, day, slug): import datetime, time date_stamp = time.strptime(year+month+day, "%Y%b%d") pub_date =

What is the best way to configure different log file locations for different settings?

2009-07-18 Thread Manoj Govindan
I am using python's logging module in a django project. I am performing the basic logging configuration in my settings.py file. Something like this: import logging import logging.handlers logger = logging.getLogger('project_logger') logger.setLevel(logging.INFO) LOG_FILENAME =

Re: Expert System

2009-07-18 Thread Carlos Eduardo Sotelo Pinto
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi > I understand. Well I mean a papper, page resource to explain hoy > to use django for expert system or > mayme an application resource example about using django on > expert system to take it as a start poit >

strange ImportError

2009-07-18 Thread PANCHICORE
Hi everyone, I have this setting: INSTALLED_APPS = ( ... 'esticate.principal', 'esticate.creativos', 'esticate.productos', ... ) and when I add the line "from esticate.productos.models import Producto" in esticate.creativos.models.py I get this ImportError:

Re: Expert System

2009-07-18 Thread Joshua Russo
On Sat, Jul 18, 2009 at 1:31 PM, Joshua Russo wrote: > On Sat, Jul 18, 2009 at 1:15 PM, Carlos Eduardo Sotelo Pinto < > csot...@aqpglug.org.pe> wrote: > >> >> I understand. Well I mean a papper, page resource to explain hoy to use >> django for expert system or >> mayme an

Re: Expert System

2009-07-18 Thread Joshua Russo
On Sat, Jul 18, 2009 at 1:15 PM, Carlos Eduardo Sotelo Pinto < csot...@aqpglug.org.pe> wrote: > > I understand. Well I mean a papper, page resource to explain hoy to use > django for expert system or > mayme an application resource example about using django on expert system > to take it as a

Re: Expert System

2009-07-18 Thread Carlos Eduardo Sotelo Pinto
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi > > Its an excellent idea to use the django admin app to manage any > kind of > > database. Though I'm not familiar with a maden job. Could you explain > > what you are referring to? > > Iam talkin about a python expert

Re: How do you unit test forms

2009-07-18 Thread Joshua Russo
On Sat, Jul 18, 2009 at 10:54 AM, V wrote: > wow, that's a tough question as I'm not self-confident enough to judge > other's projects and testing, but my guess would be that the > django.contrib applications have good tests, and I think that the > tests for my

Re: How do you unit test forms

2009-07-18 Thread Joshua Russo
On Sat, Jul 18, 2009 at 12:17 PM, Russell Keith-Magee < freakboy3...@gmail.com> wrote: > As is often the case in the Django community, one answer is "find > anything James Bennett has done, and follow his lead". :-) > > James has just finished reworking django-registration [1]. One of the >

Re: Expert System

2009-07-18 Thread Joshua Russo
On Sat, Jul 18, 2009 at 11:42 AM, Carlos Eduardo Sotelo Pinto < csot...@aqpglug.org.pe> wrote: > > Hi > > > > Its an excellent idea to use the django admin app to manage any kind of > > database. Though I'm not familiar with a maden job. Could you explain > > what you are referring to? > > Iam

how add email field to user registration?

2009-07-18 Thread Asinox
Hi guys, im new with Django, i want to know how ill add a email field to the registration form from the User model. thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: How do you unit test forms

2009-07-18 Thread Russell Keith-Magee
On Sat, Jul 18, 2009 at 7:47 PM, Joshua Russo wrote: > On Sat, Jul 18, 2009 at 9:38 AM, V wrote: >> >> Some time ago I wrote down my experience on testing, including testing >> forms: http://viktornagy.com/blog/2009/05/24/what-test-django/ >> >>

Re: Howto add button to certain field

2009-07-18 Thread Eugene Mirotin
The button you want is client-specific. So you really have to write the loop and make the check if the rendered field corresponds to the user name. And if so, render your button with onclick making ajax call next to the rendered field. On Jul 17, 8:19 pm, zayatzz

Re: Expert System

2009-07-18 Thread Carlos Eduardo Sotelo Pinto
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi > > Its an excellent idea to use the django admin app to manage any kind of > database. Though I'm not familiar with a maden job. Could you explain > what you are referring to? Iam talkin about a python expert system with django > > > -

Re: Getting a dynamic model form

2009-07-18 Thread Eugene Mirotin
So, the value is a string, but the widget you want to display to the user should be changed according to the key value? Probably you have to create your custom tag (e.g. render_value_widget) and then use something like {% render_value_widget key value %} in your view. If you provide the same name

Re: building directory path with user table

2009-07-18 Thread Eugene Mirotin
What you have written (this join for user_dir_path) is evaluated only once on model class creation, but what you need is evaluating it for each specific object. I recommend you overloading the model save method to alter the image save path. On Jul 17, 10:44 am, "neri...@gmail.com"

Re: never_cache doesn't work for login page

2009-07-18 Thread Eugene Mirotin
Isn't adding a timestamp to the url a workaround? I mean making all links to /login/ look like /login/?_=timestamp This can be easily done on the client side with some JS library, or, on the server side. Not nice, but it should help, I guess. On Jul 17, 5:24 pm, Ronghui Yu

Re: email as username, issue with admin page

2009-07-18 Thread selcukcihan
Sorry i forgot to post another change i did in OurUserCreationForm in the method "save" i have user = super(OurUserCreationForm, self).save(commit=False) instead of user = super(UserCreationForm, self).save(commit=False) Copy the code is not a good solution at all, but it works. If only i could

Re: email as username, issue with admin page

2009-07-18 Thread selcukcihan
Hi, thanks for the tip. I decided to just replicate auth.forms.UserCreationForm and auth.forms.UserChangeForm as OurUserCreationForm and OurUserChangeForm Ofcourse with the difference of having username as a forms.EmailField In admin.py of my application i did admin.site.unregister(User)

Re: Current user in model.save() context

2009-07-18 Thread Joshua Russo
On Sat, Jul 18, 2009 at 8:06 AM, Matthias Kestenholz < matthias.kestenh...@gmail.com> wrote: > If you really need to do that (or if you are just extremely lazy) > there is a cookbook recipe for achieving this sort of thing: > > http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser > >

Re: How do you unit test forms

2009-07-18 Thread V
On Jul 18, 1:47 pm, Joshua Russo wrote: > On Sat, Jul 18, 2009 at 9:38 AM, V wrote: > > Some time ago I wrote down my experience on testing, including testing > > forms:http://viktornagy.com/blog/2009/05/24/what-test-django/ > > > moreover, I would

Re: How do you unit test forms

2009-07-18 Thread Joshua Russo
On Sat, Jul 18, 2009 at 9:38 AM, V wrote: > Some time ago I wrote down my experience on testing, including testing > forms: http://viktornagy.com/blog/2009/05/24/what-test-django/ > > moreover, I would recommend to check out the tests of some existing > projects, that

Re: Accessing Meta properties and a templating question.

2009-07-18 Thread Russell Keith-Magee
On Sat, Jul 18, 2009 at 11:08 AM, Beetle B. wrote: > > Russell Keith-Magee wrote: >> > 1. In the Python code, how can I access various Meta properties of a >> > model (e.g. verbose_name, etc). At the moment, I do it via >> > model._meta.verbose_name, but I always get chills

Re: How do you unit test forms

2009-07-18 Thread V
On Jul 17, 10:50 am, Joshua Russo wrote: > On Jul 16, 11:11 pm, Russell Keith-Magee > wrote: > > > > > On Thu, Jul 16, 2009 at 10:46 PM, Joshua Russo > > wrote: > > > > I want to test my forms but I'm not sure the best way

Django and LDAP

2009-07-18 Thread Daniele Procida
Some time ago, I successfully managed to get Django LDAP authentication working. I used the patch at: Now for the life of me I can't repeat my success. Perhaps someone can remind me how I should expect this to work. If I have set up

Re: pre-fetch one-to-many and many-to-many relationships

2009-07-18 Thread Matthias Kestenholz
Hey, On Fri, Jul 17, 2009 at 5:06 PM, Miriam wrote: > > There currently is no way in Django to pre-fetch one-to-many and/or > many-to-many relationships, right? > > There's select_related, which will pre-fetch FK or one-to-one, which > is great, but not sufficient. > >

Re: Current user in model.save() context

2009-07-18 Thread Matthias Kestenholz
On Fri, Jul 17, 2009 at 4:24 PM, Bartłomiej Górny wrote: > > Phil wrote: >> Hi Josh, >> >> unfortunately it seems that there is no way to do so. As you've >> noticed that correctly you can use request (request.user) in any place >> but model save. > > Yes, I bumped into the

Re: Doctests for custom template tags

2009-07-18 Thread A Khodyrev
In case someone with the same question finds this. I've subclassed Template to accept a list of template.Libraries: from django.template import Template, TemplateEncodingError, StringOrigin, Lexer, Parser from django.utils.encoding import smart_unicode class TestableTemplate(Template): def

Re: Expert System

2009-07-18 Thread Joshua Russo
> > I was thinkin about using the powerful of django for dabase admin and > templates for web and make the > algorithms on python modules... after that call them as a simple module... > my question is about a > maden job about it. Its an excellent idea to use the django admin app to manage any

ANN: FileBrowser 3.0 Pre-Release

2009-07-18 Thread patrickk
The first pre-release of FileBrowser 3 is out now. The Source is currently available as a Branch: http://code.google.com/p/django-filebrowser/source/browse/#svn/branches/filebrowser_3/filebrowser Please read the Documentation, because a lot has changed:

getting donations via PayPal

2009-07-18 Thread Nagy Viktor
Hi, I've created a small application django-paypal, you can check it out from https://launchpad.net/django-donation the first site using it is my Karin Dom sponsorship page, feel free to have a look at it, and support us/them if you like: http://viktornagy.com/karin-dom/ Viktor

Re: 'str' object not callable

2009-07-18 Thread grant neale
Yes it's the URL. you are probably calling an incomplete view or wrong template name. Grant On 18 Jul 2009, at 09:29, adelaide_mike wrote: > > Hi > Can some kind soul tell me what, in principle, this means: > > 'str' object not callable > > ? It seems to be associated with urls.py > >

'str' object not callable

2009-07-18 Thread adelaide_mike
Hi Can some kind soul tell me what, in principle, this means: 'str' object not callable ? It seems to be associated with urls.py Newbie just needs some additional words to help. Have looked at the history of this, which did not help. I do not want to know why the error is arising, I simply

Re: model name ending with an 's'

2009-07-18 Thread James Bennett
Also, just as a general bit of style advice: the usual convention is that a model name should be the singular form. For more information, consult: http://docs.djangoproject.com/en/dev/internals/contributing/#coding-style http://www.python.org/dev/peps/pep-0008/ -- "Bureaucrat Conrad, you are

Re: model name ending with an 's'

2009-07-18 Thread ankit rai
in side ur class define class Meta: verbose_name_plural = "name which u want to be displayed on screen" for more details see docs class Meta options On Sat, Jul 18, 2009 at 11:22 AM, Earl Lapus wrote: > hi, > > I have a model named 'Services'. I added it to the

Re: model name ending with an 's'

2009-07-18 Thread Earl Lapus
On Sat, Jul 18, 2009 at 1:54 PM, Alex Gaynor wrote: > > > You can provide verbose name, and verbose name plural to control that: > http://docs.djangoproject.com/en/dev/ref/models/options/#verbose-name > > Alex > > It works! Thanks a lot! -- There are seven words in this