Clash between file upload handler and middleware accessing request's dictionaries

2008-09-18 Thread Julien Phalip
Hi, Upload handlers cannot be set after the request's POST or FILES dictionaries have been accessed. The problem I'm having is that one of the middleware I use (packaged with the django-pagination app) actually accesses request.REQUEST when the request comes in. Therefore it is impossible to set

Re: seeking design advice

2008-09-18 Thread krylatij
So you can add context variable in your tag and check it in template {%if my_tag_js_not_added %} alert(); {% endif %} ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Donn
On Wednesday, 17 September 2008 23:35:46 [EMAIL PROTECTED] wrote: > Better to set the upload filesize limit on your server eg Apache's has > a directive for max file size. Otherwise the file will be uploaded and > checked anyway. I will look into this, but not sure how Apache will respond on the

Basic template inheritance question

2008-09-18 Thread Daniele Procida
I have a base.html template. In it I've inserted: {% block stylesheets %}{% endblock %} and in stylesheets.html in the same directory: {% extends "base.html" %} {% block stylesheets %} <--- my styles ---> {% endblock %} But the {% block stylesheets %} in st

[ANNOUNCE] Polish Django tutorials

2008-09-18 Thread Jarek Zgoda
I'm pleased to announce availability of my first few Django tutorials in Polish. The documents and accompanying code are available at http://code.google.com/p/django-tutors/ . Currently file upload related documents (and code) are ready, work on upload handlers is ongoing and storage backen

Re: seeking design advice

2008-09-18 Thread Daniel Roseman
On Sep 17, 10:42 pm, akonsu <[EMAIL PROTECTED]> wrote: > hello, > > i am looking for an advice from people who know django internals well. > > to simplify, i have a template that currently uses a custom tag. the > tag emits the needed markup. suppose the template includes several > instances of th

Can I display reverse relationships in the admin change_list

2008-09-18 Thread ksfguy
Hello!, There are two models -- class Parent(models.Model): name = ... class Child(models.Model): parent = models.ForeignKey(Parent) age = ... ---

Re: Basic template inheritance question

2008-09-18 Thread Daniel Roseman
On Sep 18, 8:50 am, "Daniele Procida" <[EMAIL PROTECTED]> wrote: > I have a base.html template. > > In it I've inserted: > >     {% block stylesheets %}{% endblock %} > > and in stylesheets.html in the same directory: > >     {% extends "base.html" %} >         {% block stylesheets %} >          

Re: Basic template inheritance question

2008-09-18 Thread Daniele Procida
On Thu, Sep 18, 2008, Daniel Roseman <[EMAIL PROTECTED]> wrote: >On Sep 18, 8:50 am, "Daniele Procida" <[EMAIL PROTECTED]> >wrote: >> I have a base.html template. >> >> In it I've inserted: >> >>     {% block stylesheets %}{% endblock %} >> >> and in stylesheets.html in the same directory: >> >>

Re: Can I display reverse relationships in the admin change_list

