Re: How do I add an incrementing numeric field to a generic list?

2009-10-18 Thread jeffself
Thanks. I didn't realize that "forloop" really meant forloop. I thought it meant the name of my loop! On Oct 18, 4:39 am, Daniel Roseman wrote: > On Oct 18, 3:11 am, jeffself wrote: > > > > > I've got a view that returns a generic list. It contains the

How do I add an incrementing numeric field to a generic list?

2009-10-17 Thread jeffself
I've got a view that returns a generic list. It contains the following fields: school, wins, losses, pf, pa, rating I want to add a field called rank that assigns the values 1 through whatever for each of the records returned. Is this possible using the templating engine or do I have to write pur

Re: Why is this view not displaying data?

2009-09-27 Thread jeffself
Thanks Karen! That did the trick. --~--~-~--~~~---~--~~ 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 t

Why is this view not displaying data?

2009-09-27 Thread jeffself
Here's my url.py: from django.conf.urls.defaults import * urlpatterns = patterns('Rankings.college.views', url(r'^rankings/division/(\w+)/$', 'rankings_by_league'), ) views.py def rankings_by_league(request, league): try: league = League.objects.get(slug__iexact=league) exc

Re: Need help with a filter in a view

2009-09-26 Thread jeffself
Thanks Jim. I'll give this a shot. On Sep 25, 8:24 pm, Jim McGaw wrote: > What you might be asking for is the following syntax, that allows you > to perform queries against the data in more than one table: > > CurrentRanking.objects.filter > (school__schoolseason__league__league_name="League Na

Re: Need help with a filter in a view

2009-09-26 Thread jeffself
Derek, I actually had done my model the way you suggested, but changed my mind. I guess I should listen to my first instinct! Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: Need help with a filter in a view

2009-09-25 Thread jeffself
Oops. I should have said my current view returns a list of rankings (school_name, rating) rather than all schools. On Sep 25, 7:59 pm, jeffself wrote: > I've got the following models: > > class League(models.Model): >     league_name = models.CharField(max_length=100)

Need help with a filter in a view

2009-09-25 Thread jeffself
I've got the following models: class League(models.Model): league_name = models.CharField(max_length=100) class School(models.Model): school_name = models.CharField(max_length=100) class SchoolSeason(models.Model): season = models.IntegerField() school = models.ForeignKey(School

Re: Looking to give presentation on Django at work

2009-02-09 Thread jeffself
I already have the demo in place. I just wanted to spruce it up with a presentation and wanted to know if something already existed that I could work from. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Looking to give presentation on Django at work

2009-02-09 Thread jeffself
Is there a presentation available that I can use? Would like to skip the whole building of the presentation myself if possible. If there isn't one, I may create an "open-source" presentation myself and make it available for others to build on. --~--~-~--~~~---~--~

Extending the User model

2008-10-16 Thread jeffself
I'm working on an application that will need data entry from many users. The users belong to various departments in the organization and the information that gets entered by each user should contain the department information. The reason for this is that the users should be able to view and edit

Having trouble creating admin form using TabularInline

2008-08-30 Thread jeffself
My model has 3 main classes, School, Contest, Participant. School contains the following fields: school_name, slug, nickname. Contest contains the following fields: date_scheduled, title, notes. Participant contains the following fields: contest (foreign key), school (foreign key), score I want

Re: How do I pass a value to a javascript function? (ie. lat and lng values to Google Maps)

2008-05-23 Thread jeffself
Peter & Baxter, I did not realize how easy this was. I work primarily in ColdFusion and you cannot pass a ColdFusion variable into Javascript directly. I never even tried to just put a template variable in for the latitude and longitude. Wow, this is awesome! Thanks for you help guys! --~--~-

How do I pass a value to a javascript function? (ie. lat and lng values to Google Maps)

2008-05-23 Thread jeffself
I'm trying to get an understanding of using maps with Django. I've installed Geopy and totally understand how it works. I also can produce a Google map with data I provide in the javascript. My question is how do I get the data from Django into the Google Maps javascript? Example: I have a cla

Re: Google Maps API

2008-05-22 Thread jeffself
On Mar 30, 9:18 pm, Michael <[EMAIL PROTECTED]> wrote: > I would search for "googlemapsAPI." Really though the integration > with googlemapsis mostly a front end application. So you would > create it all with front end javascript. > > The only real django knowledge to pass here would be to make

Re: I'm not getting URL's. Help!

2008-04-23 Thread jeffself
info, > 'election_detail'), > ) > > and then in your election models: > def get_absolute_url(self): > return ('election_detail', (), { 'slug': self.slug, }) > > 2008/4/22 jeffself <[EMAIL PROTECTED]>: > > > > > Here's t

