Re: Problem importing model after inspectdb

2010-09-23 Thread Karen Tracey
On Thu, Sep 23, 2010 at 8:33 PM, Ivan wrote: > Hi all, > I'm trying to build a Django project by working through the handbook > but I'm having some problems accessing the database by referencing the > model I've created from it (by inspectdb). When attemping to do some >

Re: TypeError upon page load

2010-09-23 Thread Karen Tracey
On Thu, Sep 23, 2010 at 10:09 PM, Katrina wrote: > I am currently in the process of syncing my local copy of a Django app/ > project (the website is structured as one giant app plugged into a > single project) with a development version that has undergone >

Problem with reversing url in test

2010-09-23 Thread Brandon Taylor
Hi everyone, I'm having a problem with reversing a URL in a unit test: class ProductTestCase(TestCase): def setUp(self): self.client = Client def test_project_permalink(self): project = Project.approved.all()[0] url = project.get_absolute_url() I'm using an

subclassing UserCreationForm

2010-09-23 Thread Axel Bock
Hello all, I must admit - I am going crazy. With something I thought should be incredibly simple, but maybe I am just too f**king stupid. All right, here comes my problem. I have subclassed "User" as "Student" and added some required fields, one of them being "Course": # models.py class

Re: Recommend a book

2010-09-23 Thread Ivan
Personally, I like hand on. "Practical Django Projects" is recommended. http://apress.com/book/view/9781590599969 On Fri, Sep 24, 2010 at 12:38 PM, Tim Johnson wrote: > Thank you - >  Shawn Milochik and Tran Cao Thai. :) thus far. >  I'll check back in the morning. >  

Re: Newbie: Operational Error 1060 Duplicate column name

2010-09-23 Thread Howard Wolf
I want the foreign key to be called taxonomy_kingdom. So would I do something like this? taxonomy_kingdom = models.ForeignKey(TaxonomyKingdom, null=True, blank=True) superior=taxonomy_kingdom On Thu, Sep 23, 2010 at 10:18 PM, Karen Tracey wrote: > On Thu, Sep 23, 2010 at

Re: Newbie: Operational Error 1060 Duplicate column name

2010-09-23 Thread Karen Tracey
On Thu, Sep 23, 2010 at 1:03 PM, Howard Wolf wrote: > class TaxonomyPhylum(models.Model): >name = models.CharField(max_length=100, unique=True) >superior=taxonomy_kingdom = models.ForeignKey(TaxonomyKingdom, > null=True, blank=True) > Do you want that ForeignKey field

Re: Recommend a book

2010-09-23 Thread Tim Johnson
Thank you - Shawn Milochik and Tran Cao Thai. :) thus far. I'll check back in the morning. cheers -- Tim tim at johnsons-web.com or akwebsoft.com http://www.akwebsoft.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Recommend a book

2010-09-23 Thread Steven Elliott Jr
I have found beginning django e-commere as practical django projects to be great. Both from apress. I prefer to use books that go through building real world solutions. The definitive guide to django is a must read though. On Sep 23, 2010, at 9:57 PM, Tim Johnson wrote:

Problem importing model after inspectdb

2010-09-23 Thread Ivan
Hi all, I'm trying to build a Django project by working through the handbook but I'm having some problems accessing the database by referencing the model I've created from it (by inspectdb). When attemping to do some "Basic Data Access" (Chapter 5) I can't import the models I've made (from [app

TypeError upon page load

2010-09-23 Thread Katrina
I am currently in the process of syncing my local copy of a Django app/ project (the website is structured as one giant app plugged into a single project) with a development version that has undergone significant changes since I last worked on it in summer 2009. When I attempt to view my copy of

Re: Recommend a book

2010-09-23 Thread Shawn Milochik
I recommend "The Definitive Guide to Django," without reservation. See my review for more details: http://www.amazon.com/review/R2ET5WRO205C9I/ref=cm_cr_rdp_perm Ignore anyone who says it's outdated. Some people are thrown into fits of despair when a book's cover has a title that's 0.1 less

