Re: Virtualenvs and editing contrib stuff manually

2012-10-05 Thread Russell Keith-Magee
On Sat, Oct 6, 2012 at 10:17 AM, Chris Pagnutti wrote: > Hi Russel. Thanks again for your help. I guess "recommend" was the wrong > word to use. I just mean it's how the docs tell you to do it. > https://docs.djangoproject.com/en/1.4/topics/auth/#storing-additional-information-about-users Righ

Re: Virtualenvs and editing contrib stuff manually

2012-10-05 Thread Chris Pagnutti
Hi Russel. Thanks again for your help. I guess "recommend" was the wrong word to use. I just mean it's how the docs tell you to do it. https://docs.djangoproject.com/en/1.4/topics/auth/#storing-additional-information-about-users But instead of doing it this way, I just created a new class like

Re: following tutorial / ran into problem....?

2012-10-05 Thread TJ Marbois
you rock Xavier! ;) 100% right answer... thank you!! On Friday, October 5, 2012 7:01:42 PM UTC-4, Xavier Ordoquy wrote: > > Hi, > > class Poll(models.Model): > # ... > def __unicode__(self): > return self.question > class Choice(models.Model): > # ... > def __unicode__(sel

Re: Virtualenvs and editing contrib stuff manually

2012-10-05 Thread Russell Keith-Magee
It's mostly historical - the foreign key method was the *only* method until about a week ago. :-) The development docs contain a section about how to set up your own User model, but that section isn't the 1.4 (current stable) docs. If you can point me at a section in the dev docs that you think re

Re: Django testing strategy

2012-10-05 Thread Josh Crompton
There are a couple of problems with setting up a big database and then writing integration tests. Your tests will be slow, so they won't get run. They'll also be increasingly hard to maintain. Fixtures only seem make that worse. You've already got a code base that needs maintaining, you don't w

Re: Disabling CSRF is not working.

2012-10-05 Thread Bill Freeman
Right you are. On Fri, Oct 5, 2012 at 6:20 PM, Ian Clelland wrote: > > > On Friday, October 5, 2012, Bill Freeman wrote: >> >> I believe that I read somewhere that newer Djangos force the CSRF >> middleware even if it's not listed in MIDDLEWARE_CLASSES. > > > You might be thinking of the CSRF con

Re: following tutorial / ran into problem....?

2012-10-05 Thread Xavier Ordoquy
Hi, class Poll(models.Model): # ... def __unicode__(self): return self.question class Choice(models.Model): # ... def __unicode__(self): return self.choice You probably have used self.question in the Choice class instead of self.choice Regards, Xavier Ordoquy, Li

Re: Django Admin asks password every operation

2012-10-05 Thread Bill Freeman
All urls match this. The regular expression says "any URL that starts from the beginning, no matter what follows. I suspect that you want 'r^$' Bill On Fri, Oct 5, 2012 at 2:15 PM, Stefano T wrote: > wait i may have spotted out the problem: > if i've an app, is this the correct url pattern for

following tutorial / ran into problem....?

2012-10-05 Thread TJ Marbois
hi Im following the first Django tutorial... I thought I was doing everything correctly till I hit this spot: from https://docs.djangoproject.com/en/1.4/intro/tutorial01/ everything worked as expected till I got to this specific command in the shell... # Create three choices.>>> p.choice_set

Re: Newbie question: first project can't connect to MySQL

2012-10-05 Thread Javier Guerra Giraldez
On Fri, Oct 5, 2012 at 3:02 PM, Kurtis Mullins wrote: > Also, if memory serves me correctly, MySQL may be setup to allow connections > from 127.0.0.1 but not Localhost AFAIK, there are at least three different ways to connect to a local server, each can be allowed/denied individually: A: unix so

Re: Disabling CSRF is not working.

2012-10-05 Thread Ian Clelland
On Friday, October 5, 2012, Bill Freeman wrote: > I believe that I read somewhere that newer Djangos force the CSRF > middleware even if it's not listed in MIDDLEWARE_CLASSES. You might be thinking of the CSRF context processor, which is always enabled, no matter what is in settings. Even the mo

Re: Sporadic Currency formatting is not possible using the 'C' locale

2012-10-05 Thread Xavier Ordoquy
Hi brian, If you are using mod_wsgi with apache or nginx, reloading or restarting your servers may help. Regards, Xavier Ordoquy, Linovia. Le 5 oct. 2012 à 21:03, Brian a écrit : > I get this error sporadically. If I refresh the screen 3 or 4 times it loads > without the error. > > It is m

