object appears twice after filtering by many to many field

2010-12-22 Thread tom
Hi all! I have 2 models: Clip, Tag. class Clip(models.Model): name = models.CharField(max_length=80) tags = models.ManyToManyField(Tag, through = 'TagsToClips') class Tag(models.Model): tagName = models.CharField(max_length=80, unique=True) class TagsToClips(models.M

object appears twice after filtering by many to many field

2010-12-22 Thread tom
Hi all! I have 2 models: Clip, Tag. class Clip(models.Model): name = models.CharField(max_length=80) tags = models.ManyToManyField(Tag, through = 'TagsToClips') class Tag(models.Model): tagName = models.CharField(max_length=80, unique=True) class TagsToClips(models.M

Re: object appears twice after filtering by many to many field

2010-12-22 Thread Dan Fairs
> Hi all! > I have 2 models: Clip, Tag. > class Clip(models.Model): > name = models.CharField(max_length=80) > tags = models.ManyToManyField(Tag, through = 'TagsToClips') > > class Tag(models.Model): > tagName = models.CharField(max_length=80, unique=True) > > class Tag

Re: object appears twice after filtering by many to many field

2010-12-22 Thread tom
Thanks for the quick replay. The problem is the clip duplication, when relaying on clip_set.count() and also in the admin site when you see raw duplication after filtering , it is not very reasonable :) 1. in order to change this behavior in the admin site I need to manipulate main.py and add dist

Re: object appears twice after filtering by many to many field

2010-12-22 Thread Dan Fairs
> Thanks for the quick replay. > The problem is the clip duplication, when relaying on clip_set.count() > and also in the admin site when you see raw duplication after > filtering , it is not very reasonable :) > Ah, I didn't realise it was in the admin. It'll still be the same underlying proble

Re: How does Django handle Foreign Key in MySQL?

2010-12-22 Thread Tom Evans
On Wed, Dec 22, 2010 at 7:55 AM, Andy wrote: > Say I have these models: > > class Musician(models.Model): >    first_name = models.CharField(max_length=50) >    last_name = models.CharField(max_length=50) > > class Album(models.Model): >    artist = models.ForeignKey(Musician) >    name = models.C

Re: Nested iteration through related models

2010-12-22 Thread Tom Evans
On Tue, Dec 21, 2010 at 9:48 PM, Dopster wrote: > Let's say I have the following models: > > class Group(models.Model): >     group_name = models.CharField(max_length=20) > > class Person(models.Model): >     group = models.ForeignKey(Group) >     name = models.CharField(max_length=50) > > How do

Django version 1.3 alpha 1 - no css in admin when using builtin webserver

2010-12-22 Thread fredrik70
Hi all, Just getting back to some django devel after a few years hiatus. Have a problem with css on my dev webserver (just the builtin one that comes with django). Running this on windows XP. It refuses to serve the css for the admin site. I haven't changed anything in the settings.py and what I re

Re: How does Django handle Foreign Key in MySQL?

2010-12-22 Thread Javier Guerra Giraldez
On Wed, Dec 22, 2010 at 2:55 AM, Andy wrote: > MySQL with MyISAM tables doesn't support Foreign Key. to be precise, it's supported but ignored. so, Django generates it, and if you're using InnoDB tables, it will work as intended; if it's MyISAM, it won't make a difference. -- Javier -- You r

Re: FormSet validation - not sure how to implement

2010-12-22 Thread Michael Thamm
Never mind - I changed it to ModelForm class instead. >From what I have read, FormSet is not designed to be used in the generic form way. Rather for bulk adds or something like that. ModelForm works nice and easy. On Dec 21, 7:04 am, Michael Thamm wrote: > I am using 2 formsets on a template for

Calling a Method from a Form

2010-12-22 Thread Brian Callies
Good Day, As a part of a project I want to create a single page that has a number of different utilities on it. One of those is a dice roller. Ultimately I'd like to be able to type in the number of dice and number of sides, click a button, and return the result on the page. I understand you cann

CSRF verification failed. Request aborted.

2010-12-22 Thread Harbhag Singh Sohal
MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.csrf.CsrfViewMiddlewa

Detecting camera type from image file

2010-12-22 Thread Sithembewena Lloyd Dube
Hi all, Is there a method to detect what camera took an image in Python/ Django? -- Regards, Sithembewena Lloyd Dube -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubs

Re: CSRF verification failed. Request aborted.

2010-12-22 Thread Harbhag Singh Sohal
I am also using {% csrf_token %}, even then I am getting error. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsub

Re: Detecting camera type from image file

