Need a tip on how to architect this code to be more extensible

2010-11-28 Thread Sontek
I wrote this open source project that allows you to use the django admin pop-ups in your own views but I want to give it the ability to have the view extended so they can pass excludes and instances to the form before its display... currently the code looks like this: from django.contrib.auth.deco

Re: Need a tip on how to architect this code to be more extensible

2010-12-04 Thread Sontek
I still haven't came up with a creative solution on this, is there anyone that might be able to give me some ideas? On Nov 29, 12:25 am, Sontek wrote: > I wrote this open source project that allows you to use the django > admin pop-ups in your own views but I want to give it the

Model Form crashing on Foreign Key

2010-01-10 Thread Sontek
So I'm trying to create a new feed within the Admin page and its crashing with the error IntegrityError: lifestream_feed.lifestream_id may not be NULL, the call stack is... form['lifestream'] is set but form.instance.lifestream is not. Here is the code: class FeedCreationForm(forms.ModelForm):

Re: Model Form crashing on Foreign Key

2010-01-10 Thread Sontek
On Jan 10, 12:23 pm, Sontek wrote: > So I'm trying to create a new feed within the Admin page and its > crashing with the error  IntegrityError: lifestream_feed.lifestream_id > may not be NULL, the call stack is... form['lifestream'] is set but > form.instance.life

Re: Model Form crashing on Foreign Key

2010-01-10 Thread Sontek
On Jan 10, 6:17 pm, Sontek wrote: > On Jan 10, 12:23 pm, Sontek wrote: > > > So I'm trying to create a new feed within the Admin page and its > > crashing with the error  IntegrityError: lifestream_feed.lifestream_id > > may not be NULL, the call stack is...

Dynamic Nested Formsets?

2011-06-10 Thread Sontek
I have 3 Models: class Workflow(models.Model): name = models.CharField(max_length=255) company = models.ForeignKey(Company) class Meta: unique_together = ('name', 'company') class Milestone(models.Model): workflow = models.ForeignKey(Workflow) tasks = models.ManyToMany

Using class based views to autoassign certain values?

2011-01-17 Thread Sontek
When I try to add new Attendee with a class based view I get the error matriculation_attendee.event_id may not be NULL with this code: class Event(models.Model): """ Model representing an event """ place = models.ForeignKey(Place, blank=True, null=True) slug = AutoSlugField(populate_fr