Re: I'm not getting URL's. Help!

2008-04-22 Thread jeffself
'fields': ('precinct_photo','precinct_map') }) ) def __unicode__(self): return '%s %s' % (self.precinct_number, self.precinct_name) def get_absolute_url(self): return ('django.views.generic.list_deta

Re: I'm not getting URL's. Help!

2008-04-21 Thread jeffself
rl referring > to the elections one, > > Michael > > On Mon, Apr 21, 2008 at 12:48 PM, 小龙 <[EMAIL PROTECTED]> wrote: > > Show me -- Settings.py > > > 2008/4/21, jeffself <[EMAIL PROTECTED]>: > > > > I've got a project that cont

I'm not getting URL's. Help!

2008-04-21 Thread jeffself
I've got a project that contains two apps (elections and precincts). My root urls.py looks like this: from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^elections/', include('elections.urls')), (r'^precincts/', include('precincts.urls')), (r'^admin/', include('djang

Re: urls stumping me

2008-04-18 Thread jeffself
ECTED]> wrote: > Possibly what you have set for get_absolute_url in your models.py > file? > > On Apr 18, 1:14 pm, jeffself <[EMAIL PROTECTED]> wrote: > > > My project contains two apps, elections and precincts. My main > > urls.py file looks like

urls stumping me

2008-04-18 Thread jeffself
My project contains two apps, elections and precincts. My main urls.py file looks like this: from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^precincts/', include('precincts.urls')), (r'^elections/', include('elections.urls')), (r'^admin/', include('django.cont

Re: Enterprise applications with Django

2008-04-16 Thread jeffself
On Apr 16, 10:08 am, "Hernan Olivera" <[EMAIL PROTECTED]> wrote: > > If the question is "can it handle business logic rather than just > > be a system for writing blog software and news sites?" then most > > certainly. Several of the Django sites I've authored (they're > > internal rather t

City, State, Country Application?

2008-04-08 Thread jeffself
I'm sure everyone has created models that contain city, state, country, and other location information. Is there an app already written for Django that I can import? I want to be able to select either a country followed by a state followed by a city (all filtered) or enter a postal code. I woul

Re: geo django and mysql

2008-03-31 Thread jeffself
Is there a reason you must use MySQL? GeoDjango works much better with PostgreSQL with the PostGIS extensions. On Mar 31, 11:40 am, Greg_IAP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > I'm working on a image processing pipeline for french astrophysicians > using web services through django. >

Re: Do I need two classes that are identical because I want to use two database tables?

2008-03-29 Thread jeffself
On Mar 28, 9:34 pm, andy baxter <[EMAIL PROTECTED]> wrote: > Peter Rowell wrote: > >> So should I just create two classes that are identical but name one > >> CurrentElectionResults and the other PastElectionResults? > > Can't you just have a single class 'ElectionResults' and add a field > call

Re: templatetags

2008-03-29 Thread jeffself
On Mar 29, 11:40 pm, ameriblog <[EMAIL PROTECTED]> wrote: > i have a site that lists candidates for mayor, on the page i have > biographical information, also i want to include recent news for that > candidate. i have news setup as a class in the models.py that has a > ManyToMany relationship wi

Re: scraping PDF

2008-03-29 Thread jeffself
On Mar 29, 12:56 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Fri, Mar 28, 2008 at 11:21 PM, <[EMAIL PROTECTED]> wrote: > > I'm trying to figure out the best way to link-up everything. Any > > suggestions? > > So, since I talked about it at PyCon, I'll take an example from this > proje

Re: sports ratings

2008-03-29 Thread jeffself
Hey ameriblog, I do ratings as well. My current application was written in C about 10 years ago and I've flirted with rewriting it in Python. In fact, I posted a message on comp.lang.python last year about trying to speed up my app: http://groups.google.com/group/comp.lang.python/browse_thread/

Anybody using UUID fields yet?

2008-03-28 Thread jeffself
I'm starting to see a lot of benefit in using UUID as a primary key rather than autogenerated id numbers. Since Django doesn't natively support the field, I guess you would have to use a CharField with a max_length of 32. Unfortunately, this wouldn't produce a native UUID datatype which Oracle a

Do I need two classes that are identical because I want to use two database tables?

2008-03-28 Thread jeffself
I've created a class called ElectionResults that contains the following fields: election = models.ForeignKey(Election) precinct = models.ForeignKey(Precinct) office = models.ForeignKey(Office) candidate = models.ForeignKey(Candidate) total_votes = models.PositiveIntegerField(default=0) Here's th

Re: Newbie trying to install django-trunk from svn on Ubuntu 7.10

2008-03-26 Thread jeffself
bobhaugen wrote: > Following http://www.djangoproject.com/documentation/install/ > > I'm stuck at the steps of setting up the symlinks to django. > Step 3. ln -s `pwd`/django-trunk/django SITE-PACKAGES-DIR/django > Step 4. ln -s `pwd`/django-trunk/django/bin/django-admin.py /usr/local/ > bin > >

Need advice on design of models

2008-03-26 Thread jeffself
I'm creating an election site and I have created the following 4 main classes: class Election(models.Model): election_name = models.CharField(max_length=100, unique=True) slug = models.SlugField(prepopulate_from=("election_name",), unique=True) election_date = models.DateField() clas

Is there a better way to design my model?

2008-03-03 Thread jeffself
I'm working on a project where I've identified the following classes: class FiscalYear(models.Model): fyear = models.CharField(max_length=6, unique=True) startdate = models.DateField() enddate = models.DateField() class System(models.Model): system_number = models.CharField(max_l

Having problem using the Syndication Feed Framework

2008-01-29 Thread jeffself
I'm trying to get an understanding of the Feed Framework, so I've created a simple application to try it out. I have followed the steps that are in the documentation but I'm getting the following error when I go to this URL: "http://127.0.0.1:8000/feeds/news/": AttributeError at /feeds/news/ 'No

Re: EXPORT PATH in Leopard

2007-12-28 Thread jeffself
I have a bin directory in my home folder. In that, I created a link for django-admin.py pointing to /opt/django-source/django/bin/django- admin.py. My $HOME/bin is in my path. On Dec 27, 11:53 pm, mOne <[EMAIL PROTECTED]> wrote: > Hi, > > I am using Leopard currently and am getting started with

I need to make a column sortable on the admin side

2007-12-28 Thread jeffself
I'm creating an admin interface using the Admin application and I've renamed a field with the following code: def display_classification(self): return self.class_name display_classification.short_description = 'Classification' However, when I do this, the column heading no longer allows sort

Python for Leopard Users. Built-in or compiled?

2007-11-21 Thread jeffself
Which version of Python are you using on Leopard for Django? The included version or did you download and compile another copy? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Recommendations on running Django on Leopard

2007-10-31 Thread jeffself
s/3588/ > > 2007/10/31, jeffself <[EMAIL PROTECTED]>: > > > > > I just installed Leopard last night and haven't gotten around to > > installing Django yet. Should I use the default Python installation > > or should I install Python myself like I did in Tig

Recommendations on running Django on Leopard

2007-10-31 Thread jeffself
I just installed Leopard last night and haven't gotten around to installing Django yet. Should I use the default Python installation or should I install Python myself like I did in Tiger? Any issues with psycopg2 or the egenix stuff? I'm not worried about mod python yet since I'm still in the l

Can't update my django source via svn

2007-09-19 Thread jeffself
I've never run into this problem before but all of a sudden its not working. My source is located in /opt/django_src. I run 'sudo svn update' and I'm now getting errors. svn: PROPFIND request failed on '/svn/django/trunk' svn: PROPFIND of '/svn/django/trunk': Could not read status line: Connect

Re: I have a class in my Models that contains one field which happens to be an integer type

2007-07-21 Thread jeffself
On Jul 20, 11:09 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 7/21/07, jeffself <[EMAIL PROTECTED]> wrote: > > > > > How do I get the season to > > display in the select box of my season field on the Game form? > > Normally th

Re: Django, python 2.5 and macports 1.5

2007-07-20 Thread jeffself
On Jul 20, 4:50 am, lars <[EMAIL PROTECTED]> wrote: > Hi all, > > yesterday I tried to install django on my macbook. Since I wanted to > have a more recent python interpreter I installed the one from > macports. > There's a pitfall, however. Because in order to get MD5 running you > have to inst

I have a class in my Models that contains one field which happens to be an integer type

2007-07-20 Thread jeffself
In my model for my application, I've created a class called Season. There is only one field in this class and that is called year and its of type integer. In another class called Game, I have a field called season which is a ForeignKey to Season. When I bring up the add Game form in the Admin, m

Can't run Django. Getting error message about no module named _md5

2007-06-27 Thread jeffself
Just updated Django to latest version. I'm running it on a Mac Book Pro with Python 2.5.1 from the MacPorts packaging system. When I run 'python manage.py runserver', I get the following error: ImportError: No module named _md5 I have a feeling this may be more of a python problem than Django,