Re: Cannot assign None, does not allow null values

2009-11-28 Thread onoxo
Hi! when i go to create Actual class. i get this error: Cannot assign None: "Actual.published" does not allow null values. and it makes this error with each class that has published propertie. On Nov 28, 3:32 am, Tim Valenta wrote: > You've got a lot of models in

Re: Cannot assign None, does not allow null values

2009-11-28 Thread Martin Lundberg
Is it not that you forget to give the published property a value? On Sat, Nov 28, 2009 at 9:07 AM, onoxo wrote: > Hi! > > when i go to create Actual class. i get this error: > Cannot assign None: "Actual.published" does not allow null values. > > and it makes this error

filter_horizontal not working properly

2009-11-28 Thread hugis
Hi, I'm using django 1.0.2 (from debian lenny). I have this in model.py: from django.contrib.auth.models import User class Tc_server: tc_url = models.CharField(max_length=200) ... class Vrstva(Vrstvy_zaklad): ... tc_server = models.ManyToManyField(Tc_server, blank=True)

Many-to-many through multiple tables

2009-11-28 Thread Jonathan
This may be more of a general database design question, but I want to come up with something that works with Django's ORM. I have four bits of information that I want to link together. Generic packages, package versions, groups of packages and a profile that brings them together. The final goal

Re: CSRF gone haywire

2009-11-28 Thread rebus_
2009/11/27 Tim Valenta : > Also, I've figured out just now while rereading the reply I got, that > "AFAIK" must mean "as far as I know".  Please... can we not use > ridiculous short forms for a language that works better when not > profusely abbreviated?  That would

Re: Per-object permissions

2009-11-28 Thread Christian Schilling
http://github.com/initcrash/django-object-permissions/ implements this on 1.1 (it's not hard at all, so i don't really understand the change planed for 1.2) there are no docs yet, but the testproject shows how to use it: just use ObjectPermissionAdmin as base for the admin classes instead of

Re: Many-to-many through multiple tables

2009-11-28 Thread t0ster
Could you post your models.py code here? On Nov 28, 1:10 pm, Jonathan wrote: > This may be more of a general database design question, but I want to > come up with something that works with Django's ORM. > > I have four bits of information that I want to link together.

Apache unicode problem!why it is OK in "manage.py runserver 8000" ? but it is not OK when "apach + mod_python" !