Re: Best practice of subclassing default/3rd part apps?

2012-10-05 Thread Bill Freeman
If your changes are limited to templates, there is an easy standard approach: Set TEMPLATE_DIRS to something reasonable. Include the file system template loader in TEMPLATE_LOADERS *before* the app loader. (This is probably already true.) Copy the templates you need to change to the

Re: Disabling CSRF is not working.

2012-10-05 Thread Bill Freeman
I believe that I read somewhere that newer Djangos force the CSRF middleware even if it's not listed in MIDDLEWARE_CLASSES. You could dive into the middleware code to see how this happens, and come up with a stable strategy to circumvent it. Or you could just fix the necessary views and templates

Re: Migrating a Django project to new platform

2012-10-05 Thread Bill Freeman
v0.97 of Django is compatible with python 2.4, but, as noted above the version of sorl (which is not part of the Django that makes that promise, but an external add-on) is not. You have a few choices: 1. You can tar (or zip) up the stuff in site-packages/sorl on the old box, to move to the new bo

Re: Newbie question: first project can't connect to MySQL

2012-10-05 Thread Kurtis Mullins
Also, if memory serves me correctly, MySQL may be setup to allow connections from 127.0.0.1 but not Localhost On Fri, Oct 5, 2012 at 2:45 PM, Mohamad Efazati wrote: > Hi afshin > localhost is kind of pointer to 127.0.0.1, maybe in /etc/hosts or other > thing you overwrite it. > so 127.0.0.1 is so

Re: Creating a custom mixin for use with the generic CreateView

2012-10-05 Thread Guruprasad L
Hi, On Friday, October 5, 2012 3:55:26 AM UTC+5:30, Javier Guerra wrote: > > On Thu, Oct 4, 2012 at 4:55 PM, Guruprasad L > > wrote: > > This is the first time I am using mixins in code. I read mixed opinions > > about mixins, a few of them saying that it is bad. If it is bad, is > there > >

Dynamically adding values to related foreign key field in the form

2012-10-05 Thread Guruprasad L
Hi all, Is it possible to add a value for a foreign key field from a form that is actually using it. For example, I have seen in the admin app that whenever there is a foreign key field, there is a way to add new items to that field via a popup window and the added value gets added to the list

Sporadic Currency formatting is not possible using the 'C' locale

2012-10-05 Thread Brian
I get this error sporadically. If I refresh the screen 3 or 4 times it loads without the error. It is making me nuts trying to figure out why sometimes it's fine other times it fails. -- You received this message because you are subscribed to the Google Groups "Django users" group. To vi

Re: Newbie question: first project can't connect to MySQL

2012-10-05 Thread Mohamad Efazati
Hi afshin localhost is kind of pointer to 127.0.0.1, maybe in /etc/hosts or other thing you overwrite it. so 127.0.0.1 is source and always work. 2012/10/4 Afshin Mehrabani > Hey Kevin, > > Thanks for your correct reply, I had this problem also but after changing > host from "localhost" to "127

Re: Print html the normal way

2012-10-05 Thread Laxmikant Gurnalkar
Use {{yourvar|html|striptags}} https://docs.djangoproject.com/en/dev/ref/templates/builtins/#striptags Cheers *Laxmikant Gurnalkar* On Fri, Oct 5, 2012 at 2:32 PM, Ashish Jain wrote: > Hi, > > Thanks a ton!! > > using mark_safe() worked perfectly. > > - Regards > Ashish > > On Friday, 5 October

Re: Django Admin asks password every operation

2012-10-05 Thread Stefano T
wait i may have spotted out the problem: if i've an app, is this the correct url pattern for the homepage? url(r'^', 'earth.views.Home'), or does it take ll the urls? On Friday, October 5, 2012 8:10:09 PM UTC+2, Stefano T wrote: > > i didn't est SESSION_COOKIE_AGE anywhere, so i suppose i

Re: Django on legacy Postgres database with encoding WIN1252

2012-10-05 Thread Janeskil1525
Hi Ian Thank you for your response. It turns out that the problem is not Django related at all, the Legacy system adds this character 0x81 of some reason to text strings and it seems like its the Postgres driver that fails to convert this to a UTF8 char. So its true, i have to purge the data

Re: Django Admin asks password every operation

2012-10-05 Thread Stefano T
i didn't est SESSION_COOKIE_AGE anywhere, so i suppose it's set to its default value. Cookies are enabled. i'm facing the problem in chrome (i deleted all the browser data, nothing changed) with FF it works. Before it was working with chrome, suddently it stopped. On Friday, October 5, 2012 7:32