Re: Recommend a book

2010-09-23 Thread Tran Cao Thai
Learning Website Development with Django: A be (ginner's tutorial to building web applications, quickly and cleanly, with the Django application framework ( *ISBN-13:* 978-1847193353) The only one django book that i like. Give the reader a comprehensive look for django framework (though it is

Call for proposals -- PyCon 2011

2010-09-23 Thread Jacob Kaplan-Moss
Call for proposals -- PyCon 2011 -- === Proposal Due date: November 1st, 2010 PyCon is back! With a rocking new website, a great location and more Python hackers and luminaries under one roof than you could

Recommend a book

2010-09-23 Thread Tim Johnson
FYI: I'm an experienced python programmer, experienced web programmer, work mostly on linux platforms. And I like to start slow and get it down thoroughly. I'm soliciting recommendations for books on learning django. E-book or paper. Paper is preferred. I would prefer to avoid anything geared

Re: Image Upload question

2010-09-23 Thread Joel Klabo
The problem was no PIL and libjpeg... On Sep 23, 2:43 pm, Joel Klabo wrote: > from the django docs: > > inherits all attributes and methods from FileField, but also validates > that the uploaded object is a VALID IMAGE. > > what does valid image mean? > > On Sep 23, 2:40 pm,

Re: Can I run tests without installing indexes?

2010-09-23 Thread Russell Keith-Magee
On Fri, Sep 24, 2010 at 4:51 AM, Peter Bengtsson wrote: > When not using SQLite for running my tests it takes a aweful long time > to install all the indexes. > Considering that indexes are there for speeding up selects when the > number of rows is very high I realise I don't

Re: Why Django Apps Suck

2010-09-23 Thread Russell Keith-Magee
On Fri, Sep 24, 2010 at 1:41 AM, Yo-Yo Ma wrote: > Hey Russell, > > Do you think a round table discussion in a real person context with > whiteboards and the best of the bunch (ie, at Django con or similar > event) would be a good time/place to re architecture of the >

Re: Image Upload question

2010-09-23 Thread Joel Klabo
from the django docs: inherits all attributes and methods from FileField, but also validates that the uploaded object is a VALID IMAGE. what does valid image mean? On Sep 23, 2:40 pm, Joel Klabo wrote: > Thanks, upload is now working. But, only for smallish .png files,

Re: Image Upload question

2010-09-23 Thread Joel Klabo
Thanks, upload is now working. But, only for smallish .png files, what are the constraints on file type and size django sets? I can't find the information anywhere? Beyond that, can I set them myself? On Sep 23, 1:41 pm, Peter Bengtsson wrote: > By being bound it means that

Re: reverse ForeignKey

2010-09-23 Thread Vali Lungu
Hi, You may be interested in this: http://stackoverflow.com/questions/2618893/how-to-filter-queryset-in-changelist-view-in-django-admin, looks like a similar (solved) problem. In short, it's about overriding the queryset() method of ModelAdmin. On Thu, Sep 23, 2010 at 11:33 AM, ionut cristian

encrypted model field

2010-09-23 Thread adrian
I want this field to be saved encrypted in the db, but appear unencrypted everywhere else.My question is which combination of field methods should I use? I have gotten parts of this working with various combinations of the methods below, but can't get it all to work. Using one method makes

Can I run tests without installing indexes?

2010-09-23 Thread Peter Bengtsson
When not using SQLite for running my tests it takes a aweful long time to install all the indexes. Considering that indexes are there for speeding up selects when the number of rows is very high I realise I don't need them during a test run. Is there a way to disable index creation during the

encrypted model field

2010-09-23 Thread adrian
I want this field to be saved encrypted in the db, but appear unencrypted everywhere else: class EncryptedCharField(models.CharField): __metaclass__ = models.SubfieldBase def save_form_data(self, instance, data): setattr(instance, self.name, encrypt(data)) #def

Re: Image Upload question

2010-09-23 Thread Peter Bengtsson
By being bound it means that you will have run the .is_valid() method of the form instance once you've instanciated it with your POST and FILES data. E.g. form = BrewImageFrom(data=request.POST, files=request.FILES) if form.is_valid(): brewimage = form.save() On Sep 23, 3:00 pm, Joel Klabo

Apache crashes on the latest trunk

2010-09-23 Thread Ramdas S
We run a dedicated server with several django sites with low volume, but critical user traffic. Since upgrading to the latest trunk 1.2.3 we have started noticing that apache hangs very often. Curiously it does not throw up any error in the apache.log. Apache does not crash, but simply stops

Image Upload question

2010-09-23 Thread Joel Klabo
I have a form trying to upload an image. In the docs it says that the form must be bound to save a file. This is an issue for me because I wan't to save the file with other data such as the User object that saved it. I can't put a User object in a form so I put the username in a hidden form field

django-registration vs django-account + django-url | opinions?

2010-09-23 Thread justin jools
I have tried out django-registration and liked the simplicity of it, but following the pinax project, (and using their apps to instruct my own build) I see they use: django-account which also requires django-url I have started just started playing with it and was wondering if anyone has any

Re: Django Accounts - User account 'component'

2010-09-23 Thread piz...@gmail.com
El 23/09/2010, a las 18:04, Guiga escribió: Hi guys, I'd like to know if django have a "component" (or some like this) to create, edit and login user's accounts. I mean, some like a system user accounts to work with django. Django has a built-in module called "auth" for managing users

Re: How to avoid nested references

2010-09-23 Thread Marc Aymerich
On Thu, Sep 23, 2010 at 7:37 PM, Daniel Roseman wrote: > On Sep 23, 6:26 pm, Marc Aymerich wrote: > > Hi > > I'm trying to define two clases, one of them is a relational class > between > > services and users, so it has two foreign keys, one to

Re: Why Django Apps Suck

2010-09-23 Thread Yo-Yo Ma
Hey Russell, Do you think a round table discussion in a real person context with whiteboards and the best of the bunch (ie, at Django con or similar event) would be a good time/place to re architecture of the abstraction layers, perhaps to address some of the concerns brought up in the slide show

Re: How to avoid nested references

2010-09-23 Thread Daniel Roseman
On Sep 23, 6:26 pm, Marc Aymerich wrote: > Hi > I'm trying to define two clases, one of them is a relational class between > services and users, so it has two foreign keys, one to services and another > to the user. On the other hand every service must have at least a default

Django Accounts - User account 'component'

2010-09-23 Thread Guiga
Hi guys, I'd like to know if django have a "component" (or some like this) to create, edit and login user's accounts. I mean, some like a system user accounts to work with django. Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

How to avoid nested references

2010-09-23 Thread Marc Aymerich
Hi I'm trying to define two clases, one of them is a relational class between services and users, so it has two foreign keys, one to services and another to the user. On the other hand every service must have at least a default tariff, so it has a "pointer" to it. However, I'm not sure how to

Re: Newbie: Operational Error 1060 Duplicate column name

2010-09-23 Thread Howard Wolf
I deleted the database and installed a new one with no tables at all. Using regular Python I ran the script manage.py with subcommand syncdb. It created the first 4 tables then hit an error. Here is the traceback for the error. Traceback (most recent call last): File "manage.py", line 32, in

Re: Newbie: Operational Error 1060 Duplicate column name

2010-09-23 Thread Howard Wolf
I delete the database and installed a new one with no tables at all. Using regular Python I ran the script manage.py with subcommand syncdb It created the first 4 tables then hit an error. Here is the traceback for the error. Traceback (most recent call last): File "manage.py", line 32, in

Re: Newbie: Operational Error 1060 Duplicate column name

2010-09-23 Thread Howard Wolf
It was a IPython internal 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+unsubscr...@googlegroups.com. For

Re: Help with file upload using ModelForm

2010-09-23 Thread Federico Capoano
Sorry ignore this. Changed from: form = PdfForm( initial ={ 'name': pdf.name, 'description': pdf.description, 'file': pdf.file, } ) to: form = PdfForm(instance = pdf) and it works fine. On 23 Set, 17:43, Federico

Help with file upload using ModelForm

2010-09-23 Thread Federico Capoano
Hello to all, maybe is something really silly, but I don't get it. I'm using ModelForm to edit a database object that has a file input. The tag has enctype="multipart/form-data" and the view uses request.FILES. I can add and edit files without problems, but there is a case in which editing a

Re: Relationship between multiple sites & projects, apps

2010-09-23 Thread Brian Bouterse
We've got 4 domain names which all comprise a single website. We went with the second option where each domain is its own django project with a single app in it. We liked this option for two reasons. 1) We wanted apache virtual hosts to be handling the decision about which entry point to use

InterfaceError at /admin/ Error binding parameter 1 - probably unsupported type.

2010-09-23 Thread justin jools
Have searched everywhere for solution to this error (below) when loggin in to admin I also get this error during form post rediect, thinking it it something to do with intalled apps/middleware or post setting maybe but dont know what. Anyone come across this? Many Thanks InterfaceError at

Custom Exception question

2010-09-23 Thread Mike Pelley
Hello folks, I'm somewhat new to python and very new to Django. I'm trying to do things "the right way" and I've encountered a problem. At this point early in my project, all of my work has been to customize the admin interface. For one of the databases, there is an admin option to retrieve a

Re: Include form in template tag

2010-09-23 Thread Anton Danilchenko
In my case this work well: from ..forms import MessageSearchForm Maybe we have other solution for this? On 23 сен, 16:46, Anton Danilchenko wrote: > Hi! > > I have created templatetag (used Django 1.2.3) in templatetags/ > board.py file. I need import form class

Include form in template tag

2010-09-23 Thread Anton Danilchenko
Hi! I have created templatetag (used Django 1.2.3) in templatetags/ board.py file. I need import form class from application. Structure of project is: + board/ +++ views.py +++ forms.py +++ templatetags/ + board.py + ... some other project applications ... How can I do import of form from

Re: What's the best way to develop an app that is similar the django admin?

2010-09-23 Thread Federico Capoano
Thanks for the answers guy, I knew a little bit model forms, but I'll check out also the other solution. On 22 Set, 09:29, Matthias Kestenholz wrote: > On Mon, Sep 20, 2010 at 3:13 PM, Federico Capoano > > wrote: > > Hi all, > > > I try

Re: Why Django Apps Suck

2010-09-23 Thread Russell Keith-Magee
On Thu, Sep 23, 2010 at 5:55 PM, Klaas van Schelven wrote: > On Sep 23, 2:01 am, Russell Keith-Magee > wrote: > > So, we run into a few problems: > * How do we extend the models from the original extendible > application? > For this to work,

Re: Please add tag for Django 1.2.3 release

2010-09-23 Thread James Bennett
On Thu, Sep 23, 2010 at 5:42 AM, Tom Evans wrote: > svn is the 'official' vcs, and is used to manage the development (and > one would hope) the release engineering, but I doubt very much that it > is the 'official distribution mechanism'; I would have thought that >

Re: Newbie: Operational Error 1060 Duplicate column name

2010-09-23 Thread Karen Tracey
On Wed, Sep 22, 2010 at 11:18 PM, Howard Wolf wrote: > I'm fairly new to django and I'm trying to restart an old database. > > When I run the command run manage.py syncdb > > I get the following error: > > >run manage.py syncdb > Creating table slide_taxonomyphylum > ERROR: An

Newbie: Operational Error 1060 Duplicate column name

2010-09-23 Thread Howard Wolf
I'm fairly new to django and I'm trying to restart an old database. When I run the command run manage.py syncdb I get the following error: >run manage.py syncdb Creating table slide_taxonomyphylum ERROR: An unexpected error occured while tokenizing input The following traceback may be be

Re: Please add tag for Django 1.2.3 release

2010-09-23 Thread Tom Evans
On Mon, Sep 13, 2010 at 4:19 PM, shacker wrote: > On Sep 12, 12:12 pm, creecode wrote: >> Hello all, >> >> I asked and we >> received! :-)  Thanks Russell! > > Hmm, the ticket is marked fixed, but the