2008-09-18 Thread Daniel Roseman
On Sep 18, 9:17 am, ksfguy <[EMAIL PROTECTED]> wrote: > Hello!, > > There are two models > > -- > > class Parent(models.Model): >    name = ... > > class Child(models.Model): >     parent = models.ForeignKey(Parent

Re: Basic template inheritance question

2008-09-18 Thread Kenneth Gonsalves
On Thursday 18 Sep 2008 1:20:55 pm Daniele Procida wrote: >     {% extends "base.html" %} >         {% block stylesheets %} >             <--- my styles ---> >         {% endblock %} > > But the {% block stylesheets %} in stylesheets.html isn't filling in the > block in base.html - obviously I'm m

Re: Basic template inheritance question

2008-09-18 Thread Daniel Roseman
On Sep 18, 9:48 am, "Daniele Procida" <[EMAIL PROTECTED]> wrote: > On Thu, Sep 18, 2008, Daniel Roseman <[EMAIL PROTECTED]> wrote: > >On Sep 18, 8:50 am, "Daniele Procida" <[EMAIL PROTECTED]> > >wrote: > >> I have a base.html template. > > >> In it I've inserted: > > >>     {% block stylesheets %}

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Fedya
hm... I've tried with very simple model from the scratch and I got the same problem without init_command... On Sep 18, 2:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-09-18 at 01:57 +0300, Fedor Tyurin wrote: > > Another possible solution (and probably better one) is to use

How to trigger html traceback and verbose django environmental variable list

2008-09-18 Thread NoviceSortOf
Does anybody know how to return the full debug list of settings and django related variables from something like www.mysite.com/mysite/admin or www.mysite.com/mysite/ I did receive this comprehensive list traceback a couple of times that listed a comprehensive list of stuff like... Request info

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Graham Dumpleton
On Sep 18, 7:35 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Better to set the upload filesize limit on your server eg Apache's has > a directive for max file size. Otherwise the file will be uploaded and > checked anyway. If using mod_python, the Apache LimitRequestBody directive doesn

Re: How to trigger html traceback and verbose django environmental variable list

2008-09-18 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-18, o godz. 12:01, przez NoviceSortOf: > Does anybody know how to return the full debug list of settings and > django > related variables from something like www.mysite.com/mysite/admin > or www.mysite.com/mysite/ I don't know how to do this "persistently", but

Re: Basic template inheritance question

2008-09-18 Thread Daniele Procida
On Thu, Sep 18, 2008, Daniel Roseman <[EMAIL PROTECTED]> wrote: >> >> I have a base.html template. >> >> >> In it I've inserted: >> >> >>     {% block stylesheets %}{% endblock %} >> >> >> and in stylesheets.html in the same directory: >> >> >>     {% extends "base.html" %} >> >>         {% block

Truncated incorrect DOUBLE value: 'AnonymousUser'

2008-09-18 Thread pihentagy
Hi all! I have a UserProfile model, wihch references to the auth_user model. However, when I run the query below (filled in the user parameter with the actual request.user value), I got a trace. (not on my Windows dev machine, but my linux server) Does it depends on mysql versions, or what? Thank

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Donn
On Thursday, 18 September 2008 12:13:12 Graham Dumpleton wrote: > If using mod_python, the Apache LimitRequestBody directive doesn't > work entirely properly. I have heard of a "Content-length" variable (from PHP, but it's an http thing) -- how could I use that? request["Content-length"] or somet

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-18, o godz. 13:01, przez Donn: >> If using mod_python, the Apache LimitRequestBody directive doesn't >> work entirely properly. > I have heard of a "Content-length" variable (from PHP, but it's an > http > thing) -- how could I use that? request["Content-length

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Graham Dumpleton
On Sep 18, 8:56 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-09-18, o godz. 13:01, przez Donn: > > >> If using mod_python, the Apache LimitRequestBody directive doesn't > >> work entirely properly. > > I have heard of a "Content-length" variable (from PHP, but it's

Re: Basic template inheritance question

2008-09-18 Thread Daniel Roseman
On Sep 18, 11:23 am, "Daniele Procida" <[EMAIL PROTECTED]> wrote: > Maybe if I explain what I'm doing it will help. > > Django CMS uses a base template, base.html. base.html is: > > > > What I would like is to devolve bits

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-18, o godz. 13:17, przez Graham Dumpleton: If using mod_python, the Apache LimitRequestBody directive doesn't work entirely properly. >>> I have heard of a "Content-length" variable (from PHP, but it's an >>> http >>> thing) -- how could I use that? r

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Graham Dumpleton
On Sep 18, 9:28 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-09-18, o godz. 13:17, przez Graham   > Dumpleton: > > > > If using mod_python, the Apache LimitRequestBody directive doesn't > work entirely properly. > >>> I have heard of a "Content-length" vari

'unicode' object has no attribute 'user'