Re: Django Admin asks password every operation

2012-10-05 Thread Larry Martell
On Fri, Oct 5, 2012 at 10:57 AM, Stefano T wrote: > Hi all. > i'm new to django and i'm facing a problem i can't solve so far. > Basically, when i log in in the admin part, every operation i do it > ask me for the login. doesn't matter which browser i user, it's always > the same. > at the beginni

Django Admin asks password every operation

2012-10-05 Thread Stefano T
Hi all. i'm new to django and i'm facing a problem i can't solve so far. Basically, when i log in in the admin part, every operation i do it ask me for the login. doesn't matter which browser i user, it's always the same. at the beginning it was acting normally: once logged in i stay logged in unti

Re: object has no attribute '_state'

2012-10-05 Thread Demian Brecht
> > > I'm sure the OP from June 2010 will be pleased that his question has > been answered so many times… > Eek, guess I should have read the posting date. > PS: To call the parent class(es) constuctor(s) correctly when using > python "new style" classes (ie: all Django classes and classes deriv

Re: Translation outside the broswer

2012-10-05 Thread Bastian
Thanks Tom, the logic seems pretty clear. I just didn't know about translation.activate. What does it do exactly? Change the current language? Anyway I will do my homework and google it and read the code... Cheers. On Friday, October 5, 2012 12:19:38 PM UTC+2, Tom Evans wrote: > > On Fri, Oct

Re: Inlines defined before use?

2012-10-05 Thread Bill Freeman
There are a few special cases in which Django works hard to allow you to specify a string that will be looked up later. And you can use names in function and method definitions that will be defined by the time the function is called. But python does not, in general, support forward references. O

Re: object has no attribute '_state'

2012-10-05 Thread Tom Evans
On Fri, Oct 5, 2012 at 3:56 PM, Demian Brecht wrote: > >>> class QuestionSet(models.Model): >>> title = models.CharField(max_length=100) >>> description = models.TextField() >>> order = models.IntegerField() >>> >>> def __init__(self, *args, **kwargs): >>> self.title =

Possible bug with Form Wizard and condition_dict?

2012-10-05 Thread Scott Woodall
I searched the bug tracker and the django users with no results, so is what I'm seeing a bug? I have a form wizard that is using a callable within condition_dict. If I try to access "wizard.steps.current" inside the callable, I get the following error: "maximum recursion depth exceeded in __in

Managers, Queryset, inheritance and polymorphism

2012-10-05 Thread Amirouche
Héllo, I got a problem with manager, some of you may already know it, I try my best to like them, if anyone can explain me the purpose of their existence I will be so much grateful :) Like I said, I try my best but: 0) Documentation references

Re: Django performance vs others

2012-10-05 Thread Kurtis Mullins
Probably the ability to both extend and include (template inheritance) On Fri, Oct 5, 2012 at 9:24 AM, Amirouche Boubekki < amirouche.boube...@gmail.com> wrote: > I have had no idea until recently that django template are sooo slow... >> other engines do the same... but spent less time. What the

Re: assign media to models

2012-10-05 Thread Amirouche
On Thursday, October 4, 2012 1:26:07 AM UTC+2, winniehell wrote: > > Hi list! > > I have different models with uploaded content. So I made a Media model > with a primary key to ContentType to distinguish to which kind of models > the media belongs. Now I want to upload the media inline instead

Re: unicode decode errors in loggging on server

2012-10-05 Thread Amirouche
On Friday, October 5, 2012 10:53:24 AM UTC+2, Bram wrote: > > Hello all, > > > My login setup on my server does not enable console logging, only > to-file logging (see at the end of this message for the logger setup). > However, just now I got a unicode decode error in my logging: > > > File

Re: object has no attribute '_state'

