Re: keeping SECRET_KEY secret

2007-11-01 Thread James Bennett
On 11/1/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > The generated settings.py contains things that are perfectly normal "source > code" like things that should be treated as such. How does one only commit > part > of a file to svn? Why do you need to commit your project's settings file to a

Re: uncommon newforms usage

2007-11-01 Thread Doug B
You might consider a single view and form class, and then doing your split up in the template using form.field to print the fields you want for that 'page' by passing the page in with the context. Leave the form processing to a single form and view. Rather than worry with pages I'd probably

Re: keeping SECRET_KEY secret

2007-11-01 Thread Carl Karsten
James Bennett wrote: > On 11/1/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: >> View the whole settings file as something you don't just release >> casually and then only post the bits you feel safe doing so. That is >> absolutely normal configuration file practice. The generated settings.py

Re: ANN: Security fix to i18n framework

2007-11-01 Thread Jason Cui
2007/10/31, Malcolm Tredinnick <[EMAIL PROTECTED]>: > > > On Wed, 2007-10-31 at 13:40 +0800, Jason Cui wrote: > > 2007/10/31, Malcolm Tredinnick <[EMAIL PROTECTED]>: > > > > On Tue, 2007-10-30 at 00:37 -0700, Jason Cui wrote: > > > When I update my site from 0.96 to 0.96.1,my > >

Re: Dynamic Query (PS)

2007-11-01 Thread Tim Chase
>> Depending on the checkbox selection it might produce a sql string >> like: >> SELECT user_id FROM Bio WHERE (race='A' OR race='W' OR race='H') AND >> (eye_color='B' OR eye_color='G' OR eye_color='H') AND (hair_color='W' >> OR hair_color='B') Though my solution would be logically about the

Re: Dynamic Query