2008-09-18 Thread laspal
Hi, I am trying to send mail using sendmail. Getting the error 'unicode' object has no attribute 'user' My view function: def send_mail(request): _user = request.user sender = _user.email mailing_list = [] if request.method != 'POST': emailform = EmailForm() retu

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Donn
On Thursday, 18 September 2008 13:17:06 Graham Dumpleton wrote: > If Content-Length was an unreliable indicator of request content then > web applications wouldn't work properly. Okay, in context of the OP's code -- how could I employ content length and get an error message back to the admin cha

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-18, o godz. 13:33, przez Graham Dumpleton: >> Now, where on earth have you got this idea that you can not >> rely on >>> Content-Length on a request? >> >> I saw actual request bodies larger than declared in content-lentgh >> with Firefox 2, this brow

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Graham Dumpleton
On Sep 18, 9:41 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-09-18, o godz. 13:33, przez Graham   > Dumpleton: > > > > >> Now, where on earth have you got this idea that you can not   > >> rely on > >>> Content-Length on a request? > > >> I saw actual reque

Re: FileSystemStorage preventing large file uploads

2008-09-18 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-18, o godz. 13:47, przez Graham Dumpleton: I saw actual request bodies larger than declared in content-lentgh with Firefox 2, this browser often was lying to my nginx in cases of small bodies by 1-4 bytes. >> >>> What sort of application w

Re: Error: No module named X (django standalone script)

