Re: Multiple file upload crashes dev server

2007-03-19 Thread Caz
Hi Lorenzo I suspect its not that you are uploading 2 files, but which files u upload. The line print "%s %s %s %s" % (k, new_data[k]["filename"],new_data[k]["content- type"], new_data[k]["content"]) Will print the actual content of the file you are uploading. Now if thats an image or binary fi

Re: svn 400 bad request

2007-03-19 Thread [EMAIL PROTECTED]
Once I work out how to install pysvn on Dreamhost, I'll make some sort of "nightlies" available for Django. In fact, I wrote an app. [1] to do just that (although it will work for any svn. repo), but should have checked that my host support pysvn first :) [1] http://code.google.com/p/django-nigh

models.ManyToManyField: Multi-relationship in one table

2007-03-19 Thread hoamon
i have no idea about keywords of this question, so i can't search the answer of this question or the django document. my question is i have three models: Trainee, Company, Course. and their relation table is below: Course|Trainee|Company C1| T1 | Com1 C1| T2 | Com1 C1| T3

Re: Adding data to Many-to-Many relationship

2007-03-19 Thread Russell Keith-Magee
On 3/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I have an unusual data modeling situation I am trying to see if I can > tackle using Django. I have a class "Person", which has a self- > referential M2M relationship (a person is related to another person). > I would like to capture wh

Re: IRC

2007-03-19 Thread anders conbere
what happens when you try to join #django the command would be /join #django ~ Anders On 3/19/07, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > > I'm trying to use XChat to connect to the IRC channel, but I can only > find #django-br and #django-fr on FreeNode. > > What am I stupidly doing? > > To

Adding data to Many-to-Many relationship

2007-03-19 Thread [EMAIL PROTECTED]
I have an unusual data modeling situation I am trying to see if I can tackle using Django. I have a class "Person", which has a self- referential M2M relationship (a person is related to another person). I would like to capture what that relationship is. Is there a way to add more fields to the

IRC

2007-03-19 Thread Todd O'Bryan
I'm trying to use XChat to connect to the IRC channel, but I can only find #django-br and #django-fr on FreeNode. What am I stupidly doing? Todd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group

Re: Django & Web Services Api

2007-03-19 Thread Nathan R. Yergler
ElementTree is great, and included with Python 2.5; lxml (http://codespeak.net/lxml) is a super-fast ElementTree + xpath + xslt + lots library implemented on top of libxml2. On 3/19/07, johnny <[EMAIL PROTECTED]> wrote: > > I need to create a simple web api for my project. Basically they make >

Django & Web Services Api

2007-03-19 Thread johnny
I need to create a simple web api for my project. Basically they make a request, I send response back in XML. Or they send me XML docs to upload to my site. Any good python XML out there for this kind of service? I am looking at ElemenTtree. Any other ideas welcome. Thank you --~--~--

Re: Sandbox/Staging/Production Environments with Django (imports work how?)

2007-03-19 Thread sphogan
OK, my setup before put both all the different ones in the same path I had: /home/user/django_projects/project_sandbox /home/user/django_projects/project_staging etc. Now: /home/user/production/project_name /home/user/staging/project_name etc. Before, I would add /home/user/django_projects to t

Re: __search works in mysterious ways.

2007-03-19 Thread abe
On Mar 19, 11:41 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 3/19/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > That's not what I would have expected to see. Have a look at the SQL > > that Django is generating and see if there are any clues there. To do > > that, make sure you

Re: __search works in mysterious ways.

2007-03-19 Thread abe
On Mar 19, 11:15 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2007-03-19 at 14:09 +, abe wrote: > > I'm getting unexpected (missing) results from the __search field > > lookup > > it looks like it can only finds whole words, but only if they're > > larger than > > 3 chars. is

Re: Sandbox/Staging/Production Environments with Django (imports work how?)

2007-03-19 Thread Malcolm Tredinnick
On Mon, 2007-03-19 at 23:54 +, sphogan wrote: > Hi! I've started to use Django and it's wonderful. I'm about ready > to launch my first production site (around 4,000 visitors daily) and I > found that I was unable to setup the sandbox/staging/production setup > I'm used to having. > > Basic

Sandbox/Staging/Production Environments with Django (imports work how?)

2007-03-19 Thread sphogan
Hi! I've started to use Django and it's wonderful. I'm about ready to launch my first production site (around 4,000 visitors daily) and I found that I was unable to setup the sandbox/staging/production setup I'm used to having. Basically, the problem is that files will have imports in them that

Re: __search works in mysterious ways.

2007-03-19 Thread James Bennett
On 3/19/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > That's not what I would have expected to see. Have a look at the SQL > that Django is generating and see if there are any clues there. To do > that, make sure you have DEBUG=True in your settings file (which you > will have by default) an

Re: __search works in mysterious ways.

2007-03-19 Thread Malcolm Tredinnick
On Mon, 2007-03-19 at 14:09 +, abe wrote: > I'm getting unexpected (missing) results from the __search field > lookup > it looks like it can only finds whole words, but only if they're > larger than > 3 chars. is this correct? and is it supposed to work like this? > > > In [65]: c.choice='A

Re: Multiple Forms and/or Models from one template (newforms)

2007-03-19 Thread dballanc
I don't know if it would be of any use to you, but when faced with this problem I ended up making subclass of forms.Form that handled one to one relations. It works a little like form_for_model/instance in that it generates the form based on the model definition rather than fields you define. In

Re: svn 400 bad request

2007-03-19 Thread [EMAIL PROTECTED]
Thanks... Probably has to 'appeal' to the key persons ;-) On Mar 19, 5:40 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 3/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > In my case, the problem is due to the firewall setting which I have no > > power to alter. But if the subversi