2010-12-22 Thread Thomas Weholt
Look at pyexiv2 or PIL. On Wed, Dec 22, 2010 at 2:36 PM, Sithembewena Lloyd Dube wrote: > Hi all, > > Is there a method to detect what camera took an image in Python/ Django? > > -- > Regards, > Sithembewena Lloyd Dube > > -- > You received this message because you are subscribed to the Google Gr

Re: CSRF verification failed. Request aborted.

2010-12-22 Thread robos85
Do You pass *RequestContext* to your template during rendering it in view? Example from manual: def my_view(request): c = {} # ... return render_to_response("a_template.html", c, context_instance=RequestContext(request)) -- You received this message bec

Re: CSRF verification failed. Request aborted.

2010-12-22 Thread Harbhag Singh Sohal
from django.template import RequestContext return render_to_response('abook_view.html', locals(),context_instance=RequestContext(request)) this is what I am using. Is it ok ? -- Harbhag Singh Sohal http://harbhag.wordpress.com -- You received this message because you are subscribed to the Goog

Re: CSRF verification failed. Request aborted.

2010-12-22 Thread Dan Fairs
> from django.template import RequestContext > return render_to_response('abook_view.html', > locals(),context_instance=RequestContext(request)) What you're doing should be fine, in terms of whether it works or not. However, I'd strongly recommend against passing locals(). While it may seem to vi

fcgi, runfastcgi, parameters, docs [noob question]

2010-12-22 Thread Richard Brosnahan
Hi all, I'm new to django but not new to Python. My goal is to build a web site using django, replacing an old, tired php framework. The django 1.2.3 tutorials were fine. I got the basics of my site working locally, after going thru the entire tutorial. Before going any further, I wanted to se

Re: CSRF verification failed. Request aborted.

2010-12-22 Thread Harbhag Singh Sohal
> What you're doing should be fine, in terms of whether it works or not. > However, I'd strongly recommend against passing locals(). While it may seem > to violate DRY to do anything else, experience has shown me that it makes > maintaining the code a lot harder in the long run, as it's not imme

Re: Detecting camera type from image file

2010-12-22 Thread Sithembewena Lloyd Dube
Thanks Thomas, looks like this can handle what I have in mind. Much appreciated. On Wed, Dec 22, 2010 at 3:44 PM, Thomas Weholt wrote: > Look at pyexiv2 or PIL. > > On Wed, Dec 22, 2010 at 2:36 PM, Sithembewena Lloyd Dube > wrote: > > Hi all, > > > > Is there a method to detect what camera took

Requesting Quote

2010-12-22 Thread sidhu
Hello Developers,I am looking for developers for a project (see requirements below). I would appreciate a quote if you can take on the work. There is an IndivoX learning curve. I am supplying links to documents:http://dl.dropbox.com/u/12539855/prototype-contract-package/prototype-requirements-main-

Excellent Python/Django Opportunity in Atlanta!!!

2010-12-22 Thread ATL Recruiter
Hello All, I am an IT Recruiter based out of Atlanta, GA, and I was hoping that someone out there could help me out. I am looking for some top Python/ Django talent, so I figured; why not go directly to the source! Our client is building a team of world-class Python Developers with varying degree

visual quickpro chapter 10 - csrf token

2010-12-22 Thread SurfSim
Hi i'm a new but enthusiast django user. After succesfully running the django project tutorials and expirimenting a bit I bought two books (visual quick pro and django tdg) ran by the first 9 chapters easily but bumped into a problem with chapter 10 which simulates a login/ logout page.. After some

Succeeding with SSL

2010-12-22 Thread Jakob H
Hi, I have a Django site hosted on Bluehost, and I'm trying to get SSL to work, but have some problems. I've got a dedicated IP with SSL certificates all ready to go. 1. Whenever I enter a https://... I'm automatically re-directed to a http:// address. I assumed that this cannot be Django related

Building app on already existing set of DB tables

2010-12-22 Thread Vikram
Hi, I am working on building an app that reports the data from the already existing tables in the Oracle DB. These tables are data-dictionary tables and my application will connect to these tables using read-only access to SELECT and draw graphs on the webpage. How do I build my application that q

Re: Building app on already existing set of DB tables

2010-12-22 Thread Fred Chevitarese
I think you can configure your settings to access the database, and after that, you can run this command: python manage.py inspectdb > youtfile.txt Than, you'll have to realocate the models, 'cause django will output all tables in the database like models.py ;) Is that what you want? Hope it he

Re: Building app on already existing set of DB tables

