Re: Simple python question

2007-04-11 Thread Grupo Django
Thank you! What I'm doing is to load a model from a template. I have in a template something like this: {% block menu %} {% block rss %} I want to load "menu" and "rss", but I think that is too much work for now, I have no idea how to implement it and I probably won't do it. Thank you very much f

Template context lost in parent template

2007-04-11 Thread Wolfram Kriesing
I have the standard setup, base.html and mytpl.html. I have written a tag, that stores data into the context (inside the render() method), now I try to read out this data in the base.html, but they are not there. Is the scope a different one? Or is the execution order not mytpl.html and then base.

Re: Integrating third parties script within django

2007-04-11 Thread [EMAIL PROTECTED]
On 11 avr, 07:33, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > If you are integrating a 3rd party library or script into a django (or > ANY python) project, it needs to be available on the python > interpreter's path. It sounds like you are getting hung up on the > mechanics of python's pac

Re: sort values in a drop down SOLVED

2007-04-11 Thread Benedict Verheyen
Benedict Verheyen schreef: > class ScoreAddManipulator(Score.AddManipulator): > default = {} > > def __init__(self): > # Construct the fields and set the values in default > Score.AddManipulator.__init__(self) > ScoreAddManipulator.default["patient"]=[(patient.id

SelectDateWidget unicode problem

2007-04-11 Thread Robert
When trying to use a SelectDateWidget from forms.extras.widgets.py I'm getting the following error: Traceback (most recent call last): File "c:\Python24\Lib\site-packages\django\template\__init__.py" in render_node 723. result = node.render(context) File "c:\Python24\Lib\site-packages\django\t

Running django in standalone mode

2007-04-11 Thread Alex Dong
I'm having a bunch of cron jobs which will use django model and send_mail features. I've read through this link http://groups.google.com/group/django-users/browse_thread/thread/51827a2a40e5262e/bb66770dfff75cfe but for some unknown reason, I still can't use django's model. Will anyone kindly look

Re: Django FileBrowser

2007-04-11 Thread zehi
Hi, I can't figure out step 5: Change /filebrowser/views.py. Replace the paths: FB_ROOT = settings.MEDIA_ROOT + "uploads/" FB_URL = settings.MEDIA_URL + "uploads/" Does it mean to just delete or change? If to change, then how? Thanks On Mar 14, 1:18 am, "patrick k." <[EMAIL PROTECTED]> wrot

Re: SelectMultiple widget

2007-04-11 Thread masuran
Hello Enrico, First of all thank you for your help :) But unfortunately that didn't solve my problem. Next I tried to copy the entire source of an admin generated form that had the two list boxes and modify it. But even without modifying it I didn't get the two listboxes. Very very very strange.

Contact Form App

2007-04-11 Thread Alessandro Ronchi
Is there a newform contact form snippet to use in a django website to add the possibility to send email messages from a webpage to an email address, without spam? Thanks in advance. -- Alessandro Ronchi Skype: aronchi - Wengo: aleronchi http://www.alessandroronchi.net - Il mio sito personale ht

Re: Django FileBrowser

2007-04-11 Thread va:patrick.kranzlmueller
hi, it means that somewhere on your server there is a directory for file- uploads - just point to that directory. e.g., our media-structure looks like this: within the media-directory (=settings.MEDIA_ROOT) we have some sub- directories: /admin/ /site/ /tinymce/ /uploads/ we want our editors

Custom admin interface (admin/change_list.html)

2007-04-11 Thread asrenzo
Hi, I'm wrtting a small web site with a limited number of apps and tables. Almost all my models can easely be managed throught the automatic django admin interface. I changed some minors points of the some change_form by subclassing the original ones and adding extra content in some usable block

Re: Global model/view best practice help

2007-04-11 Thread Dave
Hi all, I was looking at middleware - so, thanks Todd for the pointer in the right direction. I can't seem to find anything much in docs or on the web about TEMPLATE_CONTEXT_PROCESSORS in Django. Anyone got any links? Cheers, Dave On Apr 10, 11:47 pm, "Todd O'Bryan" <[EMAIL PROTECTED]> wrote: >

Re: Detect ajax request

2007-04-11 Thread Ryan Kanno
Ahh... that's what I was missing. Thanks, Nathan (as I'm also using jQuery). :) On Apr 10, 6:23 pm, "Nathaniel Whiteinge" <[EMAIL PROTECTED]> wrote: > I've been happily using limodou's suggestion with the jQuery framework > for a few weeks, hopefully whatever framework you're using also sends >

