Re: How to embed django into a custom web server

2008-12-13 Thread Jim
Thanks for the good info. Let me explain why I would want to develop my own web server... I've got a real time, asynchronous server that uses a proprietary binary protocol to monitor remote systems using a push model, and I'd like to expose the incoming data over HTTP using a web app, also using

Re: Combine model form with a formset

2008-12-13 Thread Marc DM
If you want to edit them together in the admin then do this for your admin class # class BookInline(admin.TabularInline) model = Book extra = 2 class AuthorOptions(admin.ModelAdmin) inlines = [BookInline] admin.register(Author, AuthorOptions)

Re: Issue with saving existing model when using inlineformsets

2008-12-13 Thread maeck
Fixed it. See the code here: http://www.djangosnippets.org/snippets/1246/ --~--~-~--~~~---~--~~ 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

mod_wsgi // Stack trace does not show in log files or gets sent by email

2008-12-13 Thread Stefan Wallner
Hi, I am running Django 1.0 on Windows Server 2003, Python 2.5 with mod_wsgi. I am having trouble capturing any exceptions in my code either through Apache's error log or by having an email sent to me. As a simple test I added a = [1,2,3] b = a[4] to the top of one of my views, which does

Re: Multiple apps extending admin/change_list.html

2008-12-13 Thread Malcolm Tredinnick
On Sat, 2008-12-13 at 18:17 -0800, Jeff Kowalczyk wrote: > I am developing an app with a customized admin/change_list.html [1]. I > added djang-batchadmin, which itself has a template extending admin/ > change_list.html (batchadmin/templates/batchadmin/change_list.html) > > What is the most

Re: Using generic views with app_directories template loader

2008-12-13 Thread Malcolm Tredinnick
On Sat, 2008-12-13 at 18:13 -0800, ptone wrote: [...] > So was modifying tutorial to use the app_directories loader > > Had to take out the 'polls/' subdir part of the template path - that > made sense. No, you didn't have to do that. It's optional and, in this case, is the cause of your later

Multiple apps extending admin/change_list.html

2008-12-13 Thread Jeff Kowalczyk
I am developing an app with a customized admin/change_list.html [1]. I added djang-batchadmin, which itself has a template extending admin/ change_list.html (batchadmin/templates/batchadmin/change_list.html) What is the most effective pattern to manage multiple apps extending the same admin

Using generic views with app_directories template loader

2008-12-13 Thread ptone
OK, I'm new - worked my way through the tutorial, been reading some of the other docs. Really feel the best design principle should be to keep all app related stuff in the app directory (and feel that one day the tutorial docs could reflect this). So was modifying tutorial to use the

Re: django query database

2008-12-13 Thread Malcolm Tredinnick
On Sun, 2008-12-14 at 00:46 +0100, Alfredo Alessandrini wrote: > Hi, > > It's possible call a query with max or min value?: > > like this: > > game_list = game.objects.filter(Q(max_rating > player.rating) & > Q(min_rating < player.rating)) Not yet. Search the archives of this list for the

Re: Showing the category structure in my blog

2008-12-13 Thread Malcolm Tredinnick
On Sat, 2008-12-13 at 15:17 -0800, XeroXer wrote: [...] > The problem I am having is how do I show this in a nice list with the > child object following their parent. > Like: > > Parent > > Child > > > Single > > > Well something like that, maybe someone can help me ... :) The

Re: login django using curl

2008-12-13 Thread Malcolm Tredinnick
On Sat, 2008-12-13 at 14:44 -0800, Adrián Ribao wrote: > Hello, I'm writing a script and I'd like to login into a django webapp > using pycurl or urllib. > I've problems with the cookies, and every time the message is: "The > session has expired" > > Does anybody know how can I make it? You

Re: middleware import errors

2008-12-13 Thread Malcolm Tredinnick
On Sat, 2008-12-13 at 05:07 -0800, Vladimir Kirillov wrote: > using django-1.0.2 with apache-1.3 (OpenBSD), python-2.4, fastcgi and > py-flup-1.0 from yesterday's mercurial tip By the way, for the future, you'll probably want to find a way to work out what the real subversion revision is that

Re: template string formatting

2008-12-13 Thread Malcolm Tredinnick
On Sat, 2008-12-13 at 02:14 -0800, Vicky wrote: > Is there any way to take out the first letter of a string in django > template system? > ex: > > x("Hai") should give o/p as: "H" The "slice" filter has already been suggested, but this is a case of the template system providing more than