Re: Why Django Apps Suck

2010-09-23 Thread Klaas van Schelven
On Sep 23, 2:01 am, Russell Keith-Magee wrote: > On Wed, Sep 22, 2010 at 11:31 PM, Klaas van Schelven > > wrote: > >> I'm yet to see a genuine case of (a) -- every time I've seen (a), it's > >> really masked version of (b), (c) or (d). > > > I

Re: Problem with ForeignKey()

2010-09-23 Thread Tom Evans
First thought is "You haven't provided anywhere near enough context". Second thought is "That is how it works, so you're doing something else wrong. See #1". class PropertyValue(BaseModel): value = models.CharField(max_length=256) prop = models.ForeignKey('Property') parent =

reverse ForeignKey

2010-09-23 Thread ionut cristian cucu
Hi list, I just came to django, and to web programming for that matter, so my question is from a n0b: I have to models: class Pacient(models.Model): name=models.CharField('name', max_length=123) class Exit(models.Model): pacient=models.ForeignKey(Pacient) How to I get the admin

Relationship between multiple sites & projects, apps

2010-09-23 Thread Benedict Verheyen
Hi, it's not exactly clear to me how the sites, projects and apps need to be structured. For instance, if you have 2 sites both with a domain name, how would you structure this in Django? The Django project could be called "mysites" or whatever name. In the admin site, you would then have 2

