Re: question about django-pagination

2009-12-18 Thread Lakshman Prasad
> would I still be able to paginate over the entire list of 1 objects? Or my list would be shortened to 5 objects? Its the latter. Your query set will loop only for the size of it's length. On Sat, Dec 19, 2009 at 12:03 PM, Continuation wrote: > In the

Re: SQL transaction style in django?

2009-12-18 Thread Christophe Pettus
On Dec 18, 2009, at 9:58 PM, yummy_droid wrote: > I read that we can overwrite the save() for any model to do something > before/after its save. But my issue is, how can I be sure that what i > save + what the model needs to save happen as a transaction, so if > either fails, the whole thing

question about django-pagination

2009-12-18 Thread Continuation
In the django-pagination, it uses the example: {% autopaginate object_list %} My question is does object_list have to be the **entire** list over which I want to paginate, or can I limit the length of object_list? If I limit the length of object_list, will autopaginate still go through the entire

SQL transaction style in django?

2009-12-18 Thread yummy_droid
Hi, I read that we can overwrite the save() for any model to do something before/after its save. But my issue is, how can I be sure that what i save + what the model needs to save happen as a transaction, so if either fails, the whole thing fails. Example. I want to keep a total inventory count

feedparser import error

2009-12-18 Thread Nick
Hello, I've installed pydelicious and it seems to work until it imports feedparser.py. I've installed feedparser.py, and it's in the same directory as pydelicious. When pydelicious tries to import feedparser.py my app crashes. I get 'No module named feedparser'. Does anyone know why feedparser.py

Re: authentication security

2009-12-18 Thread James Bennett
On Fri, Dec 18, 2009 at 6:58 PM, macdd wrote: > plain text then it isn't very secure. Okay so https comes in. What I > don't understand is when to use it and when not to. It seems like if > you authenticate over https just for user credentials and then go back > to http

authentication security

2009-12-18 Thread macdd
I am reading the django book. I just finished the chapter on authentication. I get the jist of it. What I don't understand is the overall security of authentication. If everything you do is passed as plain text then it isn't very secure. Okay so https comes in. What I don't understand is when to

Rails-style form value deserializer?

2009-12-18 Thread Todd Blanchard
One thing I'm keenly missing from rails is the form input naming convention that causes the form values to be converted into a hierarchy. For instance, will result in the request values being stored as { 'foo' : {'bar' : 'one', 'baz' : 'two' }} this is very handy when updating multiple

attachments vs filebrowser

2009-12-18 Thread Todd Blanchard
I need users to attach arbitrary media files to database records. Attachments seems to do what I need, except that its UI is utterly lame - it should figure out the media type of the file from the extension and display an appropriate thumbnail as well as a way to provide a viewer inline.

Re: Problem with Meta inner class accessing its parent

2009-12-18 Thread Kevin Renskers
Thanks for the information, I will look into your suggestions. The getLanguage design did seem to work though, as changing the language did have an effect on the __unicode__ function: in the admin interface the correct values (for that language) were shown. At least it did so on the local

Re: csrf error on login and admin

2009-12-18 Thread Kenneth Gonsalves
On Wednesday 16 Dec 2009 10:45:49 am Paddy Joy wrote: > Try 'django.middleware.csrf.CsrfMiddleware' instead of > 'django.contrib.csrf.middleware.CsrfMiddleware' > copied and pasted straight from the official docs -- regards Kenneth Gonsalves Senior Project Officer NRC-FOSS

Correct way to unlazify a SimpleLazyObject?

2009-12-18 Thread Hanne Moa
I recently got burned by r11626, which added SimpleLazyObject to 1.1.x. I have a templatetag that linkifies a user-object, and it checks whether it is given a django.contrib.auth.models.User, an int (looks up a User) or a profile (looks up the User). This check was done with type(). Unfortunately,

filter and count on multi-table inheritance?

2009-12-18 Thread Gabriel Farrell
I have the following models: class News(models.Model): title = models.CharField(max_length=128) author = models.ForeignKey(User, related_name='news') class Report(News): subtitle = models.CharField(max_length=128) synopsis = models.TextField() class Post(News): body =

Re: How to deal with NULL value in template

2009-12-18 Thread Continuation
I tried {% if field %} No {% else %} Yes - {{ field }} {% endif %} And if the value of field is null, the else statement above ended up getting executed and output was "Yes - None" So far for me: {% ifequal field Null %} and {% ifequal field None %} works. But {% if field %} doesn't.

Re: Learning Django - Error going through Chapt 4 on Templates at DjangoBook.com - Probably real simple

2009-12-18 Thread bayousoft
Sorry guys. the explanation is in the next paragraph. Please disregard. On Dec 18, 1:50 pm, bayousoft wrote: > I am brand new to Django and I'm trying to get up to speed ASAP.  I > really like it so far.  I'm getting an error trying to create a > template in the shell. > >

Re: Learning Django - Error going through Chapt 4 on Templates at DjangoBook.com - Probably real simple

