Re: Cookie test in login() view

2009-01-31 Thread Karen Tracey
On Sat, Jan 31, 2009 at 9:36 PM, Akbar wrote: > > Hi, > > The cookie test in django.contrib.auth.views.login() view doesn't seem > to work as expected. I disabled cookies in my browser for the > following test. > > 1. The view is called via a GET request and displays the login

Wierd FileField behavior

2009-01-31 Thread DrKayBee
Hi, I have a simple profile model which includes the option to upload a File (FileField) and a photograph (ImageField). These two fields show somewhat undesirable behavior: (1) Let's say I create a profile and upload a photo through the admin. (2) My member view page shows my photo and other

Modifying the Tutorial's Admin Page -- Labels and Items Displayed

2009-01-31 Thread Tom
I'm very new to Django, and I'm working on the official Polls tutorial. I've poked around quite a bit, and I am having difficulty figuring out two things: 1. On the admin index page, how do I get rid of the Auths and the Sites sections and only leave the Polls section? 2. Just above the Auths

Re: remember me on this computer vs SESSION_EXPIRE_AT_BROWSER_CLOSE

2009-01-31 Thread SmileyChris
You're on the right track. As the docs state, you can then override the site-wide setting: http://docs.djangoproject.com/en/dev/topics/http/sessions/#browser-length-sessions-vs-persistent-sessions Steve's comment about requiring a "huge session store" is not really too much of an issue. It's

Cookie test in login() view

2009-01-31 Thread Akbar
Hi, The cookie test in django.contrib.auth.views.login() view doesn't seem to work as expected. I disabled cookies in my browser for the following test. 1. The view is called via a GET request and displays the login template/form. The test cookie is set. 2. The form is posted back to the view.

Re: remember me on this computer vs SESSION_EXPIRE_AT_BROWSER_CLOSE

2009-01-31 Thread Steve Holden
felix wrote: > > I'm trying to implement the standard option "remember me on this computer" > > which in practice means expire the session or not at the end of the > session No it doesn't: you want the session to end when the user logs out, otherwise in a large site you would end up needing a

Re: extending the django admin site

2009-01-31 Thread Santiago
in lines: 2009/2/1 alexander lind : > > How do I add a custom field to the a model rendered as a form by > django admin site? > Use custom widgets > My model has a 'choices' field with 4 possible choices: png, gif, jpg > and 'none'. As you can guess this describes the

Re: FormWizard accessing previous fields data

2009-01-31 Thread mattimust...@gmail.com
On Feb 1, 3:27 am, "lbologn...@gmail.com" wrote: > On Jan 29, 11:31 pm, "lbologn...@gmail.com" > wrote: > > > Hi all, > > > say i have aFormWizardof 5 steps and at the last step i want to > > display a summary of the submitted data how do i access

Re: Validating and rendering dynamic form

2009-01-31 Thread Louis Sayers
answer from stackoverflow: http://stackoverflow.com/questions/499964/how-do-you-create-python-methodssignature-and-content-in-code/499982#499982 Python code behaves like this for functions defined in scope of methods. Use this instead: for image_name in image_fields: print "image name is:

Re: Application design question

2009-01-31 Thread alex.gay...@gmail.com
On Jan 31, 8:04 pm, eddie wrote: > Hey guys & girls, > > I've just started playing with django, and am not sure of the best way > to do something. > > I've got a basic site, where page a displays model a, page b displays > model b, etc.  Every model has it's own view

Application design question

2009-01-31 Thread eddie
Hey guys & girls, I've just started playing with django, and am not sure of the best way to do something. I've got a basic site, where page a displays model a, page b displays model b, etc. Every model has it's own view function and template, all extending a base template with a header,

extending the django admin site

2009-01-31 Thread alexander lind
How do I add a custom field to the a model rendered as a form by django admin site? My model has a 'choices' field with 4 possible choices: png, gif, jpg and 'none'. As you can guess this describes the format of an image. What I want to do is get the admin site to display a file upload

Re: Validating and rendering dynamic form

2009-01-31 Thread Louis Sayers
For some reason, _clean_photo is being given the last image name for dataName, and that's why only the last picture is being validated. The line of code that calls _clean_photo with the image name is: setattr(new_form, 'clean_' + image_name, lambda self: self._clean_photo (image_name)) This