Use properties for filtering results

2007-04-11 Thread Paolo Dina
In my model there is model method I'd like to use for filtering. Is it possible? I have put it in form of property, but when I use it with field lookup syntax I get an error. This is a minimal sample model that should explain what I mean: class Category(models.Model): name = models.CharField

Re: Global model/view best practice help

2007-04-11 Thread Sam
Like Todd said, 1. Write a function : def my_template_vars(request) return {'var1': 'test', 'var2': 'test2'} 2. Edit your settings.py TEMPLATE_CONTEXT_PROCESSORS = ( ... 'project.app.file.my_template_vars', ) 3. Inside your views, load your templates with a RequestContext object if

Dynamic Model Fields

2007-04-11 Thread Olivier Guilyardi
Hi, I'm in the process of turning telemeta [1] into a django application, and need dynamic model fields: we want to allow site administrators to easily add/remove "fields" to our main data structure, the MediaItem, which represents an audio/video resource. Example: for a given research laborator

Re: Dynamic Model Fields

2007-04-11 Thread Tim Chase
> I'm in the process of turning telemeta [1] into a django > application, and need dynamic model fields: we want to allow > site administrators to easily add/remove "fields" to our main > data structure, the MediaItem, which represents an audio/video > resource. > > Example: for a given research

Re: Contact Form App

2007-04-11 Thread Chris Moffitt
> > Is there a newform contact form snippet to use in a django website to > add the possibility to send email messages from a webpage to an email > address, without spam? Here's what we're using in Satchmo - http://www.satchmoproject.com/trac/browser/satchmo/trunk/satchmo/shop/views/contact.py -

gettext & UnicodeDecodeError

2007-04-11 Thread Sandro Dentella
Hi all, I'm having problems understanding an error that raises with gettext and an accented letter. Italian translation of 'priority' is 'priorità', the text to be translated is: subject = _("Priority changed in ticket #%(id)s %(title)s") % ( {'id':instance.id, 'titl

Testing Framework and Fixtures

2007-04-11 Thread Merric Mercer
Being a relative newbie I don't really understand how to create a fixture for the testing framework. Could someone provide an example of the format of a fixture ? I tried to run the dumpdata command because I'd read that this did much of the work for me but I received the following error mes

Re: gettext & UnicodeDecodeError

2007-04-11 Thread Michael Radziej
On Wed, Apr 11, Sandro Dentella wrote: > > Hi all, > > I'm having problems understanding an error that raises with gettext and an > accented letter. Italian translation of 'priority' is 'priorità', the text > to be translated is: > > subject = _("Priority changed in ticket #%(id)s %(

About static/dynamic urlconf, multiple hosts, urlpatterns, and RegexURLResolver

2007-04-11 Thread Alejo
Hi. Got a question for you about an idea on making urlconfs more sophisticated and dynamic. First some background: We are (re) developing a rather complex collection of sites. We have a live Zope system currently, with a lot of extensions to it's code, it works but it reached it's architectural

Re: Running django in standalone mode

2007-04-11 Thread [EMAIL PROTECTED]
I am assuming that "looker" is the name of your project directory. When you use the statement "from looker...", python is searching through its search path and looking for either modules (python files) or packages (modules grouped in a directory containing an __init__.py file) called "looker". Yo

Re: NewForms Question..

2007-04-11 Thread brad
You are exactly right. Thanks for your time and help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this

Re: Global model/view best practice help

2007-04-11 Thread Dave
Thanks Sam, that was enough for me to start playing around with. Perfect. :) On Apr 11, 3:44 pm, "Sam" <[EMAIL PROTECTED]> wrote: > Like Todd said, > > 1. Write a function : > > def my_template_vars(request) > return {'var1': 'test', 'var2': 'test2'} > > 2. Edit your settings.py > TEMPLATE_C

Re: Dynamic Model Fields

2007-04-11 Thread Olivier Guilyardi
Tim Chase wrote: >> I'm in the process of turning telemeta [1] into a django >> application, and need dynamic model fields: we want to allow >> site administrators to easily add/remove "fields" to our main >> data structure, the MediaItem, which represents an audio/video >> resource. > > Our curr

Re: SelectMultiple widget

2007-04-11 Thread oggie rob
Try using firebug (extension for Firefox). You can see how it is instantiated in the admin site and where things are going wrong. I suspect you either are missing the "vSelectMultipleField" (is that right?) class, the multiple="multiple" attribute, or have not got all of the JS included. As for wh