Re: stupid question

2008-12-13 Thread volk23
got it. thank you. --~--~-~--~~~---~--~~ 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

Re: Extending templates in admin Django admin site question

2008-12-13 Thread 3lancer.eu
Ok, I found it, {{ original.image }} :-) --~--~-~--~~~---~--~~ 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

django query database

2008-12-13 Thread Alfredo Alessandrini
Hi, It's possible call a query with max or min value?: like this: game_list = game.objects.filter(Q(max_rating > player.rating) & Q(min_rating < player.rating)) Thanks in advance, Alfredo --~--~-~--~~~---~--~~ You received this message because you are

Re: How to embed django into a custom web server

2008-12-13 Thread Graham Dumpleton
Jim wrote: > Hi Graham, > > Thanks for your response. I've taken a quick look over the WSGI spec > and it looks good. I have a couple questions though and I apologize > if they've already been answered in the forum or in the Django > documentation > > 1) Based on your suggestion to use

Showing the category structure in my blog

2008-12-13 Thread XeroXer
Hi all! I am really new to both python and Django, but so far I really like it. My first project is a blog that I am creating while going through the beginner tutorial for a poll. I am simply reading the information for the poll and then using it for my blog, but I have a bit of a problem.

Re: stupid question

2008-12-13 Thread Daniel Roseman
On Dec 13, 9:08 pm, volk23 wrote: > i've made a modification in a App i created. run syncdb, it dont show > changes made. what could be wrong? thanks in advance > What's wrong is that you didn't read the documentation:

login django using curl

2008-12-13 Thread Adrián Ribao
Hello, I'm writing a script and I'd like to login into a django webapp using pycurl or urllib. I've problems with the cookies, and every time the message is: "The session has expired" Does anybody know how can I make it? Thank you! --~--~-~--~~~---~--~~ You

Re: Advice on form to create new object that has foreign key field

2008-12-13 Thread Daniel Roseman
On Dec 13, 10:12 pm, DavidA wrote: > The problem is that trade is required so is_valid will fail. > So exclude it from the form: class AddFillForm(forms.ModelForm): class Meta: exclude = ('trade',) -- DR.

Re: geodjango Fast Distance Searches

2008-12-13 Thread cullepm3
I meant to direct this question to geodjango experts. 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

Re: One to Many insert into Postgres

2008-12-13 Thread tofergus
On 12.12-08:28, Ana wrote: [ ... ] > Thank you both for the suggestions. There is a problem with the > sequence number in the primary keys. When I created a new table > without data the insert worked fine.I will try to recreate the > sequences and hope I don't have to re-enter the data.

Re: stupid question

2008-12-13 Thread Huseyin Berberoglu
On Sat, Dec 13, 2008 at 11:08 PM, volk23 wrote: > > i've made a modification in a App i created. run syncdb, it dont show > changes made. what could be wrong? thanks in advance > You must delete related table manually. Then manage.py syncdb. -- Hüseyin Berberoğlu

Re: Advice on form to create new object that has foreign key field

2008-12-13 Thread DavidA
The problem is that trade is required so is_valid will fail. On Dec 13, 5:01 pm, Daniel Roseman wrote: > On Dec 13, 9:30 pm, DavidA wrote: > > > > > I have two models, Trade and Fill. A Trade can have many fills. Fill > > has a FK to

stupid question

2008-12-13 Thread volk23
i've made a modification in a App i created. run syncdb, it dont show changes made. what could be wrong? thanks in advance from this: class CarMake(models.Model): name = models.CharField(max_length=30) class CarModel(models.Model): name = models.CharField(max_length=30) to this:

Fast Distance Searches

2008-12-13 Thread cullepm3
I have a database of 5 million locations in the U.S. I would like to support _fast_ distance / proximity searches. In other words the user enters an address, my app geocodes the location and then returns nearby points of interest. The user can specify the proximity which might be something

Re: Advice on form to create new object that has foreign key field

2008-12-13 Thread Daniel Roseman
On Dec 13, 9:30 pm, DavidA wrote: > I have two models, Trade and Fill. A Trade can have many fills. Fill > has a FK to Trade: > > class Trade(models.Model): >     trade_date = models.DateField(auto_now_add=True, editable=False) >     side =

Advice on form to create new object that has foreign key field