2009-11-28 Thread hao he
hi all: I write a tag "model_as_table_with", used like this in template : {{model_instance | *model_as_table_with*:"real_name,gender,birthdate,}} problem was raise in my "*model_as_table_with*" function. this following code is ok when I runserver with "manage.py runserver 8000" *col =

Re: Handling IntegrityError on transaction middleware commit

2009-11-28 Thread Karen Tracey
On Fri, Nov 27, 2009 at 6:35 AM, Ryan wrote: > I realize that I should be validating my data before saving it, but > I'll admit I don't guard against every eventuality. My question is, > should I be doing something in my code to prevent this kind of poor > exception handling,

Re: Many-to-many through multiple tables

2009-11-28 Thread Jonathan
Hi, I've slimmed it down to the relevant fields. I'm a bit of a noob, but I think I'm basically trying to build a generic framework that can be made specific in a profile. Profile = BusinessVersion + Group + LifecycleStage + Package.Versions Jonathan class Product(models.Model): name =

Re: Installation Problem on Mac OS Leopard

2009-11-28 Thread Sandman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 If the problem is with extracting the files from the tar.gz, you might want to make sure that you are using the command tar -xvzf ... and not tar xvzf (Note the hyphen '-') before the xvzf. These are options passed to the tar command. I hope this

Re: Many-to-many through multiple tables

2009-11-28 Thread t0ster
May be Group should include packages of specific versions: class Group(models.Model): name = models.CharField(max_length=100) product = models.ForeignKey(Product) -packages = models.ManyToManyField(Package) +packages = models.ManyToManyField(PackageVersion) class

Stuck with simple query

2009-11-28 Thread Benjamin Wolf
Hi, I'm trying to create a query like this with django: SELECT count(*) As total FROM `disposal` group by(salesman_id) This gives me the number of total sales for every salesman. In django I tried this: data = Disposal.objects.annotate(total=Count('salesman')) print str(x[0].total) But total is

Re: is_valid error/bug when unique_together fields are both ForeignKey fields

2009-11-28 Thread cerberos
The problem ("Foo bar with this None and None already exists.") only happens when I use a ModelForm and choose to specify the field details myself. Here is an example Models class Foo(models.Model): f = models.IntegerField(unique=True) def __unicode__(self): return 'Foo with f =

Re: Stuck with simple query

2009-11-28 Thread Steve Howell
On Nov 28, 8:36 am, Benjamin Wolf wrote: > Hi, > > I'm trying to create a query like this with django: > SELECT count(*) As total FROM `disposal` group by(salesman_id) > > This gives me the number of total sales for every salesman. > In django I tried this: > data =

working djangobook ch.7 cant get urls.py running books and contact at same time

2009-11-28 Thread John Blake Arnold
Hi, My name is John and I'm running Django1.1.1 on XAMPP for Windows with Apache 2.2.12, Python 2.5.2,mod_python3.3.1,using the default sqlite3 database for the examples. I am working through the Apress The Definitve Guide To Django Web Development Done Right 2nd Edition between pg. 129 and the

solution found to ch. 7 in ch. 8

2009-11-28 Thread John Blake Arnold
I needed single quotes about pathway in urls.py like so, Thanks: from django.conf.urls.defaults import * from mysite import views from mysite.views import hello, current_datetime, hours_ahead from mysite.books import views from mysite.contact import views #, my_homepage_view # Uncomment the

Re: Stuck with simple query

2009-11-28 Thread Benjamin Wolf
Hi Steve, thx for the hint with de debug toolbar, very nice. It's working now, greets ben Steve Howell schrieb: > On Nov 28, 8:36 am, Benjamin Wolf wrote: > >> Hi, >> >> I'm trying to create a query like this with django: >> SELECT count(*) As total FROM `disposal` group

newbee issues with 'python manage.py adminindex myApp'

2009-11-28 Thread dogfuel
I believe I'm missing the obvious ... on 1.1.1, I am trying to use the adminindex command with manage.py ... I see the below" # python manage.py adminindex myApp Unknown command: 'adminindex' Type 'manage.py help' for usage. My INSTALLED_APPS does include 'django.contrib.admin'. Thanks in

Re: newbee issues with 'python manage.py adminindex myApp'

2009-11-28 Thread Karen Tracey
On Sat, Nov 28, 2009 at 1:59 PM, dogfuel wrote: > I believe I'm missing the obvious ... on 1.1.1, I am trying to use the > adminindex command with manage.py ... I see the below" > > # python manage.py adminindex myApp > Unknown command: 'adminindex' > Type 'manage.py

Re: newbee issues with 'python manage.py adminindex myApp'

2009-11-28 Thread dogfuel
Thanks ... bear with me as I'm new to this and not the brightest bulb ... I used 'python manage.py adminindex myApp' last week on .96 with what I thought was nothing other than the base installed (from the Debian repository). I moved to 1.1.1 and it doesn't work and as you point out, it is not

CSRF Flatpages

2009-11-28 Thread John Leith
I have a problem with the CSRF framework, and i'm just checking here to see if anyone else ran into this problem and hopefully found a solution. Here is my problem: I have a login form on the base template of my site. The home page is just a flatpage. My login processor is csrf protected. I have

ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-28 Thread Gloria
Hi all, I've spent way too much time getting trying to get this widget to work the way I am envisioning. In the forms, I want to initialize it, but in the view I need to determine which boxes are checked. Has anyone done this without writing their own widget? It would be great to know how. Thank

View returns no queryset

2009-11-28 Thread R. Gorman
I've got a real stumper. Well, a stumper for me; I'm hoping someone has some insight. Here's the view I'm calling: def season_schedule_month(request, league_slug, year, month): """Given a league slug, retrieve the season's schedule month by month. return date_based.archive_month(

IDLE (Python GUI)

2009-11-28 Thread Mikey3D
Windows 7: My project is in: C:\Python26\Lib\site-packages\mysite I'm working on this section: Playing with the API http://docs.djangoproject.com/en/dev/intro/tutorial01/#playing-with-the-api When I do (Windows+R >cmd >OK) to do python shell (python manage.py shell) it works. But I have try

Re: IDLE (Python GUI)

2009-11-28 Thread Nick Arnett
On Sat, Nov 28, 2009 at 3:21 PM, Mikey3D wrote: > Windows 7: > > My project is in: C:\Python26\Lib\site-packages\mysite > > I'm working on this section: Playing with the API > http://docs.djangoproject.com/en/dev/intro/tutorial01/#playing-with-the-api > > When I do

admin: uploading files problem

2009-11-28 Thread Heronman
Hello, all I'm a newbie in django, and I have a problem with uploading files in django admin after submitting a form with FileField or ImageField, if a file is bigger than ~100KB, my browser tell me "sending a request..." and then nothing happens. and nothing happens on the server side

Re: IDLE (Python GUI)

2009-11-28 Thread Mikey3D
The first task I get an error: Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. Personal firewall software may warn about

Re: Many-to-many through multiple tables

2009-11-28 Thread Jonathan
The BusinessVersion isn't relevant, I posted the whole model to put it in context. It's a web app to track software through the software development lifecycle. Regardless of the lifecyle stage (development, test, production), all instances of an application consist of the same Group of packages

newbie: unable to open database file

2009-11-28 Thread ccl4r
I'm tryin out the tutorial and am very new to this...I have my settings.py as: DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'C:\Users\Student\Desktop\mysite' and when I run the command: python manage.py syncdb I

Re: newbie: unable to open database file

2009-11-28 Thread Karen Tracey
On Sat, Nov 28, 2009 at 10:46 PM, ccl4r wrote: > I'm tryin out the tutorial and am very new to this...I have my > settings.py as: > > DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', > 'postgresql', 'mysql', 'sqlite3' or 'oracle'. > DATABASE_NAME =

How to list all parents and their children if any?

2009-11-28 Thread adelaide_mike
I have three models: class Connector(models.Model): connectorname = models.CharField(max_length=32) class Cable(models.Model): cablename = models.CharField(max_length=32) class Node(models.Model): connector = models.ForeignKey(Connector) cable = models.ForeignKey(Cable)

Re: How to list all parents and their children if any?

2009-11-28 Thread Karen Tracey
On Sat, Nov 28, 2009 at 11:50 PM, adelaide_mike wrote: > I have three models: > > class Connector(models.Model): >connectorname = models.CharField(max_length=32) > > class Cable(models.Model): >cablename = models.CharField(max_length=32) > > class

streaming response, missing something simple

2009-11-28 Thread Preston Holmes
My expectation was that it was possible to 'stream' a response back to a browser from a view, where that response is 'trickled' onto the browser page. I had done this a while back in cherrypy and it worked as expected. a super simple view demonstrates the issue. Instead of a series of numbers