Django newbie question re: porting from Google App Engine to Django standalone

2009-01-31 Thread Mark.Petrovic
Good day. I'm new here, as well as a new (all of two months of experience) Python web app developer. I'm interested in porting a Google App Engine "google.appengine.ext.webapp"-based app to a standalone Django app on another platform. I've ported my data models from GAE to Django, as well as

Re: Validating and rendering dynamic form

2009-01-31 Thread Louis Sayers
Ok... maybe not so solved. Now ony the last image submitted is validated. in the _clean_photo (self, dataName) method, I print the data, and all the images except for the last one contain None. Any Ideas? On Feb 1, 12:51 pm, DragonSlayre wrote: > Solved my problem - data =

Re: Installing Django 1.0.2...

2009-01-31 Thread mic
hi Karen, >> That's odd. Do you have the files: >> C:\Django-1.0.2-final\django\utils\__init__.py >> C:\Django-1.0.2-final\django\utils\version.py I have the following structure... C:\Django-1.0.2-final\django\__init__.py C:\Django-1.0.2-final\django\utils\version.py Can't figure out why

Re: Validating and rendering dynamic form

2009-01-31 Thread DragonSlayre
Solved my problem - data = self.cleaned_data[dataName] should have been: data = self.cleaned_data.get(dataName) Silly me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Weird Name error?

2009-01-31 Thread Joshua Bonnett
I am getting a weird error when I call a property from a template. I also tried calling it from the view and get the same error. However I have called it from another script it works fine. Error: http://dpaste.com/115147/ definition of survivor(which is being included with the same include that

Re: django sqlite autoincrement bug

2009-01-31 Thread alexander lind
>> Anyway, if you you'd like to fix your patch to always do this for the >> SQLite backend, that would be great (it looks like a one-line patch >> to >> django/db/backends/sqlite/creation.py). > > I don't see a simple way to make this happen. Doesn't seem like any > other backend DB requires

Re: "invalid reference to FROM-clause" for nested annotate query

2009-01-31 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 12:44 AM, omat wrote: > > Hi all, > > I obtain a list of tag ids by: > tag_ids = TaggedItem.objects.all().order_by('-added__max').annotate(Max > ('added'))[:10] > > and try to use it in the following query to obtain tag objects: >

Re: django sqlite autoincrement bug

2009-01-31 Thread alexander lind
> >> Reading sqlites manual, >> this is _supposed_ to work, but doesn't seem to. However and >> furthermore, you don't really get autoincrement behavior from sqlite >> unless you add in the SQL keyword "AUTOINCREMENT" when creating the >> table. >> >> Django does not do this currently, so I

Apache ImportError: Could not import settings

2009-01-31 Thread DragonSlayre
Hi, I'm at the final stage in one of my django developments, and am trying to get my site live. I've been following instructions on http://www.jeffbaier.com/2007/07/26/installing-django-on-an-ubuntu-linux-server/ but got the following error: File

Re: Building local Django docs as HTML on Win32?

2009-01-31 Thread Technicalbard
OK - figured this out by myself. - Need the Gnuwin32 version of make - then need to install sphinx and all it's dependencies. Simple with easy_install - then edit Makefile to adjust it to handle win32 commands, primarily the use of backslashes: On Unix/Linux: mkdir -p _build/html

Re: django sqlite autoincrement bug

2009-01-31 Thread alexander lind
>> >> class User(models.Model): >> user_id = >> models.AutoField(primary_key=True) >> >> This produces a table in sqlite that will NOT take NULL for a value >> when inserting records. You get an error back. > > That's correct behaviour. A primary key

Re: Meta-information for model and form fields

2009-01-31 Thread Vinay Sajip
On Jan 30, 1:36 am, Malcolm Tredinnick wrote: > On Wed, 2009-01-28 at 23:21 -0800, Vinay Sajip wrote: > > [...] > > > I was hoping there was another way. Of course subclassing's not hard > > to do, but it means doing it for every field class. I was looking at > >

Building local Django docs as HTML on Win32?

2009-01-31 Thread Technicalbard
I've found a number of places on the net that tell me how to build myself a copy of Django documentation from the Restructured Text format, but they are all for Linux / BSD. Any advice on how to do this on Windows without Cygwin? --~--~-~--~~~---~--~~ You