2008-12-13 Thread DavidA
I have two models, Trade and Fill. A Trade can have many fills. Fill has a FK to Trade: class Trade(models.Model): trade_date = models.DateField(auto_now_add=True, editable=False) side = models.CharField(max_length=12, choices=SIDE_CHOICES) inst = models.ForeignKey(Inst) class

Extending templates in admin Django admin site question

2008-12-13 Thread 3lancer.eu
Hi, I want to extend default template for /admin/photosite/photo/some_id/. Basically, I want to display, only when editing, a thumbnail of the photo with JCrop widget for cropping. How can I access the 'image' field of the edited record? I think I need not to write a custom view here, since I

Re: problem in loading images.

2008-12-13 Thread Daniel Roseman
On Dec 13, 7:37 pm, Sura wrote: > Hi djangonauts, >         I am new to django and i developed the site using django. > My site works well in my system local server .. > I hosted my site in dreamhost server and the url iswww.csmit.org > But now in the site the images fail to

Django and flex, modpython and crossdomain.xml

2008-12-13 Thread coulix
Hello djangonauts, I am attempting to use Django and Flex. It went all good until i moved to mod_python on my local machine (127.0.0.1). If i try to upload from the flex component (swf comming from 127.0.0.1) to a django view (also on localhost) i get a security violation error 2048 from flex !

Re: "Legal" way to have foreign key field in the custom form

2008-12-13 Thread Eugene Mirotin
I have only overriden the title and content blocks, nothing more, so it really looks strange On Dec 13, 10:04 pm, Jeff FW wrote: > Glad to help. > > That's strange that you had to add that JS to your template--it should > be included automatically.  Looking at the admin

Re: "Legal" way to have foreign key field in the custom form

2008-12-13 Thread Jeff FW
Glad to help. That's strange that you had to add that JS to your template--it should be included automatically. Looking at the admin default options: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py#L202 it should be on every object add/edit page. Maybe you

problem in loading images.

2008-12-13 Thread Sura
Hi djangonauts, I am new to django and i developed the site using django. My site works well in my system local server .. I hosted my site in dreamhost server and the url is www.csmit.org But now in the site the images fail to load as well as the media.. But i can access from the path

Re: Multiple sites - same code, different templates

2008-12-13 Thread bruno desthuilliers
On 13 déc, 14:41, barbara shaurette wrote: > This might be overkill, but you could use middleware and parse for the > version number in request.path: > > from django.conf import settings > from django.http import HttpResponseRedirect > > from mysite import settings as

Re: Optional GenricForeigKey: "null=True, blank=True" => unexpected keyword argument

2008-12-13 Thread Alex Koshelev
GenericForeignKey is pseudo-field. It doesn't have any own underlying db field representation, so there is no need to specify it as blank and nullable. On Sat, Dec 13, 2008 at 22:45, mwebs wrote: > > Hello, > > I have a model that I want to have an optional generic

Optional GenricForeigKey: "null=True, blank=True" => unexpected keyword argument

2008-12-13 Thread mwebs
Hello, I have a model that I want to have an optional generic relation to any other kind of model. content_type = models.ForeignKey(ContentType, null=True, blank=True) object_id = models.PositiveIntegerField(null=True, blank=True) content_object = generic.GenericForeignKey(null=True,

file upload with create_object generic view

2008-12-13 Thread Andy Young
Hi all, just to confirm a suspicion I have with using the 'create_object' generic view: #urls.py ... (r'^accepts/photos/$', 'django.views.generic.create_update.create_object', {'model':photologue.models.Photo}), ... renders the form A-OK. However, choosing an image for the file upload

Re: TypeError at admin: unpack non-sequence

2008-12-13 Thread Daniel Roseman
On Dec 13, 6:43 pm, benw wrote: > I have the exact same problem with Django 1.0.2 Final on Debian Etch > (Apache 2.2.3-4+etch6 / mod_python 3.2.10-4) -- My settings.py, vhost > and urls.py are nearly exactly the same as above (the relelant parts > anyway.) > > On Dec 12,

Re: TypeError at admin: unpack non-sequence

2008-12-13 Thread benw
I have the exact same problem with Django 1.0.2 Final on Debian Etch (Apache 2.2.3-4+etch6 / mod_python 3.2.10-4) -- My settings.py, vhost and urls.py are nearly exactly the same as above (the relelant parts anyway.) On Dec 12, 3:00 am, Bluemilkshake wrote: > Of

Re: How to embed django into a custom web server

2008-12-13 Thread Jim
Hi Graham, Thanks for your response. I've taken a quick look over the WSGI spec and it looks good. I have a couple questions though and I apologize if they've already been answered in the forum or in the Django documentation 1) Based on your suggestion to use WSGI, I'm assuming Django