Re: Dynamic Model Fields

2007-04-11 Thread Gulopine
On Apr 11, 1:36 pm, Olivier Guilyardi <[EMAIL PROTECTED]> wrote: > However, watching the MySQL verbose log, I realized that retrieving properties > as well as their definitions (and enumeration values) to properly display an > detail view or edition form execute a _lot_ of SQL queries, when this c

Re: Dynamic Model Fields

2007-04-11 Thread Tim Chase
> Actually the labs where just an example: one laboratory will > have one installation of the application, and the dynamic > fields will only apply within the scope of this installation. > There's no such thing as consistency accross labs. It still sounds like the above scheme would do the trick.

Re: Testing Framework and Fixtures

2007-04-11 Thread Brian Luft
I've run into problems as well with the fixture functionality. The short of it is that this is a new feature to the framework and likely the kinks will be worked out in the coming weeks. In the meantime you might check out one of these as a workable temporary solution: http://www.djangosnippets.

Database error misreported(?)

2007-04-11 Thread Tim Holloway
I got brought to a dead halt just by populating a single database column. The error message is short on context and the stack trace seems to be at odds with it. Changing values in the database caused a previously-functional page display to fail. Exception reported was "Caught an exception while r

Fwd: Face Shapes - hair style

2007-04-11 Thread Kooooool forwords
Face Shapes - hair style There are seven basic types of facial shapes. They are: 1. Oval, 2. Long, 3. Rectangular, 4. Pear, 5. Diamond 6. Square, and 7. Heart *Oval* The oval face is 1.5 times longer that it is wide and i

Re: Dynamic Model Fields

2007-04-11 Thread Olivier Guilyardi
Tim Chase wrote: >> Actually the labs where just an example: one laboratory will >> have one installation of the application, and the dynamic >> fields will only apply within the scope of this installation. >> There's no such thing as consistency accross labs. > > It still sounds like the above s

Re: Custom SQL - MySQL Dictcursor

2007-04-11 Thread shwag
I looked at a lot of different ways of doing this, and it looks like the django.db cursor needs to be hacked to support MySQLdb's DicCursor. That seems overkill since its easy to just import MySQLdb yourself, and the prebuild django.db libraries are mostly just for the Models. Your other option i

Re: Custom SQL - MySQL Dictcursor

2007-04-11 Thread Jacob Kaplan-Moss
Check out the ``django.db.backend.dictfetch*`` functions. For example: from django.db import connection, backend c = connection.cursor() c.execute(SQL) rows = backend.dictfetchall(c) Jacob --~--~-~--~~~---~--~~ You received this message because y

Re: Simple python question

2007-04-11 Thread mrstone
> What I'm doing is to load a model from a template. > I have in a template something like this: > {% block menu %} > {% block rss %} > > I want to load "menu" and "rss", but I think that is too much work for > now, I have no idea how to implement it and I probably won't do it. > Thank you very m

Log out problems

2007-04-11 Thread jeffhg58
I am having a problem when I log out from my site. Here is the scenario I am using the @login_required for logging into my site. Then I have the link to log out very similar to the admin pages. The only problem I am having is when I log out and either hit the back button or go to my home page fro

error using XML serializer with unicode data

2007-04-11 Thread Saik
Hi people, I'm trying to use the serialize utils at django.core.serializers.xml_serialize and django.core.serializers.json, i don't have problems using json but i have issues trying something like that: xml = serializers.serialize("xml", Anymodel.objects.all()) If the model data contains unicod

Re: Django Set HTTP Error manually

2007-04-11 Thread Jesse Lovelace
Or: from django.http import HttpResponseNotAllowed return HttpResponseNotAllowed() On 4/9/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 4/9/07, johnny <[EMAIL PROTECTED]> wrote: > > At a particular url, my view is looking for XML document to be sent > > over http, by post. If a request c

Programmer Career

2007-04-11 Thread Mike
Find Your Programming Job Vacancy and resources here --> http://www.jobbankdata.com/job-programming.htm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: Log out problems

2007-04-11 Thread James Bennett
On 4/11/07, jeffhg58 <[EMAIL PROTECTED]> wrote: > The only problem I am having is when I log out and either hit the back > button or go to my home > page from the browser it does not give me the login prompt window. This is kind of tricky and exposes a pseudo-bug in Django. What's happening is t

Matthew 24 and EndTime Disasters!!!

2007-04-11 Thread micen
Matthew 24 and EndTime Disasters!!! http://video.google.com/videoplay?docid=303204416536528381 --~--~-~--~~~---~--~~ 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