remember me on this computer vs SESSION_EXPIRE_AT_BROWSER_CLOSE

2009-01-31 Thread felix
I'm trying to implement the standard option "remember me on this computer" which in practice means expire the session or not at the end of the session it looks like django's auth uses a sitewide setting SESSION_EXPIRE_AT_BROWSER_CLOSE does anybody know the best way to approach this ? is it

Re: Reverse foreign key lookup with unknown model

2009-01-31 Thread Antoni Aloy
2009/1/31 Julian : > > hi there, > > I have a problem I really cannot solve on my own. lets say I have > three models: > > class A(models.Model): > ... > > class B(models.Model): >fk = models.OneToOneField("A") > > class C(models.Model): >fk =

Re: Template tags question

2009-01-31 Thread Antoni Aloy
2009/1/31 zentur : > > Hello, > > i´ve got a problem with the template code of django > > i would like to realize this simple task > > for (i = 0, i++, i< list[0].length) > { >list[0][i] , list[1][i] > } > > to display some data on a site, but with the django template

Re: Merging results from two tables

2009-01-31 Thread Daniel Roseman
On Jan 31, 12:27 pm, Markus wrote: > Hi > > just starting to use Django, am stuck with the following problem: > > Given > > class A(models.Model): >     ...some fields... > > class B(models.Model): >    A = models.ForeignKey(A) >    some fields... > > I would like to

Re: Using hashing for password checking in auth module

2009-01-31 Thread Kless
Rutenberg, you're correct. bcrypt is only a solution for storing the hash of passwords of secure way. In fact, it's the way more secure and easy that I've found; and it has been implemented and is being used by OpenBSD. Your method has a point of failure. Whatever can see your code JS

Template tags question

2009-01-31 Thread zentur
Hello, i´ve got a problem with the template code of django i would like to realize this simple task for (i = 0, i++, i< list[0].length) { list[0][i] , list[1][i] } to display some data on a site, but with the django template tags I can ´t get somthing similar to work. Could anyone give

Re: Using ./manage.py test without a database and with a custom test runner fails

2009-01-31 Thread Karen Tracey
On Sat, Jan 31, 2009 at 9:53 AM, Jarkko Laiho wrote: > > I'm developing a simple Ajax backend that presently only consists of > one URLconf and a single view. I'm trying to do test-driven > development and have a few initial tests present, but 'manage.py test' > is

Re: FormWizard accessing previous fields data

2009-01-31 Thread lbologn...@gmail.com
On Jan 29, 11:31 pm, "lbologn...@gmail.com" wrote: > Hi all, > > say i have aFormWizardof 5 steps and at the last step i want to > display a summary of the submitted data how do i access the value of a > field that was in the form at step 1? Maybe i didn't express myself

Re: "invalid reference to FROM-clause" for nested annotate query

2009-01-31 Thread Alex Koshelev
What database backend do you use? On Sat, Jan 31, 2009 at 6:44 PM, omat wrote: > > Hi all, > > I obtain a list of tag ids by: > tag_ids = TaggedItem.objects.all().order_by('-added__max').annotate(Max > ('added'))[:10] > > and try to use it in the following query to obtain tag

Re: new record - onetoonefield - create related record

2009-01-31 Thread John M
Hi Karen, and thanks for the reply. I've always wanted to use the 1-1 field, but whenever a new parent record is added, I want it to automatically add (via the save() ) ovoerride above to the child 1-1 table. Yes, the debug does print, and the above code seems to work from the shell too, it's

Re: "setup_environ" can't help to run a standalone script