2012-10-05 Thread Demian Brecht
class QuestionSet(models.Model): title = models.CharField(max_length=100) description = models.TextField() order = models.IntegerField() def __init__(self, *args, **kwargs): self.title = kwargs.get('title','Default Title') self.description = kwargs.get('des

Re: Newbie Looking for Starter Plugin

2012-10-05 Thread Amirouche
> The job description is to have a dashboard full of information, It might be an OK solution to use the admin changelist (list feature of the admin) and render graphics using admin actions with an intermediate page

Re: Django testing strategy

2012-10-05 Thread Dan Gentry
I've been using factory-boy as of late, and have found it to be a great way to setup each test exactly as I need it. Fixtures aren't bad either, but working with a large amount of data can make it difficult to predict the proper output for a test, and changes to this data to accommodate a new

Re: non-root SCRIPT_NAME, mod_wsgi and RewriteRule

2012-10-05 Thread Sebastiaan Snoeckx
> I have my Django website and my static files deployed under the same >> directory (i.e. no separate 'static' directory), according to the following >> Apache RewriteRule: >> >> RewriteEngine on >> RewriteCond %{DOCUMENT_ROOT}%{REQUEST_**FILENAME} !-d >> RewriteCond %{D

Re: Django testing strategy

2012-10-05 Thread Amirouche
On Friday, October 5, 2012 9:56:34 AM UTC+2, Daniele Procida wrote: > > On Thu, Oct 4, 2012, Evan Brumley > > wrote: > > >django-dynamic-fixture can also help a lot in this situation: > >http://paulocheque.github.com/django-dynamic-fixture/ > > > >Certainly beats having to futz around with f

Re: Django testing strategy

2012-10-05 Thread Amirouche
On Thursday, October 4, 2012 7:49:19 PM UTC+2, Daniele Procida wrote: > > I have started writing my first tests, for a project that has become > pretty large (several thousand lines of source code). > That is too, late! ;-) > > What needs the most testing - where most of the bugs or incorre

Re: Newbie Looking for Starter Plugin

2012-10-05 Thread Luke Hovington
I will clarify a bit better on what I have been tasked to do. The job description is to have a dashboard full of information, this information could be coming from external sites or our own sensors. So with this data (yet to be decided) it could be graphed or show in table format for example.

Re: Virtualenvs and editing contrib stuff manually

2012-10-05 Thread Chris Pagnutti
Hey thanks Russell. That's a great explanation. Is there a particular reason that the docs tend to favour the foreign key method over subclassing? On Thursday, September 27, 2012 4:13:34 PM UTC-4, Tundebabzy wrote: > > No you won't be smitten. > > As for isolating your edited django, you can d

Re: Django testing strategy

2012-10-05 Thread Amirouche
Please ignore this message I've hit «Post» by mistake I will edit my post :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/0S78LxSWkXoJ. To post to this

Re: Django testing strategy

2012-10-05 Thread Amirouche
On Thursday, October 4, 2012 7:49:19 PM UTC+2, Daniele Procida wrote: > > I have started writing my first tests, for a project that has become > pretty large (several thousand lines of source code). > That is too, late! ;-) > > What needs the most testing - where most of the bugs or incorre

Re: Bug with collapse fieldsets?

2012-10-05 Thread Joel Goldstick
On Wed, Oct 3, 2012 at 6:32 PM, Janusz Jaworski wrote: > Hello. I found probably a little bug or it's just a feature (dunno). But my > question is why i can't unhide collapsed fields when i use 'None' for name > of group and use 'collapse' in dictionary in fieldsets. Here is the line of > code and

Re: Newbie Looking for Starter Plugin

2012-10-05 Thread Amirouche
On Friday, October 5, 2012 7:47:01 AM UTC+2, Luke Hovington wrote: > > After lots of talk on I'm going to start using Django a project turned up > that allowed me to start learning how this all works. > > So far I have managed (Via tutorials) to get everything setup and running > nicely, > I have

Re: Newbie Looking for Starter Plugin

2012-10-05 Thread Joel Goldstick
On Fri, Oct 5, 2012 at 1:47 AM, Luke Hovington wrote: > After lots of talk on I'm going to start using Django a project turned up > that allowed me to start learning how this all works. > > So far I have managed (Via tutorials) to get everything setup and running > nicely, > I have also installed

Re: Django performance vs others

2012-10-05 Thread Amirouche Boubekki
> > I have had no idea until recently that django template are sooo slow... > other engines do the same... but spent less time. What the cool feature > prevent it for rendering it faster? The template parsing I guess, but I'm not sure. -- You received this message because you are subscribed to

Re: Why can't I activate the admin site?

2012-10-05 Thread Tom Evans
On Fri, Oct 5, 2012 at 9:18 AM, Dae_James wrote: > I created a new django project and did the following three things: > 1, Uncomment "django.contrib.admin" in the INSTALLED_APPS setting. > 2, Run python manage.py syncdb. Since you have added a new application to > INSTALLED_APPS, the database tabl

Newbie Looking for Starter Plugin

2012-10-05 Thread Luke Hovington
After lots of talk on I'm going to start using Django a project turned up that allowed me to start learning how this all works. So far I have managed (Via tutorials) to get everything setup and running nicely, I have also installed admin_tools which brings me to my question. Is there any plugin

Re: object has no attribute '_state'

