Re: ldap authentication hangs under fcgi

2008-08-28 Thread mattxbart
I figured this out with Michael over at the python-ldap-dev list. I ran valgrind on my fcgi socket and found that cx_Oracle would go absolutely nuts (for lack of a better term) when a global db cursor was present at the time of ldap.initialize(), causing a segmentation fault. On Aug 22, 4:24 pm,

Re: ManyToMany + through + using add, d

2008-08-28 Thread akaihola
This looks like Gergo's ticket for his original request: http://code.djangoproject.com/ticket/8334 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

Re: Django new comments framework error

2008-08-28 Thread tonemcd
Also see http://groups.google.com/group/django-users/browse_thread/thread/1f4bb991f9f0f7b5/62005ad4330c4884?lnk=gst&q=noReverseMatch#62005ad4330c4884 Short summary: maybe your named url regexes aren't matching the variables passed to them in the {% url ... %} tag. Apply the patch from http://cod

new be Many to many relation question

2008-08-28 Thread [EMAIL PROTECTED]
Hello All. I have following models class MasterProject(models.Model): project_name = models.CharField(blank=True, max_length=135) description = models.TextField(blank=True) pid_headcount = models.IntegerField(blank=True) business_unit = models.ForeignKey(MasterBusinessUnit) c

creating and using postgresql sequences using django orm?

2008-08-28 Thread ydjango
I need to create sequences and use them during runtime in django orm code. Mysql does not support external sequence. sequence name will be dynamically generated. I already have default id auto-increment fields in all tables, but this sequence which i need is not table level, so autofield will not

define "_default_manager" and the admin-interface

2008-08-28 Thread Brot
Hello, At the moment I am reading the "Practical Django Projects" - Book written by James Bennett. On page 120 there is a admonition about using Default Managers. Above this paragraph there is the explanation about the Default Manager und Entry.objects.all() and Entry.live.all(). It seems clear

Re: to_field in admin

2008-08-28 Thread chr
thanks for your help. the patch works great. cheers. chr --~--~-~--~~~---~--~~ 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 th

Re: imports

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 21:41 -0700, lingrlongr wrote: [...] > Has something changed? Nothing popped out at me on the Backwards- > incompatible changes. Nothing should have changed that caused this if your code was correct earlier. The best way to work out where the problem is simple to start bi

imports

2008-08-28 Thread lingrlongr
I had all my imports for my apps relative to the app, not the project. Since my last SVN checkout this evening, everything on the site I'm working on is broken. I would get an error stating (app after app) that the module app_name.models (etc) could not be found. The import syntax was: from app

Re: Django new comments framework error

2008-08-28 Thread hotani
Did you delete the .pyc files from the django source? Another approach would be to go into /django/contrib/ and delete the comments directory, then do an 'svn up' to restore it. Then you'll be sure to get a fresh copy. That is what worked for me. But if you haven't used the comment system before

Re: Issues for run "runserver" command.

2008-08-28 Thread Issac
I have installed python2.5 on RH3L-AS4 successfully. And already installed Django1.0-beta2 successfully. After i create a project test, when i use python manage.py runserver to start the dev server, the log shows error during the starting process: ===

Issues for run "runserver" command.

2008-08-28 Thread Issac
I have installed python2.5 on RH3L-AS4 --~--~-~--~~~---~--~~ 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 group, send ema

Re: Modify settings.py file through admin?

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 19:47 -0700, Dana wrote: > Hey All, > > Been trying to modify the settings.py file through admin using > something along the lines of: > > settings.py file: > -- > from config.models import SiteSetting > > > config= SiteSetting.objects

Modify settings.py file through admin?

2008-08-28 Thread Dana
Hey All, Been trying to modify the settings.py file through admin using something along the lines of: settings.py file: -- from config.models import SiteSetting config= SiteSetting.objects.get(pk=1) TIME_ZONE = config.timezone -- 'config

Re: cannot import name ugettext_lazy

2008-08-28 Thread Wayne Dyck
> No, it wasn't. I'm really not making this up: ugettext_lazy() has been > in trunk since July 4 last year! Bizarre. Okay. I will take your word for it. I am fairly new to Django so I am not excusing the fact that it might simply be ignorance on my part how everything works and the location of th