2010-12-22 Thread bruno desthuilliers
On 22 déc, 17:22, Vikram wrote: > Hi, > > I am working on building an app that reports the data from the already > existing tables in the Oracle DB. These tables are data-dictionary > tables and my application will connect to these tables using read-only > access to SELECT and draw graphs on the w

Re: Excellent Python/Django Opportunity in Atlanta!!!

2010-12-22 Thread Venkatraman S
On Wed, Dec 22, 2010 at 9:05 PM, ATL Recruiter wrote: > > Our client is building a team of world-class Python Developers with > varying degrees of seniority and skills to build a brand new > application that will drive this company to their future-state. > Mentioning the name of the client always

Re: Admin Site: how to add apps with no db model?

2010-12-22 Thread creecode
Hello armandoperico, Sounds like a job for cron, Celery, or any other number of task schedulers. Alternately you could create a url at your website that runs the script. Of course putting in appropriate checks so that only you can run it. You could then probably customize the admin app index te

Re: Problem with simple file upload.

2010-12-22 Thread Nick Serra
I'm too lazy to check, but i'm pretty sure the name of your file input needs to match the name of the form field. Also, try troubleshooting. Use print statements in the view to see if the file object is being posted, etc. On Dec 21, 11:54 pm, vivek_12315 wrote: > Awaiting reply! > > On Dec 22, 3:

Re: Django Debug Toolbar -- getting 404s for javascript file when using request.GET in SHOW_TOOLBAR_CALLBACK

2010-12-22 Thread Brian S
Thanks to kr who answered this offline. Some static files in the debug_toolbar need to be modified to include the ?debug arg. I put his suggestions into the attached patch file. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Problem with simple file upload.

2010-12-22 Thread yiftah
Nick is right, you need to change your view code to handle_uploaded_file(request.FILES['uploaded']) instead of handle_uploaded_file(request.FILES['file']) I'm not sure a request object can process a file upload you may need to use RequestContext in your view definition On Dec 22, 7:50 pm, Nick Se

What's your workflow?

2010-12-22 Thread Dana
I've been bashing my head against a wall lately trying to determine the best (highly subjective, I know) workflow for developing Django projects. What I have gathered so far is: * Buildout -- For building and packaging your projects. * Fabric -- For easy deployment/testing of code on devel/stagin

XBAP application

2010-12-22 Thread stegzzz
Hi, I have an XBAP application that I want to run from my django website. At the moment I'm just setup on my local machine using the development server and it is working OK for straightforward html pages and the XBAP program works OK if I just click on the XBAP file. However when I want to run the

Re: What's your workflow?

2010-12-22 Thread Subramanyam
Hi After working on couple of big projects I felt the best way to start on django once you have the basic setup ready is 1.) Have a complete list of the features into your requirement documents if its not possible and you want a agile development methodology split into features that makes sen

Re: What's your workflow?

2010-12-22 Thread Dana
Subramanyam, thanks for the response. In regard to 3, I am not clear why it would be a good idea to add in model fields for things you *think* you might want some day. I would think that using Django South or something similar to create SQL migrations for your model after a change would be a clea

Re: XBAP application

2010-12-22 Thread Mr. Gerardo Gonzalez Cruz
Why don't use a iframe, inside iframe call a your xbap application. On Wed, Dec 22, 2010 at 12:35 PM, stegzzz wrote: > Hi, I have an XBAP application that I want to run from my django > website. At the moment I'm just setup on my local machine using the > development server and it is working O

Re: English translation for error message?

2010-12-22 Thread Nick Serra
http://translate.google.com/#auto|en|%20list%20index%20out%20of%20range On Dec 21, 6:10 pm, Bill Freeman wrote: > On Tue, Dec 21, 2010 at 5:53 PM, Jonathan Hayward < > > > > > > christos.jonathan.hayw...@gmail.com> wrote: > > [jhayw...@cmlnxbld01 invdb]$ python manage.py shell > > Python 2.7 (r27

Re: Building app on already existing set of DB tables

2010-12-22 Thread Ian
On Dec 22, 9:22 am, Vikram wrote: > Scenario: > table v$session contains all the current sessions information and is > under SYS user. My web application should connect as webinfo user that > has read-only access on v$session table, query the data and present it > in webpage. > > Do I write views

Re: Creating initial Security/Auth objects with syncdb

2010-12-22 Thread Nick Serra
Could just put the group in the initial data for sync db. Look up django fixtures. It will load data into the database from a json feed on syncdb. On Dec 21, 1:50 pm, "Mark (Nosrednakram)" wrote: > Hello, > > I would like to install an auth_group with my application and am > considering using the

Re: What's your workflow?