2007-11-01 Thread Tim Chase
> class Bio(models.Model): > HEIGHT_CHOICES = ( > ('A',"< 5' (< 152cm)") [snip] > ,('Z',"7' 0'' (213cm)") > ,('*',"> 7'' (> 213cm)") > ) > WEIGHT_CHOICES = (('A',"<100lbs (<45kg)"),('B',"100lbs

Re: Error with Psycopg2: argument of type _QuerySet is not iterable

2007-11-01 Thread [EMAIL PROTECTED]
> > if not assigned_user in > > User.objects.filter(groups__name__exact=assigned_group): > > > TypeError: argument of type '_QuerySet' is not iterable > > Am I doing something obviously wrong? In case anyone else is experiencing this error, it was happening because of stupidity on my part. In

Re: keeping SECRET_KEY secret

2007-11-01 Thread James Bennett
On 11/1/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > View the whole settings file as something you don't just release > casually and then only post the bits you feel safe doing so. That is > absolutely normal configuration file practice. Apologies if I wasn't as clear as I could have

Re: Searches Across Many-to-Many with Intermediate Table

2007-11-01 Thread Andy Brody
Awesome! I thought there would to be a way to use .values().distinct() without tons of subsequent queries. I actually just posted the core of my model -- there are several more related classes, but this covers the basic idea. As a result, I might be back looking for clarification on that keyword

Re: keeping SECRET_KEY secret

2007-11-01 Thread Malcolm Tredinnick
On Thu, 2007-11-01 at 19:58 -0500, Carl Karsten wrote: > James Bennett wrote: > > On 11/1/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > >> Given that some settings.py files get shared/posted/uploaded to > >> code.google, > >> etc. it seems this should not be in there by default: > >> > >> # Make

Re: keeping SECRET_KEY secret

2007-11-01 Thread Carl Karsten
James Bennett wrote: > On 11/1/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> Given that some settings.py files get shared/posted/uploaded to code.google, >> etc. it seems this should not be in there by default: >> >> # Make this unique, and don't share it with anybody. >> SECRET_KEY = 'foo!' >

Re: Searches Across Many-to-Many with Intermediate Table

2007-11-01 Thread Malcolm Tredinnick
On Thu, 2007-11-01 at 11:35 -0700, Andy Brody wrote: > Ah, thanks for the values() hint. It seems to work decently. I don't > really need to access related model fields, I just want a list of > unique group objects associated with a given musician's activities. > > The above becomes instead: >

Dynamic Query

2007-11-01 Thread weissblitz
I'm developing my first Django website where the users should be able to search other user profiles based on certain paramaters like race, age, gender, height, weight, eye color, hair color, etc This is how my model looks: (code have been shortened to only include the pertinent sections)

Re: Set attributes to input using newforms

2007-11-01 Thread Malcolm Tredinnick
On Thu, 2007-11-01 at 19:08 +, Henhiskan wrote: > Hi fellows, > Am using django-0.96 and I need to set an input html attribute from a > newforms > I need to use a time picker from dojo, for that I need to have > something like this: > dojoType="dropdowntimepicker"> > > The only solution I

Re: Django and XML-Files

2007-11-01 Thread Malcolm Tredinnick
On Thu, 2007-11-01 at 09:56 -0700, johannes wrote: > Hello, > > I'm planning to alter an existing hobby-project-site from php and xml/ > xslt scripts into a python web-app. > I just played around a little bit with django and must say I like it. > First, having learned php, xslt and python by

uncommon newforms usage

2007-11-01 Thread Milan Andric
Hi, I'm working on an a little newforms problem and can surely use some advice. I have an application process that is broken up into several forms. So I have one Application model class and several AppFormParts 1-8. Since the application process is so painfully long we decided to break it up

Re: keeping SECRET_KEY secret

2007-11-01 Thread James Bennett
On 11/1/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > > Given that some settings.py files get shared/posted/uploaded to code.google, > etc. it seems this should not be in there by default: > > # Make this unique, and don't share it with anybody. > SECRET_KEY = 'foo!' By the same token, then, the

Re: Searches Across Many-to-Many with Intermediate Table

2007-11-01 Thread Scott SA
Hi Andy, On 10/31/07, Andy Brody ([EMAIL PROTECTED]) wrote: >I'm using an intermediate table of Activities to relate Musicians, >Instruments, and Groups. Is there a good way to select groups from the >musician's activities? I've been doing stuff like [act.group for act >in

Re: MS SQL and Django - Any current info?

2007-11-01 Thread Carl Karsten
Peter Bailey wrote: > Can anyone tell me if there is any current news about MS SQL support? > I am looking at frameworks for a client, and my preference is really > to go the Django route. The plan will be to migrate over time from an > asp environment with an MS SQL back end. So basically I am

Re: keeping SECRET_KEY secret

2007-11-01 Thread Carl Karsten
Todd O'Bryan wrote: > I then point to production_settings as my DJANGO_SETTINGS_MODULE for > mod_python and the production settings overwrite the settings that I > use for production. > > Of course, the last word should be "development," not "production." Good idea. What's funny is I do

Re: djangoAMF authentication, requests aren't carrying user credential

2007-11-01 Thread Graham Dumpleton
On Oct 30, 9:22 pm, "Tiger Uppercut" <[EMAIL PROTECTED]> wrote: > Hi, > > I wasn't sure whether this was a djangoAMF issue or django, so apologies for > the double posting. > > I'm having trouble using djangoAMF to communicate between my flex UI and my > django site, django_wrapper. > > - My

Re: New Forms Foreign key field Filtered choices

2007-11-01 Thread rm
Sorry, I made a slight mistake above. I was just trying different things. When using the code I posted above, the view is not displayed and I get an error saying: 'Contact' object has no attribute 'name' But, when I use this code, def away_edit(request, away_id): aw =

New Forms Foreign key field Filtered choices

2007-11-01 Thread rm
I know this is a painful subject. I have spent a couple of days trying to figure this out, and I am almost there. (I think. :) Here is the model (simplified to bare bones): class away(models.Model): contact = models.ForeignKey(Contact, verbose_name="Name of person away", limit_choices_to=

Re: keeping SECRET_KEY secret

2007-11-01 Thread Todd O'Bryan
I then point to production_settings as my DJANGO_SETTINGS_MODULE for mod_python and the production settings overwrite the settings that I use for production. Of course, the last word should be "development," not "production." Todd --~--~-~--~~~---~--~~ You

Re: keeping SECRET_KEY secret

2007-11-01 Thread Todd O'Bryan
I actually have a production_settings.py file that only exists on my server, is not part of version control, and is only readable by the Apache user. It consists of: from settings import * DEBUG = False DATABASE_NAME = blah DATABASE_USER = blah DATABASE_PASSWORD = blah SECRET_KEY = blah

keeping SECRET_KEY secret

2007-11-01 Thread Carl Karsten
Given that some settings.py files get shared/posted/uploaded to code.google, etc. it seems this should not be in there by default: # Make this unique, and don't share it with anybody. SECRET_KEY = 'foo!' I am sure there are already a dozen or so good solutions to this problem, plus mine:

Re: Set attributes to input using newforms

2007-11-01 Thread Henhiskan
There is no widget docs for v0.96 documentation, but I just read the doc of current dojo version, and find the solution to my problem, just: discovered_time = forms.TimeField(widget=forms.TextInput(attrs={'dojoType':'dropdowntimepicker'})) Cheers.-

Set attributes to input using newforms

2007-11-01 Thread Henhiskan
Hi fellows, Am using django-0.96 and I need to set an input html attribute from a newforms I need to use a time picker from dojo, for that I need to have something like this: The only solution I can think of is to process the form.as_table() string and put the snip of code that I need, just

Re: Searches Across Many-to-Many with Intermediate Table

2007-11-01 Thread Andy Brody
Ah, thanks for the values() hint. It seems to work decently. I don't really need to access related model fields, I just want a list of unique group objects associated with a given musician's activities. The above becomes instead: qset = theMusician.activity_set.all().values('group').distinct()

Re: CSS problem

2007-11-01 Thread Goutham D L
Solved:) Really stupid mistake. I was using backslashes when i should have been using forward slashes.(Iam on windows btw). Thanks a lot for ur help. Goutham On 11/1/07, dunia <[EMAIL PROTECTED]> wrote: > > > Goutham DL wrote: > > Can some one please help me out here? > > > > On Nov 1, 7:03 pm,

MS SQL and Django - Any current info?

2007-11-01 Thread Peter Bailey
Can anyone tell me if there is any current news about MS SQL support? I am looking at frameworks for a client, and my preference is really to go the Django route. The plan will be to migrate over time from an asp environment with an MS SQL back end. So basically I am stuck having to use MS SQL

Re: Search MySQL Full-Text

2007-11-01 Thread jacoberg2
Well i realized after i posted this that i am actually using postgresql and not Mysql. So i am wondering if there is a way to do boolean searches in the same manner as described at the end of th article. --~--~-~--~~~---~--~~ You received this message because

Django and XML-Files

2007-11-01 Thread johannes
Hello, I'm planning to alter an existing hobby-project-site from php and xml/ xslt scripts into a python web-app. I just played around a little bit with django and must say I like it. First, having learned php, xslt and python by myself, I must say I'm definitely not a professional. My existing

Re: Caching querysets

2007-11-01 Thread Jeremy Dunck
On 11/1/07, Joe <[EMAIL PROTECTED]> wrote: > Correct me if I'm wrong, but wouldn't this place more load on the > server to to this, as an anonymous user visiting the site for the > first time would start a new session, and therefore bypass the cache? Sessions aren't created unless you modify a

Re: CSS problem

2007-11-01 Thread dunia
Goutham DL wrote: > Can some one please help me out here? > > On Nov 1, 7:03 pm, Goutham DL <[EMAIL PROTECTED]> wrote: > >> hi, >> Its still not working. Iam actually using django 0.96.The code that >> antoni gave is giving errors. >> Can someone please explain why i need to configure

Re: CSS problem

2007-11-01 Thread Antoni Aloy
The port is 8000 for Django, but I'll suppose is a typo. Please check: MEDIA_ROOT it should be your media folder and it must finist with / MEDIA_URL = 'http://localhost:8000/media/ on urls.py ... from django.con import settings ... if settings.DEBUG: urlpatterns += patterns('',

Re: CSS problem

2007-11-01 Thread Goutham D L
hi Actually i did exactly what u have done in the trunk version. Let me be more explicit. I have a login.html file in which i have a link to login.css. login.html is in templates directory login.css is in media/css directory both media and templates are in my project directory now i configured

Re: CSS problem

2007-11-01 Thread Antoni Aloy
2007/11/1, Goutham DL <[EMAIL PROTECTED]>: > > hi, > Its still not working. Iam actually using django 0.96.The code that > antoni gave is giving errors. The code is prepared for the trunk version of Django, but if you take a look at the settings file and the url.py file you'll see how it deals

Re: CSS problem

2007-11-01 Thread Ramdas S
I think your problem is something more elementary! You are not calling the CSS file from the right path. CSS files have to be served by another server other than Django development server. Why do not you try it with inline css first and see whether it works. Ramdas S On 11/1/07, Goutham DL

Re: Caching querysets

2007-11-01 Thread Joe
Sorry, meant to NOT vary on the value of the cookie header. On Nov 1, 11:39 am, Joe <[EMAIL PROTECTED]> wrote: > Correct me if I'm wrong, but wouldn't this place more load on the > server to to this, as an anonymous user visiting the site for the > first time would start a new session, and

Re: CSS problem

2007-11-01 Thread Goutham DL
Can some one please help me out here? On Nov 1, 7:03 pm, Goutham DL <[EMAIL PROTECTED]> wrote: > hi, > Its still not working. Iam actually using django 0.96.The code that > antoni gave is giving errors. > Can someone please explain why i need to configure media_urls ? > (media_root has been

Re: Caching querysets

2007-11-01 Thread Joe
Sorry for the mistake. This should read: Correct me if I'm wrong, but wouldn't this place more load on the server to to this, as an anonymous user visiting the site for the first time would start a new session, and therefore bypass the cache? Is there a way I could hack the middleware to look

Re: Caching querysets

2007-11-01 Thread Joe
Correct me if I'm wrong, but wouldn't this place more load on the server to to this, as an anonymous user visiting the site for the first time would start a new session, and therefore bypass the cache? Is there a way I could hack the middleware to look at something besides the HTTP headers to

Here we advertise you on in whole world through internet,its very easy way.........!

2007-11-01 Thread net expert
Its true that today world is Internet world,every thing is globelised,differences go away WE gave you our service on your pay demand,if you want to advertise your product,website,yourself profile or any thing you want,we advertise you in whole world,just contact us and try our sevice its true

Re: OneToOneField direction? (was Re: QuerySet.count() inaccurate across ForeignKey relationships)

2007-11-01 Thread George Vilches
Karen Tracey wrote: > On 11/1/07, *George Vilches* <[EMAIL PROTECTED] > > wrote: > [snip] > > For reporting purposes though, we would like to be able to > .select_related() on User, and get a cached copy of each of the OneToOne > relationships. It seems

Re: Obscure error installing Django

2007-11-01 Thread Julio César Carrascal Urquijo
I've tracked it down to something similar to this: http://code.djangoproject.com/ticket/5530#comment:1 The ImportError that is been raised on http://code.djangoproject.com/browser/django/trunk/django/db/backends/mysql/base.py#L20 is causing the session error. It probably should be changed also

Re: Off Topic: Slug regular expression

2007-11-01 Thread Jeremy Dunck
On 11/1/07, cjl <[EMAIL PROTECTED]> wrote: > > Do I need it if Django is already appending slashes? > No. Writing regular expressions is obviously something that can be done different ways. I think you should write your URLconfs expecting the slashes to be there so that you let Django append

Re: CSS problem

2007-11-01 Thread Goutham DL
hi, Its still not working. Iam actually using django 0.96.The code that antoni gave is giving errors. Can someone please explain why i need to configure media_urls ? (media_root has been configured to the appropriate directory). I just want to link the css file with the html one.how will using

template question

2007-11-01 Thread [EMAIL PROTECTED]
I have this code in my view, for example: a=['a','b','c'] # a list of row labels b=[1,2,3] # a list of col label c=tab # an array (list of list) with len(a) rows and len(b) cols. return render_to_response('template.html',{'a':a,'b':b,'c':c}) then on the template side, it's easy to print c {%

template question

2007-11-01 Thread [EMAIL PROTECTED]
I have this code in my view, for example: a=['a','b','c'] # a list of row labels b=[1,2,3] # a list of col label c=tab # an array (list of list) with len(a) rows and len(b) cols. return render_to_response('template.html',{'a':a,'b':b,'c':c}) then on the template side, it's easy to print c {%

Re: OneToOneField direction? (was Re: QuerySet.count() inaccurate across ForeignKey relationships)

2007-11-01 Thread Karen Tracey
On 11/1/07, George Vilches <[EMAIL PROTECTED]> wrote: [snip] > For reporting purposes though, we would like to be able to > .select_related() on User, and get a cached copy of each of the OneToOne > relationships. It seems reasonable by the very essence of OneToOne, but > I don't know if there's

Re: Django newbie, URL resloving problem

2007-11-01 Thread RajeshD
On Nov 1, 7:26 am, gizmo <[EMAIL PROTECTED]> wrote: > Hello, > I started learning about Django and I followed an example > athttp://www.djangobook.com/en/beta/chapter03/ > > I've done: > from django.conf.urls.defaults import * > from gizmo_site.datetime import current_datetime This suggests

Re: OneToOneField direction? (was Re: QuerySet.count() inaccurate across ForeignKey relationships)

2007-11-01 Thread Malcolm Tredinnick
On Thu, 2007-11-01 at 08:53 -0400, George Vilches wrote: > (Off-list because this mostly doesn't apply to non qs-rf people) > > Thank you for the clarification on OneToOneFields and required > relationships. We've been working with a very high volume legacy > database that we're importing the

Re: OneToOneField direction? (was Re: QuerySet.count() inaccurate across ForeignKey relationships)

2007-11-01 Thread George Vilches
Alright, I guess it's not offlist. Sorry for the extra chatter folks. George Vilches wrote: > (Off-list because this mostly doesn't apply to non qs-rf people) > > Thank you for the clarification on OneToOneFields and required > relationships. We've been working with a very high volume legacy

OneToOneField direction? (was Re: QuerySet.count() inaccurate across ForeignKey relationships)

2007-11-01 Thread George Vilches
(Off-list because this mostly doesn't apply to non qs-rf people) Thank you for the clarification on OneToOneFields and required relationships. We've been working with a very high volume legacy database that we're importing the data into, and that data's not exactly pristine. We're used to

Re: Django newbie, URL resloving problem

2007-11-01 Thread eXt
On 1 Lis, 12:26, gizmo <[EMAIL PROTECTED]> wrote: > Hello, > I started learning about Django and I followed an example > athttp://www.djangobook.com/en/beta/chapter03/ > > I've done: > from django.conf.urls.defaults import * > from gizmo_site.datetime import current_datetime > > urlpatterns = >

Re: UnicodeError in admin in latest django

2007-11-01 Thread Bert Heymans
Malcolm, Thanks for the explanation, I did mean to reply to your other message, sorry for working on your nerves. I understand now why it's a bad idea to use setdefaultencoding(). Bert On Nov 1, 4:12 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2007-10-31 at 10:10 -0700, Bert

Django newbie, URL resloving problem

2007-11-01 Thread gizmo
Hello, I started learning about Django and I followed an example at http://www.djangobook.com/en/beta/chapter03/ I've done: from django.conf.urls.defaults import * from gizmo_site.datetime import current_datetime urlpatterns = patterns('', (r'^\now$', current_datetime), ) When I

Re: Context processor not loading

2007-11-01 Thread Marty Alchin
On 11/1/07, Jon Atkinson <[EMAIL PROTECTED]> wrote: > As I understand it, this is all I need to do to have the context > processor execute properly, however neither 'spam' is output to the > console (I'm using the ./manage.py server), nor is 'eggs', or the > token 'cp_test' passed to the

Re: Default value for ForeignKey

2007-11-01 Thread Dan Ellis
On Nov 1, 2:55 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Set it in your model's save() method. I guess the point is that it's bad practice to hard-code magic values. Having thought about it some more, two options that spring to mind are: 1) Have a boolean 'default' field in the

Context processor not loading

2007-11-01 Thread Jon Atkinson
Hi, I'm having trouble with a context processor not running when I make a request. I've tried to reduce this to the simplest case I can: My projects tree is as follows: project/ context_processors/ __init__.py globals.py The file, 'globals.py', contains the following: def

Re: Off Topic: Slug regular expression

2007-11-01 Thread cjl
Do I need it if Django is already appending slashes? --~--~-~--~~~---~--~~ 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

Re: CSS problem

2007-11-01 Thread Gonzalo Delgado
El Thu, 01 Nov 2007 10:13:13 - Goutham DL <[EMAIL PROTECTED]> escribió: > > Hi, > > Iam new to django. Iam having problems loading css files (and images) > using the development server. Is it possible to load css files in the > development server or should i use mod_python? > (since iam a

Re: CSS problem

2007-11-01 Thread Antoni Aloy
2007/11/1, Goutham DL <[EMAIL PROTECTED]>: > > Hi, Hi > Iam new to django. Iam having problems loading css files (and images) > using the development server. Is it possible to load css files in the > development server or should i use mod_python? > (since iam a newbie to mod_python also i prefer

Re: CSS problem

2007-11-01 Thread Horst Gutmann
Sure :-) http://www.djangoproject.com/documentation/static_files/ - Horst On 11/1/07, Goutham DL <[EMAIL PROTECTED]> wrote: > > Hi, > > Iam new to django. Iam having problems loading css files (and images) > using the development server. Is it possible to load css files in the > development

CSS problem

2007-11-01 Thread Goutham DL
Hi, Iam new to django. Iam having problems loading css files (and images) using the development server. Is it possible to load css files in the development server or should i use mod_python? (since iam a newbie to mod_python also i prefer using the development server for sometime) Goutham

Re: ANN: Satchmo 0.6 Released

2007-11-01 Thread Jon Atkinson
Great - just as I downloaded 0.5 and got it working, I have to start over :-) --Jon On 10/31/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > > On 10/31/07, Chris Moffitt <[EMAIL PROTECTED]> wrote: > > > > There have been some spurious routing issues but it looks fine now. > > Are you still not

Re: ascii decode error bites again

2007-11-01 Thread Ivan Sagalaev
Kenneth Gonsalves wrote: > ProgrammingError at /web/admin/web/fosscalendar/add/ > ERROR: character 0xe28099 of encoding "UNICODE" has no equivalent in > "LATIN1" INSERT INTO > "web_fosscalendar" ("name","year","startdate","enddate","city_id","venue >

Re: ascii decode error bites again

2007-11-01 Thread Kenneth Gonsalves
On 01-Nov-07, at 10:06 AM, Karen Tracey wrote: > svn head, postgres 7.4.x, python 2.4 > > Traceback? I cannot recreate in my setup (considerably different: > svn newforms-admin, MySql 5.0, Python 2.5.1). It's probably > significant that the quote character in that string is curly, >