Re: Log out problems

2007-04-11 Thread jeffhg58
James, Thanks for the explanation. I am going to change my logout to do a redirect Jeff -- Original message -- From: "James Bennett" <[EMAIL PROTECTED]> > > On 4/11/07, jeffhg58 wrote: > > The only problem I am having is when I log out and either hit the back > > bu

Re: SelectMultiple widget

2007-04-11 Thread Enrico
Hi Masuran, You're welcome. :) That's weird! Did you save the entire page source *with* embedded files (.css, .js, images)? The page source itself is the same, what makes the "magic" is the 'SelectFilter2.js' file, that manipulates the source when the page loads, transforming SelectMultiple fie

Re: Use properties for filtering results

2007-04-11 Thread Russell Keith-Magee
On 4/11/07, Paolo Dina <[EMAIL PROTECTED]> wrote: > > In my model there is model method I'd like to use for filtering. > Is it possible? I have put it in form of property, but when I use it > with field lookup syntax I get an error. No. In your example 'visible' isn't a field in your database. Fi

Variable value in template

2007-04-11 Thread Kai Kuehne
With this Team: {% for team in object.squad.team_set.all %} {% appearance_count_for_team team.id %} and class AppearanceCountForTeamNode(template.Node): def __init__(self, team_id): print team_id ... I get "team.id" printed out and not the id of the team. W

Re: Testing Framework and Fixtures

2007-04-11 Thread Russell Keith-Magee
On 4/12/07, Brian Luft <[EMAIL PROTECTED]> wrote: > > I've run into problems as well with the fixture functionality. The > short of it is that this is a new feature to the framework and likely > the kinks will be worked out in the coming weeks. Have you reported these problems? I am aware of one

Re: Testing Framework and Fixtures

2007-04-11 Thread Russell Keith-Magee
On 4/12/07, Merric Mercer <[EMAIL PROTECTED]> wrote: > > I tried to run the dumpdata command because I'd read that this did much > of the work for me but I received the following error message > > >>C:\>manage.py dumpdata promotions > Unable to serialize database: Table_Code matching query does n

Re: error using XML serializer with unicode data

2007-04-11 Thread Russell Keith-Magee
On 4/12/07, Saik <[EMAIL PROTECTED]> wrote: > > Hi people, > > I'm trying to use the serialize utils at > django.core.serializers.xml_serialize and > django.core.serializers.json, i don't have problems using json but i > have issues trying something like that: > > xml = serializers.serialize("xml"

Re: Running django in standalone mode

2007-04-11 Thread Alex Dong
Thanks many. It works like a charm now. Alex On Apr 12, 12:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I am assuming that "looker" is the name of your project directory. > When you use the statement "from looker...", python is searching > through its search path and looking for eithe

Re: Running django in standalone mode

2007-04-11 Thread Alex Dong
here is the 'run.sh' I've created. Hope it helps. Now, to run a cron job, say 'cleanup.py', you will only need to do 'run.sh cleanup.py'. %< #!/bin/bash export PYTHONPATH="$PYTHONPATH:/lib/python2.4/site-package/django/:/ home/alex/projects/" export DJANGO_SETTIN

Re: multilanguage folder names in urls?

2007-04-11 Thread Rohan
> Hi! Is it possible to use i18n for folder names in url patterns? For > example "/accounts" in english would translate automatically to > "konten" in German. Hi, Here's my solution to what I think is the same requirement: First of all setup urlpatterns in urls.py to map all the language variati

Re: Testing Framework and Fixtures

2007-04-11 Thread Brian Luft
If I remember correctly, my problem was that the JSON serializer was bombing out when encountering float fields. I didn't report it directly because I thought I had remembered seeing others report similar problems. It was probably a late night and I got around it by opting for XML formatting. T

Re: Testing Framework and Fixtures

2007-04-11 Thread Russell Keith-Magee
On 4/12/07, Brian Luft <[EMAIL PROTECTED]> wrote: > > If I remember correctly, my problem was that the JSON serializer was > bombing out when encountering float fields. I didn't report it > directly because I thought I had remembered seeing others report > similar problems. It was probably a lat

Re: Variable value in template

2007-04-11 Thread Ivan Sagalaev
Kai Kuehne wrote: > With this > > Team: > {% for team in object.squad.team_set.all %} > {% appearance_count_for_team team.id %} > > and > > class AppearanceCountForTeamNode(template.Node): > def __init__(self, team_id): > print team_id > ... > > I get "team.i