Re: cannot import name ugettext_lazy

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 19:20 -0700, Wayne Dyck wrote: > > Well, it's int django/utils/translation/__init__.py. Specifically: > > > > http://code.djangoproject.com/browser/django/trunk/django/utils/trans... > > It looks like it was just checked in a little while ago. I will > download the latest f

Re: cannot import name ugettext_lazy

2008-08-28 Thread Wayne Dyck
> Well, it's int django/utils/translation/__init__.py. Specifically: > > http://code.djangoproject.com/browser/django/trunk/django/utils/trans... It looks like it was just checked in a little while ago. I will download the latest from SVN and try that. Thanks. I appreciate it. Wayne --~--~

Re: 'adminapplist' is not a valid tag library

2008-08-28 Thread XtraGreen
Yeah, apparently I needed the admin templates in a previous version. I renamed templates/admin and it's all good now. Thanks! On Aug 28, 8:10 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Thu, Aug 28, 2008 at 8:56 PM, XtraGreen <[EMAIL PROTECTED]> wrote: > > > I'm upgrading a Django site

Re: Inconsistencies/Bug in ModelForm

2008-08-28 Thread lingrlongr
Yes, Malcolm. You understood it correctly. I'll probably just add a quick MY_CHOICES_2 tuple that has these "-" values until I see what the plan is. On Aug 28, 9:40 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-08-28 at 21:32 -0400, Steve Holden wrote: > > lingrlongr

Re: cannot import name ugettext_lazy

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 18:37 -0700, Wayne Dyck wrote: > > I think the original poster's tarball of Django is broken. At least the > > 1.0-alpha version is. The 0.96 releases never had ugettext_lazy(). > > So I should be seeing it at this location django.utils.translation in > the latest SVN beta?

Re: Inconsistencies/Bug in ModelForm

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 21:32 -0400, Steve Holden wrote: > lingrlongr wrote: > > Submitted ticket #8663 for the following: > > > > When a ModelForm? is used to display a form for a Model, the fields > > defined with a choices option insert a "---" value for the first > > option when the form i

Re: cannot import name ugettext_lazy

2008-08-28 Thread Wayne Dyck
> I think the original poster's tarball of Django is broken. At least the > 1.0-alpha version is. The 0.96 releases never had ugettext_lazy(). So I should be seeing it at this location django.utils.translation in the latest SVN beta? I browsed the code today on the website and didn't see it in th

Re: Inconsistencies/Bug in ModelForm

2008-08-28 Thread Steve Holden
lingrlongr wrote: > Submitted ticket #8663 for the following: > > When a ModelForm? is used to display a form for a Model, the fields > defined with a choices option insert a "---" value for the first > option when the form is rendered. If you override a field and manually > specify the choic

Re: cannot import name ugettext_lazy

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 21:18 -0400, Karen Tracey wrote: [...] > > Make sure you have an SVN checkout at revision 8680 or higher. This: > > http://code.djangoproject.com/ticket/8654 > > looks like it could be responsible for what you are reporting, and the > fix was only checked in about five h

Re: cannot import name ugettext_lazy

2008-08-28 Thread Karen Tracey
On Thu, Aug 28, 2008 at 9:10 PM, Wayne Dyck <[EMAIL PROTECTED]> wrote: > > A couple of applications I have tried to install fail trying to import > ugettext_lazy. Specifically the import line is: > > django.utils.translation import ugettext_lazy as _ > > I have seen a number of posts that suggest

cannot import name ugettext_lazy

2008-08-28 Thread Wayne Dyck
A couple of applications I have tried to install fail trying to import ugettext_lazy. Specifically the import line is: django.utils.translation import ugettext_lazy as _ I have seen a number of posts that suggest getting the latest source from SVN. I have Django version 96.2 and I have downloade

Re: 'adminapplist' is not a valid tag library

2008-08-28 Thread Karen Tracey
On Thu, Aug 28, 2008 at 8:56 PM, XtraGreen <[EMAIL PROTECTED]> wrote: > > I'm upgrading a Django site from 0.96 to the 1.0 beta (django-trunk > svn as of tonight) and it's mostly going smoothly except the built in > Django admin is giving me issues. > > I think I've got everything setup for the ne