Re: Django Stuff

2007-03-19 Thread [EMAIL PROTECTED]
As noted in another thread there is a hack way of adding search to a model detailed on teh django snippits site: http://www.djangosnippets.org/snippets/31/ http://www.djangosnippets.org/snippets/32/ It is no where near as nice nor as comprehensive as the old django stuff abstract search interface

Re: Django Stuff

2007-03-19 Thread [EMAIL PROTECTED]
On Mar 19, 5:15 pm, "Mary" <[EMAIL PROTECTED]> wrote: > I want anybody to help me and tell me where to > findhttps://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/AbstractS... > that can work with Django stable version 0.95.1 > cause i want to use Abstarct search module Unfortunately there

Re: Django Stuff

2007-03-19 Thread Matthew Flanagan
Hi Mary, Attached is a patch to get stuff.search and stuff testing framework (not unlike the new django one) working. I've been using this in a production django site for around a year. On 3/20/07, Mary <[EMAIL PROTECTED]> wrote: > > I want anybody to help me and tell me where to find > https://s

Re: Django Stuff

2007-03-19 Thread Mary
I want anybody to help me and tell me where to find https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/AbstractSearching that can work with Django stable version 0.95.1 cause i want to use Abstarct search module May be this is not the right place for this question but i really don't know

Re: use default value for an unavailable variable on a tag

2007-03-19 Thread Jon Colverson
Michel Thadeu Sabchuk wrote: > I've done a custom tag to use on my templates and I ned to pass a > variable to it, but this variable can or cannot exists. If the > variable doesn't exists, I get an error telling that form.data doesn't > have the key "city". In your tag you can catch the exception

Re: problem with template {% url string %}

2007-03-19 Thread Ivan Sagalaev
Paul Rauch wrote: > Template: > {% url cvh.view.login %} Here you have "view". > urlpatterns = patterns('mysite.cvh.views', > (r'^$','index'), > (r'^login/$','login'), > ) And here you have "views". {% url %} doesn't find your pattern and returns '' (empty string) that browser translates to

Re: Multiple Forms and/or Models from one template (newforms)

2007-03-19 Thread JimR
Brooks, Just saw your note and, no, I haven't gotten it to work the way I wanted. I'm having the same problem and just made another post on the subject. I've tried a bunch of different things, to no avail. I'll keep hacking away at it until it works and if I come up with something I'll drop you

use default value for an unavailable variable on a tag

