Single form displayed multiple times on one page with different values.

2013-08-25 Thread Brian Millham
I have the this simple form: class MistagForm(forms.Form): artist = forms.CharField() And I want to display it on a page more than once. The page is a list of artists, and each artist has a link to the above form that will be a popup form. I want the default value of artist in the form to

Re: django-popup-forms

2013-08-15 Thread Brian Millham
; > > On Thu, Aug 15, 2013 at 2:41 AM, Brian Millham > > wrote: > >> I've been trying to use django-popup-forms, but with no success. Has >> anyone used this? >> >> I suspect that I didn't install it correctly. I just ran sudo python >> setup.py

django-popup-forms

2013-08-14 Thread Brian Millham
I've been trying to use django-popup-forms, but with no success. Has anyone used this? I suspect that I didn't install it correctly. I just ran sudo python setup.py install, but it doesn't seem available under django. It looks like a nice package, and will do exactly what I'm looking for. It'

Re: How to force modelForm.is_valid() to use a specific database?

2013-07-23 Thread Brian Millham
I've done that with this code: if form.is_valid(): > f = form.save(commit = False) > f.save(using='yourdatabase') Works fine for me. On Tuesday, July 23, 2013 1:21:29 PM UTC-4, Fellipe Henrique wrote: > > I have many database setted in my setting.py in my formModel, when I try > to vali

Foreign Key problems with legacy database

2013-07-22 Thread Brian Millham
I have the following models: class Requestlist(models.Model): >id = models.IntegerField(primary_key=True) >songid = models.Integerfield() >song = ForeignKey('Song', db_column='songid') > class Song(models.Model): > id = models.IntegerField(primary_key=True) > title = models.CharFie

Foreign key problems with legacy database

2013-07-22 Thread Brian Millham
I have these 2 models: class Requestlist(model.Model): -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to

Problem counting names by letters

2013-05-24 Thread Brian Millham
With this simple database table: class Artist(models.Model): id = models.IntegerField(primary_key=True) name = models.CharField(max_length=255L, blank=True) prefix = models.CharField(max_length=32L, blank=True) class Meta: db_table = 'artist' I want to be able to get a lis

Problem counting names by letter

2013-05-24 Thread Brian Millham
With this simple database table: class Artist(models.Model): id = models.IntegerField(primary_key=True) name = models.CharField(max_length=255L, blank=True) prefix = models.CharField(max_length=32L, blank=True) class Meta: db_table = 'artist' I want to be able to get a lis

Re: Forcing group_by on a field other than id

2013-05-15 Thread Brian Millham
That isn't what I was looking to do. Here a more detailed explanation. Datebase setup: Table 1 - Song: id | artist| album | title ---++-+- 1 | Artist 1 | Album 1 | Song 1 2 | Artist 1 | Album 2 | Song 1 3 | Artist 1 | Album 3 | Song 1 4 | Artist 2 | Albu

Trying to figure out ManyToManyField on a legacy database

2013-05-11 Thread Brian Millham
Hi all, I'm just trying to learn Django. I have an existing site that I wrote in PHP, and I'l considering converting it to Django, I have a legacy database that I don't want to make any changes to. I have the basics working in Django, but am having a problem with a ManyToManyField. Here are th