Re: keep html

2008-12-13 Thread Patricio Palma
On Dec 7, 8:45 pm, Malcolm Tredinnick wrote: > On Sun, 2008-12-07 at 14:24 -0300, Patricio Palma wrote: > > > On Sun, Dec 7, 2008 at 2:12 AM, Karen Tracey > > wrote: > > >         Something like View->Page Source from the browser menu? > >        

Re: Combining multiple Django applications.

2008-12-13 Thread Adam Fast
That type of system is usually called a "Tumblelog" - and you can find a lot of info in these two articles below. Ryan's uses generic foreign keys and an "intermediary" object, so to speak, so that you just query that one object and it knows about all instances of your app1/app2/app3 models. This

Re: Help organizing inline fields in User

2008-12-13 Thread Adrian
On Nov 28, 3:48 pm, mondonauta wrote: > well what i got is this error: > __ > Exception Type:         ImproperlyConfigured > Exception Value:        'ProfessorAdmin.fieldsets[4][1]['fields']' >                                 refers

Re: Multiple sites - same code, different templates

2008-12-13 Thread barbara shaurette
This might be overkill, but you could use middleware and parse for the version number in request.path: from django.conf import settings from django.http import HttpResponseRedirect from mysite import settings as local_settings class DetectSiteVersion(object): def __init__(self):

middleware import errors

2008-12-13 Thread Vladimir Kirillov
using django-1.0.2 with apache-1.3 (OpenBSD), python-2.4, fastcgi and py-flup-1.0 from yesterday's mercurial tip throws these logs into error-log and 500 to any requests: apache error logs: Traceback (most recent call last): File "../lib/flup/server/fcgi_base.py", line 558, in run File

How to change style on an element?

2008-12-13 Thread bhavana
How to change style on an element? http://interviewdoor.com/questions-faqs/viewtopic.php?f=155=1163 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: How to return a specified column from database

2008-12-13 Thread Lee
Hi, Antoni Aloy Thanks a lot. I got it. cheers Lee On Dec 13, 11:46 pm, "Antoni Aloy" wrote: > http://docs.djangoproject.com/en/dev/ref/models/querysets/ > > Check for values for exmple. Has a fields property that will allow you > to specify the fields you want to

Re: How to return a specified column from database

2008-12-13 Thread Antoni Aloy
http://docs.djangoproject.com/en/dev/ref/models/querysets/ Check for values for exmple. Has a fields property that will allow you to specify the fields you want to return. 2008/12/13 Lee : > > Hi, James Bennett > > Thanks for you reply. > > Howerver, I have already read

Re: How to return a specified column from database

2008-12-13 Thread Lee
Hi, James Bennett Thanks for you reply. Howerver, I have already read the database API documentation, and I can't find this method. On Dec 13, 11:13 pm, "James Bennett" wrote: > On Sat, Dec 13, 2008 at 5:55 AM, Lee wrote: > >    If I want

Re: How to return a specified column from database

2008-12-13 Thread James Bennett
On Sat, Dec 13, 2008 at 5:55 AM, Lee wrote: >If I want to return a specified column in this situation without > using SQL query (select y from table where x =1), how to do it? There is a method which will do this, and it is listed in the database API documentation

How to return a specified column from database

2008-12-13 Thread Lee
Hi,everyone. The database-abstraction API in django can query the database by using table.objects.filter('x =1') or table.objects.get('x = 1'). However, these build method will return all the columns in the table which are satisfied x = 1, like select * from table where x = 1. If I

ModelForm with only FileField or ImageField can not pass validation

2008-12-13 Thread Ozgur Gunes
Hi. I want to let my users can change their mugshot without updating their whole profile. When i have a form with only mugshot field, form never pass validaiton. If i add another field to that form it can pass validation now. My model and forms are below. class Profile(models.Model):

Re: template string formatting

2008-12-13 Thread Alex Koshelev
{{var|slice:"0"}} On 12/13/08, Vicky wrote: > > Is there any way to take out the first letter of a string in django > template system? > ex: > > x("Hai") should give o/p as: "H" > > > -- --- Александр Кошелев daeva...@gmail.com

template string formatting

2008-12-13 Thread Vicky
Is there any way to take out the first letter of a string in django template system? ex: x("Hai") should give o/p as: "H" --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this