2007-03-19 Thread Michel Thadeu Sabchuk
Hi guys! I've done a custom tag to use on my templates and I ned to pass a variable to it, but this variable can or cannot exists. If the variable doesn't exists, I get an error telling that form.data doesn't have the key "city". To avoid this error I've done: {% block body_onload %} {% if

New Forms/Newbie Question

2007-03-19 Thread JimR
Alright, I've been struggling with this for a while, so I hope someone can help me. I'm not even sure if I can ask the question intelligently enough for a reply. I'll paraphrase the problem using a subset of my model. I'm familiar with DB programming but not good at it right now! I'm developin

Re: Django and referential integrity.

2007-03-19 Thread Grupo Django
Thank you very much both of you! On 19 mar, 20:32, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 3/19/07, Grupo Django <[EMAIL PROTECTED]> wrote: > > > > > Does Django support referential integrity? > > Django does its best to emulate integrity features when they are not > present in the underl

Re: Django Stuff

2007-03-19 Thread [EMAIL PROTECTED]
DjangoStuff: https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/DjangoStuff Is not part of the core Django system and is third party. It is developed by D. Joseph Creighton, and all questions on his code should be directed to him: https://simon.bofh.ms/ In direct answer to your questio

Re: defecting to django from rails

2007-03-19 Thread [EMAIL PROTECTED]
On Mar 17, 5:09 pm, "rubdabadub" <[EMAIL PROTECTED]> wrote > Now I also need to learn Python from scratch! Man! Python is a rather easy language to pick up. I suggest you start here: http://www.python.org/moin/BeginnersGuide Learning python through Django is kind of like learning C++ via MFC. Wel

Re: Django and referential integrity.

2007-03-19 Thread James Bennett
On 3/19/07, Grupo Django <[EMAIL PROTECTED]> wrote: > > Does Django support referential integrity? Django does its best to emulate integrity features when they are not present in the underlying database (for example, if you delete an object to which other objects were related via foreign keys, Dj

Re: Django Stuff

2007-03-19 Thread James Bennett
On 3/19/07, Mary <[EMAIL PROTECTED]> wrote: > Does Django Stuff works with latest stable version for Django which is > 0.95.1 ?? What is "Django Stuff"? -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You re

Re: Django and referential integrity.

2007-03-19 Thread Jeremy Dunck
On 3/19/07, Grupo Django <[EMAIL PROTECTED]> wrote: > > Does Django support referential integrity? Databases support referential integrity. Django supports databases. :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: Django Stuff

2007-03-19 Thread Jeremy Dunck
What is "Django Stuff"? On 3/19/07, Mary <[EMAIL PROTECTED]> wrote: > > Does Django Stuff works with latest stable version for Django which is > 0.95.1 ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: Django Stuff

2007-03-19 Thread Mary
Also jone more question where shall i put stuff when i download it ?? On Mar 19, 9:12 pm, "Mary" <[EMAIL PROTECTED]> wrote: > Does Django Stuff works with latest stable version for Django which is > 0.95.1 ?? > > Thank you in advance; > Mary Adel --~--~-~--~~~---~--~

Django and referential integrity.

2007-03-19 Thread Grupo Django
Does Django support referential integrity? --~--~-~--~~~---~--~~ 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, sen

problem with template {% url string %}

2007-03-19 Thread Paul Rauch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hello users, I've a problem with the template"function" url: http://www.djangoproject.com/documentation/templates/#url Template: {% url cvh.view.login %} mysite.urls: from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^test

Re: A custom label on a newforms Field doesn't get passed trought pretty_name

2007-03-19 Thread Michel Thadeu Sabchuk
Ok, and I think this is the right approach ;) I have just one note: the admin interface turns the first character of a custom label to uppercase. Should the admin interface follow the same pattern and keep the custom label as is? I only get confused in this question because of the different way t

Django Stuff

2007-03-19 Thread Mary
Does Django Stuff works with latest stable version for Django which is 0.95.1 ?? Thank you in advance; Mary Adel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Re: SESSION_EXPIRE

2007-03-19 Thread Aidas Bendoraitis
Two things, that might be the cause of your problem: a) Have you restarted your browser or at least removed settings.pyc after the changes? b) If you use Mac OS and you close the window of your browser, the browser itself isn't closed. Press Cmd+Q to close the browser completely. Regards, Aidas B

Re: Using custom tags inside custom tags

2007-03-19 Thread Filipe Correia
I think the ideal would be to keep the two tags decoupled, so I think I'll instead use another approach. Instead of using the "list_limit" tag I'll just pass the value from the view to the template (inside the "context"). thanks, Filipe On Mar 19, 4:08 pm, Georgi Stanojevski <[EMAIL PROTECTED]>

problems with many to many relations.

2007-03-19 Thread Àngel Àlvarez
I have started to use django to develop an application , i use the Object-relational mapper from django because i develop a python-qt application i had a problem with many to many relation. My models: RoutePointLog: -- from django.db import models from client i

SESSION_EXPIRE

2007-03-19 Thread tyman26
Where do I set the 'SESSION_EXPIRE_AT_BROWSER_CLOSE = True'? I added this to the "settings" file and sync'd the database, but when I close the browser the session still stays intact. Do I have to add this when the session is created? --~--~-~--~~~---~--~~ You re

Schema evolution

2007-03-19 Thread Mike H
Hi all, Does anyone know what the plans for the schema evolution branch are? Can we expect to see its ideas and code in 1.0? I ask as having to write a patch runner to update live schemas is the only part of working with Django that is an annoyance :) Mike --~--~-~--~~

Re: A custom label on a newforms Field doesn't get passed trought pretty_name