2009-01-31 Thread 文武
I approve it You should just check your project's settings.py can be import 2009/1/31 Orcun Avsar > > > On 31 Ocak, 03:09, Malcolm Tredinnick > wrote: > > > I suspect you just haven't set > > up your Python path correctly (which is the cause of

Merging results from two tables

2009-01-31 Thread Markus
Hi just starting to use Django, am stuck with the following problem: Given class A(models.Model): ...some fields... class B(models.Model): A = models.ForeignKey(A) some fields... I would like to generate a Queryset that returns values from both tables, ie in SQL SELECT

"invalid reference to FROM-clause" for nested annotate query

2009-01-31 Thread omat
Hi all, I obtain a list of tag ids by: tag_ids = TaggedItem.objects.all().order_by('-added__max').annotate(Max ('added'))[:10] and try to use it in the following query to obtain tag objects: Tag.objects.filter(id__in=tag_ids) But i get "invalid reference to FROM-clause" error: Caught an

Re: How do I correctly format a Querydict derived list in a url?

2009-01-31 Thread NoviceSortOf
> > > myurl.com/activities/[u'ireland', > > > u'nireland']/: what I really want > > > is: > > > > /activities/ireland-nireland/ > I'm not sure if any of this is the 'correct' way but it likely will work. Try a combination of python's eval() and str()

Reverse foreign key lookup with unknown model

2009-01-31 Thread Julian
hi there, I have a problem I really cannot solve on my own. lets say I have three models: class A(models.Model): ... class B(models.Model): fk = models.OneToOneField("A") class C(models.Model): fk = models.OneToOneField("A") If I have then a single A-instance, how can I

Using ./manage.py test without a database and with a custom test runner fails

2009-01-31 Thread Jarkko Laiho
I'm developing a simple Ajax backend that presently only consists of one URLconf and a single view. I'm trying to do test-driven development and have a few initial tests present, but 'manage.py test' is crapping out on me. Initially, I got ImproperlyConfiguredError for not having DATABASE_*

i need help about comments.

2009-01-31 Thread Muslu Yüksektepe
hi guys; i am preparing to blog and i need help about comments. i am using v1.0.2. who can tell me how can i add comments on html? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Snippets app ?

2009-01-31 Thread Steve Holden
Nicolas Steinmetz wrote: > Hi djangonauts, > > For my site, I planned to include a snippets app and was thinking about > cab [1] which powers djangosnippets or some other snippets app. > > For Cab, it looks it's not updated since April 2007 so I think it's not > compatible with Django 1.0.x or

Re: Snippets app ?

2009-01-31 Thread Steve Holden
Nicolas Steinmetz wrote: > Hi djangonauts, > > For my site, I planned to include a snippets app and was thinking about > cab [1] which powers djangosnippets or some other snippets app. > > For Cab, it looks it's not updated since April 2007 so I think it's not > compatible with Django 1.0.x or

Re: Someone using django trunk for production?

2009-01-31 Thread Andrew Ingram
Alessandro Ronchi wrote: > I need to use aggregation features of django 1.1 (i need AVG, SUM). > > My production site uses 1.0.2. > > Can I upgrade to trunk without worrying? > > Are you using the width_field and height_field properties of ImageField at all? They're broken if used in the

Re: Using hashing for password checking in auth module

2009-01-31 Thread Guy Rutenberg
Hi Kless, Correct me if I'm wrong but bcrypt can be used as a solution for storing the passwords in the database (instead of the default sha1) but it doesn't provide the solution I'm looking for: not sending plain- text passwords in login forms. Anyway bcrypt sounds interesting, especially its

Re: "setup_environ" can't help to run a standalone script

2009-01-31 Thread Orcun Avsar
On 31 Ocak, 03:09, Malcolm Tredinnick wrote: > I suspect you just haven't set > up your Python path correctly (which is the cause of about 98% of all > import-related problems on this list). > > Regards, > Malcolm i checked my python path and added two path.

Someone using django trunk for production?

2009-01-31 Thread Alessandro Ronchi
I need to use aggregation features of django 1.1 (i need AVG, SUM). My production site uses 1.0.2. Can I upgrade to trunk without worrying? -- Alessandro Ronchi Skype: aronchi http://www.alessandroronchi.net SOASI Soc.Coop. - www.soasi.com Sviluppo Software e Sistemi Open Source Sede: Via

Re: Using hashing for password checking in auth module

2009-01-31 Thread Kless
I recommend you to use bcrypt, the password-hashing algorithm used in OpenBSD. The advantages are that it creates and manages auto. the salt for each password entered; And the most important is that it is adaptable to future processor performance improvements.

Re: Inherit/Override custom Form class methods in a custom ModelForm class

2009-01-31 Thread Daniel Roseman
On Jan 31, 1:26 am, Malcolm Tredinnick wrote: > On Fri, 2009-01-30 at 12:19 -0800, Daniel Roseman wrote: > > [...] > > > This is an ideal case for mixins. A mixin is a basic class which is > > 'mixed in' to other classes, which inherit both the attributes of > > their