2009-12-18 Thread bayousoft
Looking in Synaptic I'm kinda wondering if I need to install python- jinja2 ? On Dec 18, 1:50 pm, bayousoft wrote: > I am brand new to Django and I'm trying to get up to speed ASAP.  I > really like it so far.  I'm getting an error trying to create a > template in the shell.

Custom Model Field with Validation...how to hook it back to ModelForm

2009-12-18 Thread bkev
Hello... A common occurrence I have with one particular project is that it requires the user to enter dimensions (for width/depth/height) in Feet and Inches. Calculations are needed to be performed on that dimension, so I've been working on a custom field type that takes in a dimension in

Having trouble building a search form with proper filters

2009-12-18 Thread jlwlynn
Okay, Here's a quick look at my model layout Contact : company -> ForeignKey -> Company Company : type --> OneToOne --> Type Type : type (character) I'm trying to build a search that will return contacts based on certain criteria. Any other fields in Company that do not join to another

Learning Django - Error going through Chapt 4 on Templates at DjangoBook.com - Probably real simple

2009-12-18 Thread bayousoft
I am brand new to Django and I'm trying to get up to speed ASAP. I really like it so far. I'm getting an error trying to create a template in the shell. >>> from django import template >>> t = template.Template('My name is {{ name }}.') Traceback (most recent call last): File "", line 1, in

Re: Strange problem when starting project in Windows XP

2009-12-18 Thread dfolland
idle.pyw is the gui version of the python idle editor. Sounds like you've got file extension .py associated with it, instead of python. On Dec 18, 11:59 am, OkaMthembo wrote: > Hi Dane, > > Yes, when you have to specify an absolute path to get it working, it > definitely

Re: problems downloading django

2009-12-18 Thread Michael K
On Dec 18, 2:13 pm, Michael K wrote: > Still having the same issue.  I'm on a windows machine, but even if I > use wget on one of the Solaris machines, the TAR is reported as having > no files and/or is corrupted. > > Is there another download location I can try? > > -- >

Re: problems downloading django

2009-12-18 Thread Michael K
On Dec 18, 2:10 pm, Michael K wrote: > On Dec 16, 4:10 pm, James Bennett wrote:> On Wed, Dec > 16, 2009 at 2:13 PM, Michael K wrote: > > > Should I take the silence to mean I should open a bug report? > > > I clicked the "download"

Re: problems downloading django

2009-12-18 Thread Michael K
On Dec 16, 4:10 pm, James Bennett wrote: > On Wed, Dec 16, 2009 at 2:13 PM, Michael K wrote: > > Should I take the silence to mean I should open a bug report? > > I clicked the "download" link for Django 1.1.1, and the package > downloaded. On finishing

Re: Strange problem when starting project in Windows XP

2009-12-18 Thread OkaMthembo
Hi Dane, Yes, when you have to specify an absolute path to get it working, it definitely sounds like a PATH environ config. problem. When you check your PATH variables, do you see the folder to django-admin.py listed? Regards, Lloyd On Fri, Dec 18, 2009 at 7:27 PM, Dane

Re: Strange problem when starting project in Windows XP

2009-12-18 Thread Dane
It worked with 'python c:\python26\scripts\django-admin.py startproject newsite'. Does that mean the PATH got messed up somehow? On Dec 18, 7:52 am, Shawn Milochik wrote: > What happens when you type 'python django-admin.py'? > > If that doesn't work, try replacing 'python'

Re: cached_db session backend, memcached and SESSION_COOKIE_AGE > 30 days

2009-12-18 Thread Jose C
In case anyone else hits this issue, there's a patch available: http://code.djangoproject.com/ticket/12399 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from

Re: Error creating new project

2009-12-18 Thread Gaston
Thanks Ales, there were problems with the symlink. Deleting it and just doing python setup.py install solved the problem. Thanks again for your help! -Gaston On Dec 17, 3:08 am, Ales Zoulek wrote: > OK. > > Try: > > ls SITE-PACKAGES-DIR/django > > is there a "core",

Re: LDAP-groups problem

2009-12-18 Thread Wayne
Hi, Sorry for the late reply. Here is more info. Django Verstion: 1.1 Oracle Version:Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production cx_oracle for Python 2.6. Thanks for the help. Wayne On Dec 18, 10:26 am, Peter Herndon wrote: > On Dec 18, 2009, at

Re: TemplateSyntaxError: 'property' object is not iterable

2009-12-18 Thread Chris Curvey
Never mind. Me am a moron. Had a totally different programming error elsewhere. It works as is it should. On Dec 17, 4:12 pm, Chris Curvey wrote: > I have my class definition that looks like > > class Foo: >    def get_bars(self): >       bars = [] >        # do something

Re: Directories inside app directory

2009-12-18 Thread Bill Freeman
On Thu, Dec 17, 2009 at 5:02 AM, bruno desthuilliers wrote: ... > > [1] currently 970 LOCs, and I just have the basic models structures > and only one custom manager defined yet, so I know there will be more > to come. YMMV but I don't like modules growing much