2010-12-22 Thread W. Craig Trader
Dana ... How you build and deploy your project will be shaped by the environment where you're deploying. Thus my choices about "best practices" will be very different that yours. That said, here are my thoughts (worth exactly what they cost you): - You're definitely right about using South

Re: XBAP application

2010-12-22 Thread stegzzz
Thanks for the reply. I did try this already, like this: The html file xdt.html was: XBAP test HTMLx#1 HTMLx#2 and the view file contained: def current_XABP(request): t = get_template('xdt.html') s='C:/Python26/Lib/site-packages/django/myproject/ WpfBrowserApplication1.xbap' html=t.r

Re: What's your workflow?

2010-12-22 Thread Subramanyam
hi Dana On Thu, Dec 23, 2010 at 12:51 AM, Dana wrote: > Subramanyam, thanks for the response. > > In regard to 3, I am not clear why it would be a good idea to add in > model fields for things you *think* you might want some day. > > I would think that using Django South or something similar to

Forms Questions

2010-12-22 Thread hank23
I've been going through a lot of the forms related documentation and some things are still not clear, partly because of information overload. First do I have to code/generate my forms using my models? If not then if I code my form from scratch will it still have all or most of the background functi

Re: Forms Questions

2010-12-22 Thread ringemup
> First do I have to code/generate my forms using my models? No. Model forms are basically a shortcut to the very common use case of creating a form to update or save a single model object. With regular forms, you just have to explicitly declare your form fields instead of counting on the modelf

Accessing Form Field Values / Using Javascript

2010-12-22 Thread hank23
Is it possible to use javascript to capture and react to events and possibly enable/disable screen controls by setting values or flags? How do I access the values or selected option(s) of say a checkbox control, dropdown box so that I can react to them in my views? Is it possible to react to contro

Re: django session InvalidOperation

2010-12-22 Thread Ignacio
Hi kinder. I've got this exact problem with django 1.2.3 and python 2.7. Could you find a fix for it? On 11 dic, 16:18, Leo wrote: > Hard to know from what's shown here, but it seems likely that your > database didn't get created properly on the new server.  The error > suggests that the expire_d

Re: Forms Questions

2010-12-22 Thread Łukasz Rekucki
On 22 December 2010 22:27, hank23 wrote: > I've been going through a lot of the forms related documentation and > some things are still not clear, partly because of information > overload. > First do I have to code/generate my forms using my models? No, forms can be used independently of models.

Where Are Forms Built

2010-12-22 Thread hank23
I've seen how to build my own forms in the documentation and how to import the Django base forms class, but where does the code to build my own screens get put? Is it supposed to be put in the views module for my app or somewhere else? I'm guessing it goes in the views, but that's only my best gues

Re: Where Are Forms Built

2010-12-22 Thread ringemup
> I've seen how to build my own forms in the documentation and how to > import the Django base forms class, but where does the code to build > my own screens get put? Is it supposed to be put in the views module > for my app or somewhere else? I'm guessing it goes in the views, but > that's only m

Re: What's your workflow?

2010-12-22 Thread Cal Leeming [Simplicity Media Ltd]
Apologies if I have repeated what anyone else has said, or if some of these comments aren't directly related, but here's my two cents worth. And remember, rapid development isn't always about the different pieces of software or frameworks that you use, so hopefully some of the below comments g

SSL through WSGI

2010-12-22 Thread Jakob H
Hi, I have a related SSL question using WSGI and Apache. In my .htaccess file I have something like this: RewriteEngine On RewriteBase / RewriteRule ^(adminmedia/.*)$ - [L] RewriteRule ^(django\.fcgi/.*)$ - [L] RewriteCond %{REQUEST_FILENAME} !^/?resources/ RewriteRule ^(.*)$ django.fcgi/$1 [L] S

Re: What's your workflow?

2010-12-22 Thread ringemup
>     * If you want to test work flow, then try and make good use of the >       "manage.py shell" and also the ability to create management >       commands. This will allow you to quickly test code changes, >       without having to do app restarts, or going through login >       processes. Cal

Re: What's your workflow?

2010-12-22 Thread Cal Leeming [Simplicity Media Ltd]
Sure thing. In several previous projects, they required the user to upload a file via the browser (usually above 10mb), and this was then sent off into the queuing system to be processed. Now, because of the huge amounts of time it took to upload, we instead created a management command, which

Re: What's your workflow?

2010-12-22 Thread ringemup
Thanks, Cal -- that's extremely helpful. On Dec 22, 5:42 pm, "Cal Leeming [Simplicity Media Ltd]" wrote: > Sure thing. > > In several previous projects, they required the user to upload a file > via the browser (usually above 10mb), and this was then sent off into > the queuing system to be proc