2007-03-19 Thread Tim Chase
> class MyForm(forms.Form): > field1 = forms.CharField(max_length=100) > field2 = forms.Charfield(max_length=100, label='custom field') > > When I render the field, the label for field1 get his first character > uppercased and becomes "Field1", the label for field2 was set by the > labe

Re: Subversion: How do you set up multiple branches of the same project on the same machine?

2007-03-19 Thread Aidas Bendoraitis
How can you import from a package if it is not under python path? Is there another way to do that than just to create a symlink in site-packages? PYTHON_PATH environment variable? The relation between someproject and someproject2 in my case is similar to django trunk and django per-object-permiss

Re: A custom label on a newforms Field doesn't get passed trought pretty_name

2007-03-19 Thread Waylan Limberg
On Mon, 19 Mar 2007 12:47:23 -0400, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote: > > Hi guys, > > If I have a form defined on newforms as: > > class MyForm(forms.Form): > field1 = forms.CharField(max_length=100) > field2 = forms.Charfield(max_length=100, label='custom field') > >

Re: ManyToManyField, limit_choices_to and properties of the request object

2007-03-19 Thread quentinsf
Brilliant - thanks, Sam. Is this in the docs anywhere, I wonder? I've seen a few queries along these lines. Might be an FAQ Q --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: Subversion: How do you set up multiple branches of the same project on the same machine?

2007-03-19 Thread ScottB
Hi Aidas. On Mar 19, 2:18 pm, "Aidas Bendoraitis" <[EMAIL PROTECTED]> wrote: > I have a symlink from trunk/someproject to site-packages/someproject > on my machine. > > I need to launch the branched version of the project at the same time. > So intuitively I create a symlink from branches/somebra

A custom label on a newforms Field doesn't get passed trought pretty_name

2007-03-19 Thread Michel Thadeu Sabchuk
Hi guys, If I have a form defined on newforms as: class MyForm(forms.Form): field1 = forms.CharField(max_length=100) field2 = forms.Charfield(max_length=100, label='custom field') When I render the field, the label for field1 get his first character uppercased and becomes "Field1", th

Re: ManyToManyField, limit_choices_to and properties of the request object

2007-03-19 Thread Sam Morris
On Mon, 19 Mar 2007 09:29:08 -0700, quentinsf wrote: > I need to do something similar. In a form I want to limit the options > in a ForeignKey's pull-down select field to objects owned by an > organisation of which the user is a member. > > I've been trying to work out where this would fit. Any

Re: Authentication Issues...

2007-03-19 Thread James Bennett
On 3/19/07, mediumgrade <[EMAIL PROTECTED]> wrote: > I am not sure what the difference is between RequestContext and > Context (I am still fairly new to Django and Python). RequestContext automatically adds some extra variables to the context of every template that uses it; exactly which variable

Re: ManyToManyField, limit_choices_to and properties of the request object

2007-03-19 Thread quentinsf
I need to do something similar. In a form I want to limit the options in a ForeignKey's pull-down select field to objects owned by an organisation of which the user is a member. I've been trying to work out where this would fit. Any help much appreciated. --~--~-~--~~

Re: Using custom methods in queryset lookups

2007-03-19 Thread Tim Chase
> Now, I want to select all records whose duration (end_time - > start_time) is more than 2 hours. > > I tried a custom method in the model like this which returns the > duration but cannot figure out how to use it in queryset filters. Filtering by calculated fields is best done on the server si

Re: Authentication Issues...

2007-03-19 Thread Gerry Steele
I am getting exactly this same issue when i don't use the built in login short cuts. I too would be interested in the answer. On Mon, 19 Mar 2007 08:11:08 -, mediumgrade <[EMAIL PROTECTED]> wrote: > > So, I am writing my first Django app that requires some form of > authentication, and

Re: Using custom tags inside custom tags

2007-03-19 Thread Georgi Stanojevski
Filipe Correia напиша: > {% ifgreaterthan items|length list_limit %} > See all the records. > {% endifgreaterthan %} > > Using {% list_limit %} prints it's value fine but somehow, when used > in the context of another tag, it's value isn't resolved. Prehaps you could try setting a context vari

How much is Django memory footprint?

2007-03-19 Thread Nuno Mariz
Hi, Anyone can say how much memory an apache process wastes in a django app, in your servers? I can't understand why the 2 servers that I have, one dedicated and other in a slicehost, with the same distro and apps installed. Have diferent memory stats. In my slice I have something like: PID USER

Re: Authentication Issues...

2007-03-19 Thread mediumgrade
I am not sure what the difference is between RequestContext and Context (I am still fairly new to Django and Python). Here is my view code: def home(request): if not request.user.is_authenticated(): return render_to_response('login_error.html') else: return render_to_res