Re: Odd error when executing "runserver"

2008-08-28 Thread Graham Dumpleton
On Aug 29, 6:43 am, Huuuze <[EMAIL PROTECTED]> wrote: > I recently installed PostgreSQL 8.3.3 and psycopg 2 (latest from > SVN). When I attempt to start Django, I receive this error: > > File "/Library/Python/2.5/site-packages/django/db/backends/ > postgresql_psycopg2/base.py", line 20, in >

Inconsistencies/Bug in ModelForm

2008-08-28 Thread lingrlongr
Submitted ticket #8663 for the following: When a ModelForm? is used to display a form for a Model, the fields defined with a choices option insert a "---" value for the first option when the form is rendered. If you override a field and manually specify the choices for a Select widget, this "

'adminapplist' is not a valid tag library

2008-08-28 Thread XtraGreen
I'm upgrading a Django site from 0.96 to the 1.0 beta (django-trunk svn as of tonight) and it's mostly going smoothly except the built in Django admin is giving me issues. I think I've got everything setup for the new admin code, but when I try to execute the main admin page I get the following e

Re: Odd error when executing "runserver"

2008-08-28 Thread James Matthews
Did you ldconfig? Did you add the library to your LD_CONFIG? On Thu, Aug 28, 2008 at 1:53 PM, Malcolm Tredinnick < [EMAIL PROTECTED]> wrote: > > > On Thu, 2008-08-28 at 13:43 -0700, Huuuze wrote: > > I recently installed PostgreSQL 8.3.3 and psycopg 2 (latest from > > SVN). When I attempt to sta

Re: Newbie Question - Regex Field to deal with Feet/Inches

2008-08-28 Thread Justin Bronn
bkev, GeoDjango has measurement objects: http://geodjango.org/docs/measure.html It does conversions (supports feet, inches, yards, miles, among others) and lists of distance instances are sortable. It's loosely coupled, so regular Django projects may use it without installing any of the GeoDja

Django files documentation not up-to-date?

2008-08-28 Thread skyrim
Hi, http://www.djangoproject.com/documentation/files/, section `The File Object' states that after opening a file and passing it to File from django.core.files, I should be able to use the File attributes like size, url, etc. I'm trying to do something similar: >>> f = open('image.jpg', 'r') >>

Using http header information in settings.py

2008-08-28 Thread Greg Fuller
I would like a way to to adjust settings based on information in the http header. I've seen a similar question asked before, but I don't need all the django request object, just the http header information. More specifically, user_agent, http_host, and path_info. Here are two examples of the so

Re: Exceptions in FileUploadHandlers

2008-08-28 Thread Karen Tracey
On Thu, Aug 28, 2008 at 5:14 PM, mwebs <[EMAIL PROTECTED]> wrote: > > I wrote a custom FileUploadHandler to process uploaded data on the > fly. > My problem is that there are no exceptions raised. > > No matter if I am referencing a variable before I assign it, or if I > do something like raise Ex

Re: Core keyword error

2008-08-28 Thread Rob Goedman
Thanks Malcolm and Rajesh! Expected I had missed something. Should have noted that 1st line Googling 'django core arguments' instead of 'django core keyword' got me there. Thanks again, Rob On Aug 28, 2008, at 12:30 PM, Malcolm Tredinnick wrote: > On Thu, 2008-08-28 at 12:24 -0700, Rob

Re: HowTo: Django view as a class

2008-08-28 Thread bobhaugen
I would be interested to try this in the context of a whole simple app, if you ever publish such a thing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Exceptions in FileUploadHandlers

2008-08-28 Thread mwebs
I wrote a custom FileUploadHandler to process uploaded data on the fly. My problem is that there are no exceptions raised. No matter if I am referencing a variable before I assign it, or if I do something like raise Exception(). The server seems to get stuck. The Exception does not bubble to the

Re: Odd error when executing "runserver"

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 13:43 -0700, Huuuze wrote: > I recently installed PostgreSQL 8.3.3 and psycopg 2 (latest from > SVN). When I attempt to start Django, I receive this error: > > File "/Library/Python/2.5/site-packages/django/db/backends/ > postgresql_psycopg2/base.py", line 20, in > ra