Re: simple relationship difficult?

2010-09-23 Thread jayfee
well, never mind the rambling at the end because i *think* this inheritance thing may be a very good lead. thanks for the tip! On Sep 22, 5:18 pm, Karen Tracey wrote: > On Wed, Sep 22, 2010 at 7:11 AM, jayfee wrote: > > hello, so i've been running into

Re: Signals problem

2010-09-23 Thread Joel Klabo
Thanks for the help, all working now! On Sep 22, 11:52 pm, Russell Keith-Magee wrote: > On Thu, Sep 23, 2010 at 2:41 PM, Joel Klabo wrote: > > I keep getting this import error and I can't figure out why? Any ideas > > would be greatly

Re: Signals problem

2010-09-23 Thread Russell Keith-Magee
On Thu, Sep 23, 2010 at 2:41 PM, Joel Klabo wrote: > I keep getting this import error and I can't figure out why? Any ideas > would be greatly appreciated: http://dpaste.org/BgtI/ It's a circular import problem. signals.py imports objects from models.py, and models.py

Re: Signals problem

2010-09-23 Thread Joel Klabo
Update: http://dpaste.org/kK5p/ On Sep 22, 11:41 pm, Joel Klabo wrote: > I keep getting this import error and I can't figure out why? Any ideas > would be greatly appreciated:http://dpaste.org/BgtI/ -- You received this message because you are subscribed to the Google

Signals problem

2010-09-23 Thread Joel Klabo
I keep getting this import error and I can't figure out why? Any ideas would be greatly appreciated: http://dpaste.org/BgtI/ -- 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

Re: How to use custom classes in django

2010-09-23 Thread Sam Lai
After revising python basics, here's how I'd structure it - On 22 September 2010 18:10, jake2891 wrote: > Hey guys, i am using extjs in django and am wondering the correct way > to build custom classes like file upload classes and classes of > functions. I'm assuming by