ManyToManyField, limit_choices_to and properties of the request object

2007-03-19 Thread Sam Morris
Is it possible to use a ManyToManyField's limit_choices_to attribute to limit a user to picking only from related objects that have author = request.user? Given that request has no place in the model definition, would it be necessary to write a custom manipulator? -- Sam Morris http://robots.org

Re: creating a website log

2007-03-19 Thread David Larlet
2007/3/6, limodou <[EMAIL PROTECTED]>: > > I think signals will be easier, if you also want to record delete > information of a record, you can also hook pre_delete, the pseudo code > is: > > from django.db.models import signals > > def pre_save(sender, instance, signal, *args, **kwargs): > if

Using custom methods in queryset lookups

2007-03-19 Thread Sambhav
Hi everyone, A simplified version of my model looks like this: class Schedule(models.Model): start_time = models.DateTimeField('Start Time') end_time = models.DateTimeField('End Time') event = models.CharField(maxlength=100) Now, I want to select all records whose duration (end_time

Re: update_object and duplication of inline objects on save

2007-03-19 Thread martwine
Hello all, I'm still really stuck with this problem. I could write a custom manipulator, although then I loose lots of the useful admin-related functionality e.g. num_in_admin, num_extra_on_change etc. I suspect I should really update my version of django and swap everything to the newforms librar

problems with many to many relations.

2007-03-19 Thread Àngel Àlvarez
I have started to use django to develop an application , i use the Object-relational mapper from django because i develop a python-qt application i had a problem with many to many relation. My models: RoutePointLog: -- from django.db import models from clien

Using custom tags inside custom tags

2007-03-19 Thread Filipe Correia
Hi, I'm trying to write a custom tag which would accept as a parameter a value from another custom tag. The usage would be something like the following (trunclist_legth is a custom template tag which simply returns an int value): {% ifgreaterthan items|length list_limit %} See all the records. {

Subversion: How do you set up multiple branches of the same project on the same machine?

2007-03-19 Thread Aidas Bendoraitis
We have the following structure for development files under subversion: trunk |_ someproject |_ media branches |_ somebranch |_ someproject |_ media I have a symlink from trunk/someproject to site-packages/someproject on my machine. I need to launch the branched version of the project at

__search works in mysterious ways.

2007-03-19 Thread abe
I'm getting unexpected (missing) results from the __search field lookup it looks like it can only finds whole words, but only if they're larger than 3 chars. is this correct? and is it supposed to work like this? In [65]: c.choice='ABC123\ncde456' In [66]: c.save() In [67]: Choice.objects.fil

Re: Multiple file upload crashes dev server

2007-03-19 Thread Benjamin Slavin
You might want to throw some logging into your application (Python's logging module). [0] If you use logging, you'll be able to get a better handle on where the problem is actually happening. I've heard of the dev server crashing ungracefully when it encounters an error, but have never seen it m

Re: Search feature

2007-03-19 Thread [EMAIL PROTECTED]
On Feb 22, 11:07 pm, "Mary" <[EMAIL PROTECTED]> wrote: > How can i add a search feature to my website? > > Can anybody help me in this Hi Mary, have a look at these two snippets: http://www.djangosnippets.org/snippets/31/ (long version, easier to understand the principle) http://www.djangosnippe

Re: referrers: to django or not?

2007-03-19 Thread ScottB
Hi Bram. On Mar 17, 2:17 pm, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > "in the last 7 days your blog/item/whatever has been visited from: > 7 xhttp://somewebsite.com > 5 xhttp://someotherwebsite.com Beware of opening yourself up to referrer spam. Spam bots can request pages on your si

Re: Authentication Issues...

2007-03-19 Thread [EMAIL PROTECTED]
On Mar 19, 4:11 am, "mediumgrade" <[EMAIL PROTECTED]> wrote: > The problem is that once they are at the "/home" URL, the template > does not show that the user is logged in. The "if is_logged_in" test > fails. > > What could I be doing wrong? 1. where is your view code? 2. where does the 'is_logg

Re: model relationship filtering

2007-03-19 Thread [EMAIL PROTECTED]
Hello, > If a gallery is unique to a rantal, why use a n:m relationship? You > should be able to use a 1:m if each photo is associated with exactly one > rental. As to putting the images in rental-specific sub-directories, can > you make the association from photo to rental explicit and do this?

Authentication Issues...

2007-03-19 Thread mediumgrade
So, I am writing my first Django app that requires some form of authentication, and I have run into a bit of a snag: I authenticate the user via the 'django.contrib.auth.views.login' view using a login template like this: {% block main_section %} {% if form.has_errors %} Your username and pas