Problem loading integer data into database using fixture

2012-02-16 Thread Gchorn
Hello All, I'm attempting to provide initial data for my database using a fixture file (like this: https://docs.djangoproject.com/en/1.3/howto/initial-data/#providing-initial-data-with-fixtures), but I'm running into the following error: Problem installing fixture '/home/guillaume/NBA/players/fi

Re: Problem loading integer data into database using fixture

2012-02-16 Thread Gchorn
, but if you are in a place where you don't > have to quote: > >    Arron > > then I'd expect everything to be strings. > > Is there a yaml.dump that you can apply to a model with strings and > integers to see how it thinks they are distinguished? > > On 2

Re: Problem loading integer data into database using fixture

2012-02-16 Thread Gchorn
*nix user are (typically) unrelated.  The > database user is specified in settings.py and there is also a password > if necessary.  Since one usually communicates with database servers > using network connections (even on the same box), it doesn't really > know what user a

Re: Problem loading integer data into database using fixture

2012-02-17 Thread Gchorn
Feb 17, 2:18 pm, Gchorn wrote: > Unfortunately, that doesn't seem to be the case.  I have the database > user and password in my settings.py file, but I still have to do a > "sudo su postgres" to switch to postgres in the terminal before I can > access my PostgreSQL

Returning values from calculations done by custom methods in models

2012-02-18 Thread Gchorn
Hello All, So in my models.py file, I have: class Player(models.Model): team = models.ForeignKey(Team) first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) gp = models.IntegerField(max_length=2) #games played mp = model

Re: Returning values from calculations done by custom methods in models

2012-02-18 Thread Gchorn
Feb 19, 9:47 am, akaariai wrote: > On Feb 19, 3:38 am, Gchorn wrote: > > > > > > > > > > > Hello All, > > > So in my models.py file, I have: > > > class Player(models.Model): > >         team = models.ForeignKey(Team) >

Query Set to search for a combination of model fields?

2012-03-15 Thread Gchorn
Hello All, As a learning project, I am currently putting together a site to track all of the teams and players in the NBA along with their basic statistics and information. My two models so far are, as you might expect, players and teams. For the player model, I have separate database fields for

How to change widgets for admin site?

2012-04-15 Thread Gchorn
Hello, I'm trying to create a blog site using Django (with "Post" as my main model and "text" as the attribute corresponding to the main body of text for each post). On the admin page, when someone is filling out fields to create a new blog post, I want the "text" entry field to be larger than the

Can't access database with normal Ubuntu Terminal user

2012-04-16 Thread Gchorn
I'm not totally sure if this qualifies as a Django question, but it's impeding my ability to make a website with Django so I thought I'd ask here. I'm working with Django in Ubuntu 11.10, where I've set up PostgreSQL to make and manage databases for my Django-powered website. Unfortunately, w

Dojo Rich Editor Implementation in Admin.py

2012-04-30 Thread Gchorn
Hi All, I'm building a blog, with models "Post" and "Image" (each blog post can have multiple images; they're related by ForeignKey) and I'm trying to implement the Dojo rich editor in my admin site by following the example here: https://gist.github.com/868595 However, the rich editor is not

Re: Dojo Rich Editor Implementation in Admin.py

2012-05-02 Thread Gchorn
I must be going about registering my ModelAdmin and the rich editor incorrectly, but I can't seem to find any documentation online about "admin.site.register" and "site.register," so I'm totally stuck. Any help on this would be much appreciated! cheers, Gu

Django Comment Moderation: Anything wrong with using "moderate_after = 0"?

2012-05-08 Thread Gchorn
I'm building a simple blog with class "Post" as follows: class Post(models.Model): title = models.CharField(max_length=1000) author = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') text = models.TextField(max_length=1) I'm trying to implemen

Multiple elements with one element?

2012-09-06 Thread Gchorn
Hi All, I'm trying to create a form on a web page where the user can select choices from multiple drop-down lists ( HTML elements) and then submit them all at once with a single submit button. Is this possible? I don't want to use a single element with the "multiple" attribute because the li

Strange new error

2011-11-16 Thread Gchorn
Hi All, So I haven't used Django in a while (like three months), and when I tried firing up a project in dev from Terminal (in OSX) today using the "python manage.py runserver" command, I got the following Traceback: File "manage.py", line 14, in execute_manager(settings) File "/Library/

Re: Strange new error

2011-11-16 Thread Gchorn
tied that folder from the interpreter is there? thanks, Guillaume On Nov 16, 11:32 pm, Tom Evans wrote: > On Wed, Nov 16, 2011 at 3:01 PM, Gchorn wrote: > > Hi All, > > > So I haven't used Django in a while (like three months), and when I > > tried firing up a project in

Re: Strange new error

2011-11-16 Thread Gchorn
I'm sorry, it's not totally clear to me what you mean by "trashed disk." If I use a disk utility, what am I looking for? Some sort of corruption of the actual hard drive? Are you saying my hard drive itself might be compromised and need replacement? Thanks, Guillaume -- You received this mess

Re: Strange new error

2011-11-17 Thread Gchorn
You were absolutely right. I used the built-in disk utility for OSX to verify the drive and it was corrupt. I then tried to use said utility to repair the disk but it couldn't, and recommended a reformat instead. Yikes. Was it fate that this happened literally a day after I started using Time Ma

How-to for static files?

2011-11-21 Thread Gchorn
Hello All, I am currently building a website using the Django built-in development server (python manage.py runserver). I have been using the main djangoproject tutorial for this, and it has worked very well. I have added a lot of internal CSS to the HTML templates that make up my project's view

Re: How-to for static files?

2011-11-22 Thread Gchorn
Oh yes, I definitely have this in my INSTALLED_APPS list (as simply 'myapp'). Sorry I left it out; I thought this was necessary regardless of whether or not I was using static files, so I didn't include it in the list of settings I changed just to enable static files. I do want to reiterate that

Trouble with "event_set" syntax

2011-05-24 Thread Gchorn
hin the template so that you're automatically taken to the correct page, and I can't think of how to set this variable (or context) from the views.py file, since its value changes for each product listed in the table. Can anyone help me with this? cheers, Gchorn -- You received this

Can I perform an "alter table" to remove a "not null" constraint?

2011-05-30 Thread Gchorn
It seems as though the default in Django when creating tables is to place a constraint that doesn't allow null values (contrary to what I've learned is the default for SQL in general). I have a model which has a date attribute, and which I now want to be able to hold null values, but when I tried

Django can't see my static files

2011-08-01 Thread Gchorn
Hello All, I'm using Django to develop a website, and I'm having trouble getting it to see my static files. I've looked through Django's static file documentation and the steps I've taken to get Django to see my files (using a CSS file as an example) are as follows: First, I created a folder cal