2012-10-05 Thread Clarence Zeng
I think you shouldn't use __init__ to init your variables. try using another way (custom method) http://stackoverflow.com/questions/10307635/error-passing-user-to-foreignkey-in-django On Tuesday, July 6, 2010 10:51:51 AM UTC+8, jcage wrote: > > Hi everyone. I'm quite new to python and django. I

Why can't I activate the admin site?

2012-10-05 Thread Dae_James
I created a new django project and did the following three things: 1, Uncomment "django.contrib.admin" in the INSTALLED_APPSsetting. 2, Run python manage.py syncdb. Since you have added a new application to INSTALLED_

Re: Array sharing across frame carries stale copy - How to fix it?

2012-10-05 Thread anirM
Daniel: Thanks again. The session worked! I used dbase backend and got it to work perfectly. Thank you. anirM On Thursday, October 4, 2012 6:23:36 AM UTC-4, anirM wrote: > > Hi Daniel you guys are phenomenal! I did not expect you would be willing > to help looking in to the code. I will soon upd

Re: URLField and Web Sockets URLs

2012-10-05 Thread Julian Cerruti
Thanks Kurtis and Russ. For now, since this is a very minor feature of my app, I decided to go the easy route and turn my field into a CharField. When I get some more time I will try to exercise the contribution mechanism as a way to get more familiarized with it. Thank you guys both for your

Re: Translation outside the broswer

2012-10-05 Thread Tom Evans
On Fri, Oct 5, 2012 at 10:12 AM, Bastian wrote: > Hi, > > I understand quite well how translations and i18n work inside a browser for > Django but I'm not sure about the correct way to do it outside a browser. I > mean when sending a mail or a tweet. What should I use to get the language > of the

Re: Translation outside the broswer

2012-10-05 Thread Avraham Serour
I believe that when you detect the language you could store in the user profile the selected language (either it was automatic or manual), when sending your email just check that On Fri, Oct 5, 2012 at 11:12 AM, Bastian wrote: > Hi, > > I understand quite well how translations and i18n work insi

Translation outside the broswer

2012-10-05 Thread Bastian
Hi, I understand quite well how translations and i18n work inside a browser for Django but I'm not sure about the correct way to do it outside a browser. I mean when sending a mail or a tweet. What should I use to get the language of the user that is going to receive the mail or in case of a tw

Re: Print html the normal way

2012-10-05 Thread Ashish Jain
Hi, Thanks a ton!! using mark_safe() worked perfectly. - Regards Ashish On Friday, 5 October 2012 14:10:31 UTC+5:30, Tom Evans wrote: > > On Fri, Oct 5, 2012 at 9:20 AM, Ashish Jain > > > wrote: > > Hi, > > > > I wrote a simple filter as: > > > > @register.filter() > > def html(value):

unicode decode errors in loggging on server

2012-10-05 Thread Bram de Jong
Hello all, My login setup on my server does not enable console logging, only to-file logging (see at the end of this message for the logger setup). However, just now I got a unicode decode error in my logging: File "/home/xyz/site/xyz/views.py", line 520, in xx_yy_zz logger.error(u"Succes

Re: Print html the normal way

2012-10-05 Thread Tom Evans
On Fri, Oct 5, 2012 at 9:20 AM, Ashish Jain wrote: > Hi, > > I wrote a simple filter as: > > @register.filter() > def html(value): > return 'Check' > > when I use this filter in my template, it displays html as: > > Check > > I want to display as: > > Check > > am I missing something. > You h

Print html the normal way

2012-10-05 Thread Ashish Jain
Hi, I wrote a simple filter as: @register.filter() def html(value): return 'Check' when I use this filter in my template, it displays html as: Check I want to display as: Check am I missing something. - Thanks for your help Ashish -- You received this message because you a

Re: Passing template variables within static template

2012-10-05 Thread Zoran Hranj
Doh! Thank you, sir! On Thursday, October 4, 2012 5:17:59 PM UTC+2, Laxmikant Gurnalkar wrote: > > Try, > > cheers > L > On Thu, Oct 4, 2012 at 8:27 PM, Zoran Hranj > > wrote: > >> Hi guys, >> >> basicly I want to do the following: >> >> >> >> But the "{{ item.url }}" part does not get evalua

Re: Django testing strategy

2012-10-05 Thread Daniele Procida
On Thu, Oct 4, 2012, Evan Brumley wrote: >django-dynamic-fixture can also help a lot in this situation: >http://paulocheque.github.com/django-dynamic-fixture/ > >Certainly beats having to futz around with fixtures. Thanks - there seem to be a lot of tools to generate test data in various ways,