2008-09-18 Thread Mathieu Leplatre
On Sep 17, 10:41 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > On Sep 17, 2008, at 11:45 PM, Mathieu Leplatre wrote: > > > > > > > Hi all, > > > I am starting a new thread, the first one became off-topic (http:// > > groups.google.com/group/django-users/browse_thread/thread/ > > 34b501d2d1f8849

Re: Basic template inheritance question

2008-09-18 Thread Daniele Procida
On Thu, Sep 18, 2008, Daniel Roseman <[EMAIL PROTECTED]> wrote: > >On Sep 18, 11:23 am, "Daniele Procida" <[EMAIL PROTECTED]> >wrote: >> Maybe if I explain what I'm doing it will help. >> >> Django CMS uses a base template, base.html. base.html is: >> >>

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Fedya
Still something wrong with character set. When I use Russian characters inside value of a field in one table, Django admin interface can't show list of object corresponding to that table. Like I'm trying to access http://test.legalsw.ru/admin/menu/item/ and getting: TemplateSyntaxError at /admin/

invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread silk.odyssey
I am using an imagefield from the admin interface. I can upload images without problems but when I click the link to view the image, I get the following error. invalid literal for int() with base 10: '1/photos/desktop.png' Any idea what's wrong? I am using django 1.0. --~--~-~--~~--

Re: keeping counts of verbs (downloads, comments, ...)

2008-09-18 Thread Evan
for very high traffic (100+ requests/sec) I would suggest using memcache to store the changes for #downloads / views. On each action (view or play or download or whatever) increment the variable in memcache (it has a fast function to do this) Then once every 1/5/15/60 seconds or so pull the coun

Basic Apps Installation

2008-09-18 Thread osaatcioglu
Hi Everybody, I had a ridiculous error while I was trying to syncdb after adding the basic apps to my web app. The error is this: Error: No module named markupmysite However, I couldn't find any clue about this problem in the net. On the other hand, I commented out the phrase that includes marku

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Picio
I have the same issue, tried: Django 1.0 with sqlite3 (Wiindows) Django 1.0 with Mysql 5.0 (Windows) Django 1.0 with sqlite3 (Mac OS X) Daniele 2008/9/18 silk.odyssey <[EMAIL PROTECTED]>: > > I am using an imagefield from the admin interface. I can upload images > without problems but when I cli

Re: Problems getting manage.py syncdb to work

2008-09-18 Thread Sérgio Durand
hi, try to connect with postgres using psql utility: psql -h localhost -U -W if you don't have success login, the problem could be on postgres config. []'s Sergio Durand airjaw escreveu: > Hi, I'm having a bit of trouble getting past the "manage.py syncdb" > command. I am trying to setup :

Adding standard admin permissions to a model

2008-09-18 Thread nickloman
My custom models which have the admin interface enabled do not have the standard add/update/delete permissions added in the database. This may be because I enabledthe admin after creating the model. Is there a way of adding these after the fact? Regards, Nick --~--~-~--~~--

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Ross
The error looks like you are passing '1/photos/desktop.png' to int(), which converts a string to an integer. How are you creating the link to the picture? Your urls.py could be capturing that entire string and passing it as a parameter that you are trying to cast to an integer. A bigger stack tr

Re: 'unicode' object has no attribute 'user'

2008-09-18 Thread Jens Diemer
Seems that the session middleware not active. It should append the user object to the request object. laspal schrieb: > I am trying to send mail using sendmail. Getting the error 'unicode' > object has no attribute 'user' ... > request.user.message_set.create(message="Mail was se

resolving urls template error

2008-09-18 Thread Sven Richter
Hi, i get the following error message: TemplateSyntaxError at /community/profile/sveris/ Caught an exception while rendering: Reverse for 'youriq.profile_myiq' with arguments '('',)' and keyword arguments '{}' not found. Original Traceback (most recent call last): File "/usr/lib/python2.5/si

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread kelvin pompey
Everything is being handled by the admin application. Environment: Request Method: GET Request URL: http://localhost:8000/admin/grades/student/1/photos/desktop.png/ Django Version: 1.0-final-SVN-unknown Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.content

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Picio
It happens inside the admin interface, so I've little control on It (AFAIK). This what i have in my urls.py: from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/doc/', include('django.contrib.admindocs.urls')),

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Picio
Here is mine, since I don't know how to reference dpaste... ;) Environment: Request Method: GET Request URL: http://localhost:8000/admin/tvsite/areas/1/areas/batzos.jpeg/ Django Version: 1.0-final-SVN-unknown Python Version: 2.5.2 Installed Applications: ['django.contrib.admin', 'django.contrib.

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Fedya
Unfortunately I'm dummy in python... so it's twice harder to find the reason... But I'm still trying :) I wrote very simple view: def main_menu(request): html = '' menu = Item.root('main').children() for s in menu[0].title: html = '%s %s' % (html, ord(s)) html = '%s%s' %

Adding comments in loop

2008-09-18 Thread mccomas . chris
I'm trying to add comments to a page that has the recent blog entires, below is my code: http://dpaste.com/78918/ I get the error: TemplateSyntaxError at / 'get_comment_list' tag requires 5 or 6 arguments What did I do wrong? I've played with it for about two hours and can't figure it out...

Re: Problems getting manage.py syncdb to work

2008-09-18 Thread airjaw
Hello, thanks for your help. I can login using psql, and see all the databases and users. Altho, I couldn't log in as ocdnet_admin . It said I didn't have ocdnet_admin database. I created ocdnet_admin database and now i can log in as that user. manage.py syncd db still does not work tho. I gue

Re: Adding comments in loop

2008-09-18 Thread mccomas . chris
actually, that isn't the issue, the issue is with the {% render_comment_form for event %} tag, i'm getting a template syntax error: Invalid block tag: 'render_comment_form' this is right after the comment_list endfor here: http://dpaste.com/78918/ On Sep 18, 10:43 am, [EMAIL PROTECTED] wrote

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Grigory Fateyev
Hello Fedya! On Thu, 18 Sep 2008 07:24:16 -0700 (PDT) you wrote: > > Unfortunately I'm dummy in python... so it's twice harder to find the > reason... But I'm still trying :) Maybe this helps? # grep -i utf8 /usr/lib/python2.4/site.py encoding = "utf8" # Default value set by _PyUnicode_In

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Karen Tracey
Since you say you are using UTF8_BIN collation on MySQL, be sure to read: http://docs.djangoproject.com/en/dev/ref/databases/#collation-settings When you specify a binary collation in MySQL, your application code has to take on the responsibility of transforming bytestrings returned by the databa

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Lisa Dusseault
I've seen the same problem with FileFields, so it's not just ImageFields. I haven't figured it out yet. I can make a link to the file work from the main UI, but I don't know how the admin constructs its link in an unmodified admin form. Lisa On Thu, Sep 18, 2008 at 5:17 AM, silk.odyssey <[EMAIL

unable to import Storage from django.core.files.storage into settings.py

2008-09-18 Thread Faheem Mitha
Hi, Putting the following into my settings.py (checked for two different projects for Dango 1.0) from django.core.files.storage import Storage gives [EMAIL PROTECTED]:/var/django/hg$ python manage.py validate Error: Can't find the file 'settings.py' in the directory containing 'manage.py'.

where is my pythonpath

2008-09-18 Thread KillaBee
I need to edit my pythonpath, but where it? --~--~-~--~~~---~--~~ 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

Python/Django Developer

2008-09-18 Thread [EMAIL PROTECTED]
I'm working with a company helping them develop their Django based software. We're looking for a couple of good django/python developers. Developers can telecommute, and the team is great. If you are interested, email [EMAIL PROTECTED] -- CatalyzeMe is an early-stage software

Re: unable to import Storage from django.core.files.storage into settings.py

2008-09-18 Thread Marty Alchin
On Thu, Sep 18, 2008 at 11:55 AM, Faheem Mitha <[EMAIL PROTECTED]> wrote: > Putting the following into my settings.py (checked for two different > projects for Dango 1.0) > > from django.core.files.storage import Storage > > gives > > [EMAIL PROTECTED]:/var/django/hg$ python manage.py validate > E

Re: where is my pythonpath

2008-09-18 Thread Tim Chase
> I need to edit my pythonpath, but where it? Which OS? And for what duration (just one shell session, or for all shell-sessions)? On *nix systems (Linux, BSD, Mac, etc), to set it across shell sessions, you usually set it in your .bashrc (or if you're using an alternate shell, in its rc fil

Re: where is my pythonpath

2008-09-18 Thread Sérgio Durand
would be this you are looking for ? python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" []'s Sergio Durand KillaBee escreveu: > I need to edit my pythonpath, but where it? > > > > --~--~-~--~~~---~--~~ You received this mess

Re: where is my pythonpath

2008-09-18 Thread KillaBee
That give me the folder, I know that I was in the right folder. I am looking for a file called PythonPath and there is none. What is this file that I am editing. Do I just put A symlink in the folder. On Sep 18, 11:20 am, Sérgio Durand <[EMAIL PROTECTED]> wrote: > would be this you are looking

Re: Python/Django Developer

2008-09-18 Thread James Matthews
I am very happy to hear that your company wants to use this great framework. If i can suggest also posting this job request on djangogigs.com Thanks James On Thu, Sep 18, 2008 at 9:04 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > I'm working with a company helping them develop their Dja

Re: where is my pythonpath

2008-09-18 Thread KillaBee
I don't have A sys.path in that folder for Ubuntu. On Sep 18, 11:20 am, Sérgio Durand <[EMAIL PROTECTED]> wrote: > would be this you are looking for ? > > python -c "from distutils.sysconfig import get_python_lib; print > get_python_lib()" > > []'s > Sergio Durand > > KillaBee escreveu: > > > I

Re: where is my pythonpath

2008-09-18 Thread Jirka Vejrazka
KillaBee, PYTHONPATH is an environment variable, not a file. Try typing "env" at yout Ubuntu command line. How to modify the environment variable was already descibed in this thread so I won't go into that again. Cheers Jirka On 9/18/08, KillaBee <[EMAIL PROTECTED]> wrote: > > Th

using variable as dictionary key in templates

2008-09-18 Thread Xiong Chiamiov
Is it possible? If in the templates I call section.foo (with section being a dictionary), then it's the equivalent of section['foo']. Is there a way to call section[foo]? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

Saving multiple variables using ModelForms

2008-09-18 Thread garces.85
Hello everyone, I am new in django and python programming. I have a problem, i want to save for each activity an amount of money that goes with an item. Example: i want to store the activity1 - $100 - item1, activity2 - $200 - item2, activity2 - $100 - item1. How can i use this please? Until now

Re: Adding comments in loop

2008-09-18 Thread Dmitry Dzhus
[EMAIL PROTECTED] wrote: > actually, that isn't the issue, the issue is with the {% > render_comment_form for event %} tag, i'm getting a template syntax > error: > > Invalid block tag: 'render_comment_form' > > this is right after the comment_list endfor here: > > http://dpaste.com/78918/ I can'

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread kelvin pompey
Is there a way to modify the html for the admin form to display the image using the html img tag instead of having a link to the image? On Thu, Sep 18, 2008 at 11:50 AM, Lisa Dusseault <[EMAIL PROTECTED]>wrote: > I've seen the same problem with FileFields, so it's not just ImageFields. > I haven'

Re: specifying MEDIA_URL in CSS files

2008-09-18 Thread MrJogo
Erik: I can't use relative URLs because of how my hosting service (my university) is set up. Each account is at something like www.university.edu/~studentname/. I could hard code it if I were leaving it on my space, but I'm making it for a group (which has space at www.university.edu/group/groupna

Re: DjangoCon keynote transcript/summary

2008-09-18 Thread Gerard Petersen
Malcom, First, thanx for your enlighting feedback. I'm working with Django for 1,5 months now and the direction I read between the lines looks promising. Then, my reponse on Delta20's email was shot from the hip. My response therefore was not intended to offend anyone. Working with python for

Re: where is my pythonpath

2008-09-18 Thread KillaBee
On Sep 18, 11:20 am, Sérgio Durand <[EMAIL PROTECTED]> wrote: > would be this you are looking for ? > > python -c "from distutils.sysconfig import get_python_lib; print > get_python_lib()" > > []'s > Sergio Durand > > KillaBee escreveu: > > > I need to edit my pythonpath, but where it? > > This

Re: Import error: Model based on another model

2008-09-18 Thread Gerard Petersen
Daniel, Thanx for the answer on code execution. As far as the import issue is concerned. I'll have a look at importing specifics. I wouldn't want you to have to dig through my code to find a syntactic typo ... :-) Regards, Gerard. Daniel Roseman wrote: > On Sep 16, 10:08 pm, Gerard Petersen

modelformset_factory or formset_factory for registration form that writes to two models?

2008-09-18 Thread MrJogo
Hi, I want to make a registration form that writes to two models: User and a custom Preferences. It seems that model formsets would be the best way to do that, but all the documentation I can find seems to say that modelformset_factory gets associated with a queryset. If I want to create a new mo

Re: resolving urls template error

2008-09-18 Thread Norman Harman
Sven Richter wrote: > when i try to call: > {% url profile_myiq argument %} > NoReverseMatch: Reverse for 'youriq.profile_myiq' with arguments '('',)' and > keyword arguments '{}' not found. > (r'^(?P\w+)/$', 'user', {} 'profile_myiq'), The error indicates you were providing either empty str

Re: Adding comments in loop

2008-09-18 Thread mccomas . chris
I apologize, yes {% load comments %} is in there, he's an updated version: http://dpaste.com/78978/ again, the issue is the Invalid block tag: 'render_comment_form' On Sep 18, 1:21 pm, Dmitry Dzhus <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > actually, that isn't the issue, the iss

Re: using variable as dictionary key in templates

2008-09-18 Thread akonsu
hello, to my knowlege, you would need a custom tag or filter for that. konstantin On Sep 18, 1:06 pm, Xiong Chiamiov <[EMAIL PROTECTED]> wrote: > Is it possible? > > If in the templates I call section.foo (with section being a > dictionary), then it's the equivalent of section['foo'].  Is there a

Re: Basic template inheritance question

2008-09-18 Thread akonsu
wow, my thread has been hijacked :) thanks to those who replied to my original question. konstantin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-

Re: unable to import Storage from django.core.files.storage into settings.py

2008-09-18 Thread Faheem Mitha
On Thu, 18 Sep 2008 12:16:52 -0400, Marty Alchin <[EMAIL PROTECTED]> wrote: > > On Thu, Sep 18, 2008 at 11:55 AM, Faheem Mitha <[EMAIL PROTECTED]> wrote: >> Putting the following into my settings.py (checked for two different >> projects for Dango 1.0) >> >> from django.core.files.storage import S

Re: resolving urls template error

2008-09-18 Thread Sven Richter
Sven Richter wrote: > Hi, > > i get the following error message: > TemplateSyntaxError at /community/profile/sveris/ > Caught an exception while rendering: Reverse for 'youriq.profile_myiq' with > arguments '('',)' and keyword arguments '{}' not found. > > Original Traceback (most recent call la

Re: change file upload destination "on the fly" for tests

2008-09-18 Thread Faheem Mitha
On Wed, 17 Sep 2008 14:42:40 -0400 (EDT), Faheem Mitha <[EMAIL PROTECTED]> wrote: > > Hi, > > I wrote some unit tests for file upload. since I didn't want the files in > the unit tests to be uploaded to the "official locaion", I changed the > upload location by reassiging MEDIA_ROOT to something

Re: where is my pythonpath

2008-09-18 Thread KillaBee
I am working with django .90, but I have a Mysql db in setting.py and I am trying to link Django with this DB. I run this command to do this. export DJANGO_SETTINGS_MODULE=app.settingsNo errors then django-admin.py init --settings=app.settings I get this error. EnvironmentError: Could not i

Re: where is my pythonpath

2008-09-18 Thread KillaBee
I am working with django .90, but I have a Mysql db in setting.py and I am trying to link Django with this DB. I run this command to do this. export DJANGO_SETTINGS_MODULE=app.settingsNo errors then django-admin.py init --settings=app.settings I get this error. EnvironmentError: Could not i

Re: Can not under stand the error obtained when validating a model.py

2008-09-18 Thread Karthik Krishnan
Hi Steve, That was the problem. My django package was corrupted. Reinstalling django package worked. Thanks, Karthik On Sep 17, 4:56 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Karthik Krishnan wrote: > > Hi Norman, > > > But if I have an empty file, models.py, that should thrown an error. >

Re: Two Django visions running at once.

2008-09-18 Thread Faheem Mitha
On Wed, 17 Sep 2008 13:21:50 -0700 (PDT), KillaBee <[EMAIL PROTECTED]> wrote: > Is it possible to have two versions of django running at the same time > on an Ubuntu server(9.0 and 1.0)? > It is taking to long to recode, and until I do I wanted It up and > running with the old version. > I got th

ImageField: upload_to

2008-09-18 Thread lingrlongr
According to the documentation, I can make the upload_to argument a callable (which must receive 2 args): class Product(models.Model): number = models.CharField(max_length=20) image = models.ImageField(upload_to='') I want to build a path so it looks like this (with respect to MEDIA_URL)

Basic Form Processing Question: How to prevent form validation on a GET request.

2008-09-18 Thread Karthik Krishnan
Hi, I have a form which contains some prefilled data and some to be filled in by the user. I have no trouble getting the forms to be prefilled. What I want is thatfor a GET request, if the form data pre exists, then display it; if not, then show a blank text field . For a post request, if the fie

Re: Two Django visions running at once.

2008-09-18 Thread KillaBee
For right now I don't care if the new version is running I just want the old one installed. I am running VMware on this laptop to test some things out, but haven't been able to put it on Ubuntu. On Sep 18, 3:14 pm, Faheem Mitha <[EMAIL PROTECTED]> wrote: > On Wed, 17 Sep 2008 13:21:50 -0700 (PDT)

Re: Basic Form Processing Question: How to prevent form validation on a GET request.

2008-09-18 Thread Daniel Roseman
On Sep 18, 9:34 pm, Karthik Krishnan <[EMAIL PROTECTED]> wrote: > Hi, > > I have a form which contains some prefilled data and some to be filled > in by the user. I have no trouble getting the forms to be prefilled. > What I want is thatfor a GET request, if the form data pre exists, > then displa

development environment versus production environment

2008-09-18 Thread Eric Schmitt
Does using the database in the quick install have any affect on how you code, if you plan to deploy in an Apache mod_python configuration? What I mean is, if i wanted to develop on my laptop using the quick install setup and then deploy using an Apache mod_python configuration for speed on my hos

HttpResponseRedirect or render_to_response

2008-09-18 Thread WillF
Hey I'm just picking django , and I have a question. What is the difference between httpresponseredirect and render_to_response? When should I use which? Thanks! -- View this message in context: http://www.nabble.com/HttpResponseRedirect-or-render_to_response-tp19561038p19561038.html Sent fr

Re: development environment versus production environment

2008-09-18 Thread R. Gorman
As you guessed, the abstraction layer can take care of *most* code. Because it is possible to write custom SQL commands it would be possible to have code not compatible with all database types. Beyond that exception though, you should be fine. R. --~--~-~--~~~---~--~-

Possible to use url tag to direct to a page without a view?

2008-09-18 Thread WillF
Hi I currently have a page without a view. The corresponding url in the url.py uses the generic view direct_to_template, is there any way I could create a link to this url using the url template tag? Thanks -- View this message in context: http://www.nabble.com/Possible-to-use-url-tag-to-direc

Admin UI: How to auto select selectbox items via URL?

2008-09-18 Thread Dana
Hi, Wondering why the Django admin Multiple Select box widget (in Django 0.96, not sure if 1.0 is different), only allows you to pass in single digit values via the URL. Basically, if I have a multiple select box on a popup form and Id like to pass in a value to the url like so: example.com/

Re: ImageField: upload_to

2008-09-18 Thread gnijholt
I had to define the callable function before it gets called. So in your case I'd put it right under class Product(models.model) Then you should be able to just do: upload_to=get_image_path Cheers, On Sep 18, 10:20 pm, lingrlongr <[EMAIL PROTECTED]> wrote: > According to the documentation, I ca

Re: HttpResponseRedirect or render_to_response

2008-09-18 Thread Rajesh Dhawan
On Sep 18, 4:26 pm, WillF <[EMAIL PROTECTED]> wrote: > Hey I'm just picking django , and I have a question. > > What is the difference between httpresponseredirect and render_to_response? > When should I use which? Use a redirect if the view changes your data (typically, after a POST, DELETE, o

Re: Possible to use url tag to direct to a page without a view?

2008-09-18 Thread Rajesh Dhawan
WillF wrote: > Hi I currently have a page without a view. The corresponding url in the > url.py uses the generic view direct_to_template, is there any way I could > create a link to this url using the url template tag? In your urls.py, name that particular URL definition and then it's simple to

one symbol "i" causes the template system to raise an exception

2008-09-18 Thread Valery Khamenya
Hi all I got a strange issue with Django: 0.96.1 During render_to_response() call against this 1-line template: I get a long error output (see below). Now the funniest. If I delete or change the symbol "i" then I get no error anymore. Namely, if instead of I put or then things are OK

external app authentication?

2008-09-18 Thread Carol
HI, I'm writing a Django app that allows access to pages either through a web interface - Django forms - or through a python script. I am using Django 1.0, Python 2.4, Apache 2.2, mod_python and posgres 8.1.1. OS is Linux SuSE 10.1. Everything works through the web interface. The user needs to

Install version .90 help

2008-09-18 Thread KillaBee
I am working with django .90, and and 1.0. I have a Mysql db in setting.py that I can login with Mysql Admin. I am trying to link Django with this DB. I run this command to do this. django-admin.py init I get this error. The database couldn't be initialized. an integer is required I edited th

Is possible this hack for the admin? Get user & current item in the save

2008-09-18 Thread mamcxyz
Hi, I have a very small webapp for internal use. Is something like a mini- POS. I have a classic invoice form, and I need get the default price for each product line based on the actual user, the customer & the inventory price. I have: User = Salesman. Each salesman have level from 1 - 3 Cus

Re: ImageField: upload_to

2008-09-18 Thread lingrlongr
worked like a charm. thx. On Sep 18, 5:21 pm, gnijholt <[EMAIL PROTECTED]> wrote: > I had to define the callable function before it gets called. > So in your case I'd put it right under class Product(models.model) > Then you should be able to just do: >   upload_to=get_image_path > > Cheers, > >

Re: Install version .90 help

2008-09-18 Thread Carol
As far as I can see, django-admin.py doesn't have a subcommand called init. Where you meaning syncdb or startapp or start project or ? Have you done manage.py validate to check your syntax and then manage.py syncdb to upload your new schema to the database? Also check your settings.py file that yo

Re: external app authentication?

2008-09-18 Thread akonsu
hello, i would start with tracing the request that is sent from your python script and making sure it is similar to the one sent from the login form by the browser. konstantin On Sep 18, 5:50 pm, Carol <[EMAIL PROTECTED]> wrote: > HI, > > I'm writing a Django app that allows access to pages eit

  1   2   >