Early Registration for PYCON in Atlanta Ends Jan 7

2009-12-18 Thread dartdog
See link for details https://us.pycon.org/2010/register/default/index -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: Django Settings File - Where is it?

2009-12-18 Thread Rafael Vieira
It is the project configuration's file, "settings.py" where you can change project options, for example, DATABASE_NAME equals name of your database and more... 2009/12/18 Biju Varghese : > create a project with django-admin.py startproject project1 > and this will create a

Re: Django Settings File - Where is it?

2009-12-18 Thread Biju Varghese
create a project with django-admin.py startproject project1 and this will create a folder named project1 and check in this foder will have settings.py urls.py manage.py and __init__.py etc. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Problem with Meta inner class accessing its parent

2009-12-18 Thread Bill Freeman
I can't promise that it will do what you want, but your problem is that at the time you try to set the value of Meta.ordering, class Substrate does not yet exist. You can dig into the Substrate.objects._meta later to add ordering, probably. Your design wouldn't have worked anyway, since

Re: LDAP-groups problem

2009-12-18 Thread Peter Herndon
On Dec 18, 2009, at 10:15 AM, Peter Herndon wrote: > > On Dec 17, 2009, at 7:32 PM, Wayne wrote: > >> Hi, > > This error arises from an inconsistency between the behavior of Oracle and > the behavior of PostgreSQL, as Mike noted. It works under Postgres. I'll > check with the dev list and

Re: LDAP-groups problem

2009-12-18 Thread Peter Herndon
On Dec 17, 2009, at 7:32 PM, Wayne wrote: > Hi, Hi Wayne, > > I tried to use djando-ldap-groups but got some errors from database > configuration. Could somebody shed some light on the possible problems > of my set up? Hmm, I think I found the problem below. > > Our LDAP server is Sun One

Re: Need help inserting pdf

2009-12-18 Thread Shawn Milochik
The difference between the PDF and JPG is that the JPG has to be an 'img' tag and the PDF has to be an 'href' tag. So instead of: Try: Download Important Stuff Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Strange problem when starting project in Windows XP

2009-12-18 Thread Shawn Milochik
What happens when you type 'python django-admin.py'? If that doesn't work, try replacing 'python' there with the full path to your Python executable in Windows. I've never heard of this problem, but it sounds like it could be something odd in the environment. Shawn -- You received this

Strange problem when starting project in Windows XP

2009-12-18 Thread Dane
Hi all, I'm new to Django. I got through the beginner tutorial without much trouble and I just finished the introductory chapters of The Definitive Guide, so I decided to start work on a real project. I've quickly run into a bizarre stumbling block however when I try to start my new project. I

Problem with Meta inner class accessing its parent

2009-12-18 Thread Kevin Renskers
Hi, I am having a bit of a problem. I have a model with 3 name fields, each for a different language. By creating an __unicode__ function like below, I always get the correct name for the current language. Works fine. But, I want to change the default ordering for this model, so that in each

format date output in mail form

2009-12-18 Thread rvandam
I saw a solution on the list to format a datefield in a template. Unfortunately i didnt find any solution for formatting a datefield in a mailform. I have this in my model: Aankomst = forms.DateField(('%d/%m/%Y',), widget=forms.DateTimeInput (format='%d/%m/%Y', attrs={

Re: Error message

2009-12-18 Thread rebus_
2009/12/18 reactosguy : > I get this message every time I go on http://localhost:8000/ with the > Django server running: > > Traceback (most recent call last): > >  File "C:\Python26\lib\site-packages\django\core\servers > \basehttp.py", line 279, in run >    self.result =

Re: How to deal with NULL value in template

2009-12-18 Thread Daniel Roseman
On Dec 18, 7:12 am, Continuation wrote: > I have a field with the null=True option > > How do I test for the Null value in template? > > I did something like: > > {% ifequal field Null %} >     do something > {% else %} >     do something else > > I tested it and it

Re: extend queryset field lookups for time

2009-12-18 Thread hinnack
has nobody an idea for this? Hour and Minute itself seems to be easy - should just be added to where.py WhereNode class => make_atom() - but how to extend the functionality to greater / lower? -- Hinnack On Nov 27, 2:53 pm, Hinnack wrote: > Hi, > > how would I

Fwd: Ticket #2417 Support for binary type fields

2009-12-18 Thread Hinnack
noone interested in this? -- Hinnack -- Forwarded message -- From: Hinnack Date: 2009/12/13 Subject: Ticket #2417 Support for binary type fields To: Django users Hi, is there a timeframe, when this will make it

Re: InternalError -- django specific state?

2009-12-18 Thread shaunc
In fact, my code had a bug in it -- I was both rolling back and releasing the savepoint (via a finally). Sorry about that. For the record this *does* work: you can use savepoints and row-level locking for synchronization between different processes, as you would hope Thanks. On Dec 18, 2:03