Odd error when executing "runserver"

2008-08-28 Thread Huuuze
I recently installed PostgreSQL 8.3.3 and psycopg 2 (latest from SVN). When I attempt to start Django, I receive this error: File "/Library/Python/2.5/site-packages/django/db/backends/ postgresql_psycopg2/base.py", line 20, in raise ImproperlyConfigured("Error loading psycopg2 module: %s" %

Re: Newbie Question - Regex Field to deal with Feet/Inches

2008-08-28 Thread bkev
Ronny, This is fabulous...thank you so very much. If you don't mind me asking, can you give me an example of how you implemented this method in your Class? In my case, I've defined the field as a DecimalField type, but that brings up an error. Did you define some sort of custom save method around

Re: Is there a way to store Django tables in another schema

2008-08-28 Thread mathieu
Thanks. --~--~-~--~~~---~--~~ 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 group, send email to [EMAIL PROTECTED] For mor

Re: Newbie Question - Regex Field to deal with Feet/Inches

2008-08-28 Thread bkev
Ronny, This is fabulous...thank you so very much. If you don't mind me asking, can you give me an example of how you implemented this method in your Class? In my case, I've defined the field as a DecimalField type, but that brings up an error. Did you define some sort of custom save method around

Re: Newbie Question - Regex Field to deal with Feet/Inches

2008-08-28 Thread bkev
Ronny, This is fabulous...thank you so very much. If you don't mind me asking, can you give me an example of how you implemented this method in your Class? In my case, I've defined the field as a DecimalField type, but that brings up an error. Did you define some sort of custom save method around

Re: Is there a way to store Django tables in another schema

2008-08-28 Thread Rajesh Dhawan
Hi Mathieu, On Aug 28, 3:24 pm, mathieu <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to use Django with an existing Oracle database, but I'd > rather not clutter the existing DB with Django tables, so I was > wondering if I can force them to some other schema that the main > schema I'm using.

Is there a way to store Django tables in another schema

2008-08-28 Thread mathieu
Hi, I'm trying to use Django with an existing Oracle database, but I'd rather not clutter the existing DB with Django tables, so I was wondering if I can force them to some other schema that the main schema I'm using. Thanks -Mathieu --~--~-~--~~~---~--~~ You rec

Re: Core keyword error

2008-08-28 Thread Rajesh Dhawan
Hi Rob, On Aug 28, 3:24 pm, Rob Goedman <[EMAIL PROTECTED]> wrote: > Hi, > > Since moving to beta-2 I get: > > Robs-Intel:mcp rob$ ./manage.py runserver > Validating models... > Unhandled exception in thread started by 0x7a8470> > Traceback (most recent call last): >    File "/Library/Python/2.5

Re: problems with request.user

2008-08-28 Thread Peter of the Norse
In the docs for get_or_create()[1], it states that any argument given with `__` is stripped for the create() call. The reasons for this should be obvious. Thus, your original code was trying to save an empty Rating. As for speed, the new version has less SQL. `user__pk` creates a join and

Re: Core keyword error

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 12:24 -0700, Rob Goedman wrote: [..] > Until beta-1 no problems. Any hints? It was removed as part of r8616. It hasn't actually been needed since newforms-admin landed, but was tied to the manipulator code that was removed in the above changeset. Regards, Malcolm --~--~

Core keyword error

2008-08-28 Thread Rob Goedman
Hi, Since moving to beta-2 I get: Robs-Intel:mcp rob$ ./manage.py runserver Validating models... Unhandled exception in thread started by Traceback (most recent call last): File "/Library/Python/2.5/site-packages/django/core/management/ commands/runserver.py", line 47, in inner_run sel

Re: using File storage

2008-08-28 Thread julianb
On Aug 28, 8:53 pm, julianb <[EMAIL PROTECTED]> wrote: > I tried several things, I think Marty's solution was among them. It > did not throw errors, but the file I got was 0 bytes. I will try again > and check if I made a mistake or so... Okay, I solved the puzzle. The following works: big = Str

Re: Problem with query_set extra select/field casting

2008-08-28 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, both hosts run the same Django version: trunk r8555. regards, Malcolm Tredinnick wrote: | | On Thu, 2008-08-28 at 20:58 +0200, Stephan Jäkel wrote: | [...] |> x.date returns a unicode string even its the same code, the same |> database and same

Re: ANN: django-morsels

2008-08-28 Thread Richard Ward
I just checked out the newest revision and it works! I am certain this will be a very handy asset. To debug the issue you can use the {% debug %} template tag. Thank you, Richard On Sun, Aug 24, 2008 at 6:11 AM, Richard Ward <[EMAIL PROTECTED]> wrote: > I too am unable to display the morsels.

Re: Problem with query_set extra select/field casting

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 20:58 +0200, Stephan Jäkel wrote: [...] > x.date returns a unicode string even its the same code, the same > database and same versions (database, python-mysqldb, python itself). Is it the same version of Django? That could be an important difference. If it is the same, *wh

Problem with query_set extra select/field casting

2008-08-28 Thread Stephan Jäkel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, i've got a problem while moving a django project from one host (debian linux) to another (suse linux) and it seems, that there is a problem with djangos database/models modules. on the current host i can do something like that: |> from board.mod

Re: using File storage

2008-08-28 Thread julianb
On Aug 28, 8:44 pm, "Tim Kersten" <[EMAIL PROTECTED]> wrote: > This should fix the error you got: > > import StringIO > from django.core.files import File > f = StringIO.StringIO() > f.name, f.mode = 'data.xml', 'r' > f.write(data) > myfile = File(f) > Chart.objects.create(xml=default_storage.save

Re: using File storage

2008-08-28 Thread Tim Kersten
Oh, I should have seen that coming. (That's the bad thing when you write code without testing it yourself... something is often missed :-) This should fix the error you got: import StringIO from django.core.files import File f = StringIO.StringIO() f.name, f.mode = 'data.xml', 'r' f.write(data)

Re: Django and CSS

2008-08-28 Thread varikin
MEDIA_ROOT is the local path to the files on the server. One place this is used is with uploading files. So uploaded files will be placed in MEDIA_ROOT/some-upload-dir. I don't know about other uses, though. John --~--~-~--~~~---~--~~ You received this message b

Re: using File storage

2008-08-28 Thread julianb
On Aug 28, 6:03 pm, "Tim Kersten" <[EMAIL PROTECTED]> wrote: > There's probably a better way than this though so you might want to > wait for other replies. > > import StringIO > from django.core.files import File > f = StringIO.StringIO() > f.write(data) > myfile = File(f) > Chart.objects.create(

Suggestion for developers using code-google

2008-08-28 Thread jrivero
Is great to find so much django apps code in google-code, but it would better if the code was labelled with the version of django for which this done. Examples: django-0.96, django-0.97, django-1.0b1, django-1.0... Regards, Jordi --~--~-~--~~~---~--~~ You receive

Re: use crypt algo for user passwords

2008-08-28 Thread Tim Chase
> thanks opend ticket #8647 Attached is a patch against contrib/auth/models.py that should add an "algo" parameter to set_password so it takes an algorithm. -tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: Random NoReverseMatch

2008-08-28 Thread tonemcd
I've just come across this ticket, http://code.djangoproject.com/ticket/8221, which has a patch attached. I've just applied the patch and crippled my url regex again to re-create the error. This is what was reported this time; NoReverseMatch: Reverse for 'MBBS.agenda_today_group' with arguments '

Re: Dictionary key-value pair

2008-08-28 Thread David Zhou
On Aug 28, 2008, at 1:18 PM, saeb wrote: > No, it is not just those fields, there are about 20 key-value items. I > have a Database with about 40 tables. and I am essentially trying to > render a snapshot of about 15 important table which had foreign key > relationship with other tables. Follow

Re: site using Django/mod_python/apache2 randomly showing "It worked!" page

2008-08-28 Thread tonemcd
Does Apache have mod_wsgi? If so, you can get them to make a change to your .conf file as detailed at http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode This means you only need to 'touch' the .wsgi file specified by the WSGIScriptAlias to get your Apache process to restart. Works a treat

Re: site using Django/mod_python/apache2 randomly showing "It worked!" page

2008-08-28 Thread Gremmie
On Aug 27, 8:18 pm, Richard Simões <[EMAIL PROTECTED]> wrote: > I have non-root access to a server with apache2 and mod_python. I > installed django with svn to a location in my home directory and > created a test project. When I go to a URL defined with urls.py and > views.py, 9/10 times the expe

Re: site using Django/mod_python/apache2 randomly showing "It worked!" page

2008-08-28 Thread Karen Tracey
On Thu, Aug 28, 2008 at 1:13 PM, Richard Simões <[EMAIL PROTECTED]> wrote: > > I didn't, no (no root access). At what point should that be necessary, > if ever? > Apache needs to be restarted any time you change your code. It's going to be very hard to develop on a setup with no ability to restar

Re: Random NoReverseMatch

2008-08-28 Thread tonemcd
Well, this bit me a while back when I svn-up'ed from trunk and I got fed up of changing my django.pth to point to trunk_r7971, so I was determined to get it sorted out. The first thing is that the NoReverseMatch error seems to be a catch- all for a variety of exceptions, so if you can, check out

Re: How to handle platform dependent settings?

2008-08-28 Thread Gremmie
On Aug 28, 12:15 am, David Zhou <[EMAIL PROTECTED]> wrote: > > If it's mostly paths that you need to change, check out: > > http://rob.cogit8.org/blog/2008/Jun/20/django-and-relativity/ > It is a lot more than dealing with relative paths. However this link takes the same approach as what I was th

Re: Dictionary key-value pair

2008-08-28 Thread saeb
No, it is not just those fields, there are about 20 key-value items. I have a Database with about 40 tables. and I am essentially trying to render a snapshot of about 15 important table which had foreign key relationship with other tables. Following will give you an idea of what I am trying to d

Re: site using Django/mod_python/apache2 randomly showing "It worked!" page

2008-08-28 Thread Richard Simões
I didn't, no (no root access). At what point should that be necessary, if ever? /Richard Simões On Aug 28, 12:11 am, David Zhou <[EMAIL PROTECTED]> wrote: > On Aug 27, 2008, at 9:18 PM, Richard Simões wrote: > > > I have non-root access to a server with apache2 and mod_python. I > > installed dj

Re: can't pickle OracleQuery

2008-08-28 Thread paulh
Many thanks for reply. It might just be of interest to know that what I was actaully pickling (storing in a session) was not the queryset itself (since it is large) but the Queryset.query attribute which I imagined to be just the sql (maybe wrapped in something). Once I'd encountered the error I d

Re: Change language in Admin modules

2008-08-28 Thread Karen Tracey
On Thu, Aug 28, 2008 at 12:45 PM, Bobo <[EMAIL PROTECTED]> wrote: > > Hi everybody, > > I've a question about the language settings in django and namely in > the Admin section. > > At djangoproject.com there are a danish translation (http:// > code.djangoproject.com/ticket/8308) but I don't know h

Re: intpoint filter

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 10:54 -0400, Keith Eberle wrote: > I use similar functions for some of my template filters, but I use > locale instead. > > import locale > locale.setlocale(locale.LC_ALL, '') Unfortunately that has problems if your application is expected to work in multiple locales. Beca

Re: Generate admin files. Views and Templates with Django?

2008-08-28 Thread James Matthews
When you create a project you run a command (python manage.py startapp test) that creates the directory and the model and view files. However if you want the app to use the admin interface you must explicitly state it in your models.py file or admin.py (which you need to create) If you wish to auto

Re: HowTo: Django view as a class

2008-08-28 Thread zvoase
An alternative is to use some metaclass programming, but to be honest it's more trouble than it's worth. This does actually help with RESTfulness, because it allows you to aggregate your views on a resource-centric basis, as a collection of atomic operations on a resource, and then you would defin

Re: can't pickle OracleQuery

2008-08-28 Thread Malcolm Tredinnick
On Thu, 2008-08-28 at 06:51 -0700, paulh wrote: > django svn version 8659 > I have some django code that runs perfectly against postgres > (psycopg2), but fails with: PicklingError: Can't pickle 'django.db.backends.oracle.query.OracleQuery'>: attribute lookup > django.db.backends.oracle.query.Or

Re: Dictionary key-value pair

2008-08-28 Thread David Zhou
On Aug 28, 2008, at 12:45 PM, saeb wrote: > order is important for display, I am calculating sum and average on > query objects and storing it in dictionary with key/values which are > used in a template. So I have a dictionary something like this : > {'name': user1, 'phone': 723872, 'Total Frie

Change language in Admin modules

2008-08-28 Thread Bobo
Hi everybody, I've a question about the language settings in django and namely in the Admin section. At djangoproject.com there are a danish translation (http:// code.djangoproject.com/ticket/8308) but I don't know how to "install" it so my Admin module is writing the text in Danish instead of E

Re: enforcing uniqueness

2008-08-28 Thread Malcolm Tredinnick
Hi Robin, On Thu, 2008-08-28 at 12:55 +0100, Robin Becker wrote: > My boss, created a model that represents an override to parts of other model > instances; Man, I gotta remember to use the "don't shoot me; my boss did it" reasoning some time. :-) > the business logic demands that the model i

Re: Dictionary key-value pair

2008-08-28 Thread saeb
order is important for display, I am calculating sum and average on query objects and storing it in dictionary with key/values which are used in a template. So I have a dictionary something like this : {'name': user1, 'phone': 723872, 'Total Friends': 20, 'Avg Rating' : 3.6} so when I render I wo

Re: Optimizing Django ORM SQL queries when in a loop

2008-08-28 Thread [EMAIL PROTECTED]
I'm going to give this a try. I'll let you know how I get on! Thanks guys! Mike. On Aug 27, 6:18 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > user_id_list=User.objects.filter(whatever).values_list('id', > flat=True) > posts=Post.objects.filter(user__id__in=user_id_list) > > Would that w

Re: request: auth_user User model, not enough characters in email

2008-08-28 Thread David Zhou
On Aug 28, 2008, at 8:17 AM, Bram de Jong wrote: > it's obviously a very small hack in the django source code, but it > would be nice if the email-field would have a few more characters. > I have a few pesky users who actually use my site and have a vry > long email address. If you have

Re: Dictionary key-value pair

2008-08-28 Thread David Zhou
On Aug 28, 2008, at 12:34 PM, saeb wrote: > I am using a dictionary to render a template. But my rendered > template has the key-value pair which are out of order. Since > dictionary uses a hash table to store it elements, I can't rely on > order of these key-value pairs. Is there any other wa

Re: Storing some media files on web server and some on external a/v server

2008-08-28 Thread David Zhou
On Aug 28, 2008, at 12:31 PM, [EMAIL PROTECTED] wrote: > What would be ideal for me to do is to be able to store the images > that are uploaded via the admin site on the main web server and then > the audio that we upload via the admin site onto the streaming media > server. > > Is this possible

Dictionary key-value pair

2008-08-28 Thread saeb
I am using a dictionary to render a template. But my rendered template has the key-value pair which are out of order. Since dictionary uses a hash table to store it elements, I can't rely on order of these key-value pairs. Is there any other way to render bunch of key-value items from a view

Storing some media files on web server and some on external a/v server

2008-08-28 Thread mccomas . chris
We have a web server here at work that is going to host all of our Django app stuff and the majority of our static media files (images, css, js, etc) and then we have a streaming media server where we store the audio of all of our courses. What would be ideal for me to do is to be able to store t

Re: Forms problem?

2008-08-28 Thread Greg Taylor
Scott, that was the hint I needed. I had a default value of datetime.date.today instead of datetime.datetime.now. Strangely enough, the problem only manifested itself from within the admin interface, the ModelForms worked fine. Thanks, Greg On Aug 28, 11:40 am, "Scott Moonen" <[EMAIL PROTECTED]>

Re: using File storage

2008-08-28 Thread Tim Kersten
> Chart.objects.create(xml=default_storage.save('data.xml', ContentFile(data))) ha, I was almost certain that django wouldn't make it as hard as I had explained it. :-D Glad to see it's this easy! Tim ^,^ --~--~-~--~~~---~--~~ You received this message because yo

Re: to_field in admin

2008-08-28 Thread Karen Tracey
On Thu, Aug 28, 2008 at 4:34 AM, chr <[EMAIL PROTECTED]> wrote: > > hi. i've got a model like this: > > class Inventory(models.Model): >barcode = models.PositiveIntegerField(unique=True) >parent = models.ForeignKey('self', to_field='barcode', blank=True, > null=True) >name = models.Cha

Re: using File storage

2008-08-28 Thread Marty Alchin
On Thu, Aug 28, 2008 at 11:44 AM, Jiri Barton <[EMAIL PROTECTED]> wrote: > I would like Django to take care of the file naming for me. I would > like to use a one-liner such as > > Chart.objects.create(xml=default_storage.save('data.xml', data)) You're nearly there for getting this to work, it's

Re: using File storage

2008-08-28 Thread Tim Kersten
iirc, you can use http://docs.python.org/lib/module-StringIO.html to have a file like object from a string, and use that to make your django File object ( http://www.djangoproject.com/documentation/files/#the-file-object ). There's probably a better way than this though so you might want to wait

Re: use crypt algo for user passwords

2008-08-28 Thread SammyRulez
thanks opend ticket #8647 On 28 Ago, 16:55, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > Hi Sam, > >  I'm tring to figure out how to use crypt algorithm for user password. > > > looking at the code (http://code.djangoproject.com/browser/django/ > > trunk/django/contrib/auth/models.py) lin 175 there

Setting Modelform exclude field after post

2008-08-28 Thread Gerard Petersen
Hi All, I exclude a field in modelform because the info is known. It's a Customer > 1-to-n > Project model setup. I get the following (1048, "Column 'customer_id' cannot be null") on a form.save() which is correct. But how do I put that customer_id back in the request.POST querydict? I'm mes

using File storage

2008-08-28 Thread Jiri Barton
What is the preferred way of storing generated content into file models? class Chart(models.Model): xml = models.FileField(upload_to='charts') ... I would like compute the image on the fly, using some data in the database. How should I store the generated data? How should I use File stor

Re: Forms problem?

2008-08-28 Thread Scott Moonen
Greg, it looks to me like you are storing a date value into a datetime field. Consider the error: File "/home/clemsoncrew/site-packages/django/forms/widgets.py", line 662, > in decompress > return [value.date(), value.time().replace(microsecond=0)] > > AttributeError: 'datetime.date' object ha

Re: Forms problem?

2008-08-28 Thread Greg Taylor
Thanks for the tip. I replaced all of my from datetime import datetime istances, but it looks like this is still happening. The problem only manifested itself when I updated to the latest trunk. I was previously running a few revisions earlier than the signals refactoring. If you have any other id

Re: ModelForm - Required Fields

2008-08-28 Thread lingrlongr
Anyone else ever do anything like this? On Aug 26, 10:13 pm, lingrlongr <[EMAIL PROTECTED]> wrote: > Is there a way for me to quickly make certain fields in a ModelForm > class required.  I know this looks back to the model for that > information... > > In my case I'm using a FormWizard to displa

Generate admin files. Views and Templates with Django?

2008-08-28 Thread Daniel A.
I'm a Rails switcher to Django. In Rails there's an option to generate all the scaffold files, ie, there's a command line script that creates all the files in the project folder of the admin interface. I want to know if there's something similar for Django. Thanks --~--~-~--~~-

Re: use crypt algo for user passwords

2008-08-28 Thread Rajesh Dhawan
Hi Sam, I'm tring to figure out how to use crypt algorithm for user password. > looking at the code (http://code.djangoproject.com/browser/django/ > trunk/django/contrib/auth/models.py) lin 175 there is no way to use > other than sha1. You're right that algo='sha1' is hard coded in User.set_pas

Re: problem passing var to template tag

2008-08-28 Thread flynnguy
Ah, yes, thank you... must have missed that somehow. Guess I didn't read all the way down. Much appreciated. -Chris On Aug 28, 10:42 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 28 août, 13:59, flynnguy <[EMAIL PROTECTED]> wrote: > > > I'm trying to get a list of photos so I can then g

  1   2   >