Django RSS feed consolidator?

2010-12-22 Thread Christophe Pettus
Is there a feed consolidator for Django-related RSS feeds? One exists for the PostgreSQL project, and it's pretty nice to keep track of what PG-related stuff is being written by various bloggers. If not, is there interest in such a thing? -- -- Christophe Pettus x...@thebuild.com -- You

Re: Django RSS feed consolidator?

2010-12-22 Thread Christophe Pettus
Like, say, the one at: http://www.djangoproject.com/community/ You know, something like that? Never mind! On Dec 22, 2010, at 3:04 PM, Christophe Pettus wrote: > Is there a feed consolidator for Django-related RSS feeds? One exists for > the PostgreSQL project, and it's pretty nice t

Modifying default permissions given to a model

2010-12-22 Thread Burhan
Hello All: I am creating a model that should only be 'read-only' in the admin. That is, the only way to add new records in the database for this model is through the code, not manually. However, I would like the admin user to be able to view entries in this model. An example of such a model would

Re: fcgi, runfastcgi, parameters, docs [noob question]

2010-12-22 Thread Karen Tracey
On Wed, Dec 22, 2010 at 8:52 AM, Richard Brosnahan wrote: > The .fcgi script runs until I get to the line where I try to execute > runfastcgi. > > from django.core.servers.fastcgi import runfastcgi > runfastcgi(method="threaded", daemonize="false") > > [snip] > > I get an error saying "method" is

django/contrib/auth/models.py goes nuts

2010-12-22 Thread John Fabiani
Hi, I had a working website for about the last 2 weeks. I was using a test database (Postgres). I am also using SVN for my code and have tried to revert back many versions and I still get these new errors. The error first appeared as datetime has no Attribute 'None' for a line in my views.py

Re: django/contrib/auth/models.py goes nuts

2010-12-22 Thread John Fabiani
On Wednesday, December 22, 2010 06:44:47 pm John Fabiani wrote: > Hi, > I had a working website for about the last 2 weeks. I was using a test > database (Postgres). I am also using SVN for my code and have tried to > revert back many versions and I still get these new errors. > > The error firs

get id to be used in a foreign key with two model forms

2010-12-22 Thread Michael Thamm
Hi, I am using 2 model forms and when I save the I get a save error since the foreign key field can't be blank. I try to add the new id at save, but it doesn't work. This is the code for the save. temp=shirtForm.save(commit=False) userForm.shirt=temp.id userForm.save() Is

Subdomain/Accounts

2010-12-22 Thread Parra
Hello, I'm new to Django and thinking of using it for a project. In this project, there will be accounts and each account will have a subdomain. Based on the subdomain/account, the user will just see the records that belongs to them. The tables will be unique for all accounts, so there should be

[ANN] Security releases and Django 1.3 beta 1

2010-12-22 Thread James Bennett
Tonight we've released Django 1.3 beta 1, as well as Django 1.2.4 and Django 1.1.3 to correct a pair of security issues. * Beta announcement: http://www.djangoproject.com/weblog/2010/dec/22/13-beta-1/ * Security announcement: http://www.djangoproject.com/weblog/2010/dec/22/security/ All affected

Project management / bugtracking app?

2010-12-22 Thread Dopster
Hi any recommendations for a Django project management and bugtracking application? Also, Git(hub) integration would be a nice-to-have. I looked at Redmine but its a Ruby app and I'd rather not venture there. How about Trac? -- You received this message because you are subscribed to the Goog

Re: django/contrib/auth/models.py goes nuts

2010-12-22 Thread John Fabiani
On Wednesday, December 22, 2010 07:18:15 pm John Fabiani wrote: > On Wednesday, December 22, 2010 06:44:47 pm John Fabiani wrote: > > Hi, > > I had a working website for about the last 2 weeks. I was using a test > > database (Postgres). I am also using SVN for my code and have tried to > > rever

Re: fcgi, runfastcgi, parameters, docs [noob question]

2010-12-22 Thread Shamail Tayyab
You may want to try running your fastcgi daemon via command line, This is the exact command that I am using at production: python manage.py runfcgi daemonize=false method=threaded host=127.0.0.1 port=9001 Tx -- Shamail Tayyab Blog: http://shamail.in/blog On Dec 22, 6:52 pm, Richard Brosnahan w

default django admin theme

2010-12-22 Thread Jos? Moreira
Hello, are there any plans to improve the default Django admin theme? I'm aware of projects like Grapelli, that the admin is intended to be customized by the developers and that the default theme is nice, clean and usable but the default theme could be improved a lot, from my perspective. I star