How to Model Formset

2009-01-21 Thread Mackenzie Kearl
The only way to describe what I am trying to accomplish is through an example. Here are my models class B(models.Model): credits = models.FloatField(,null=True) class A(models.Model): b = models.OneToOneField(B) description = models.TextField() I want to get a formset of A forms

Re: Multiple managers for reverse-links between subclasses

2009-01-21 Thread Mackenzie Kearl
On Jan 21, 11:14 am, Aneurin Price wrote: > (Apologies for the vague subject; I couldn't think how to summarise this :P) > > Hello all, > > I have an application where some models are inherited from others, like so: >    Foo >   /   \ > Bar  Baz > Each object has (or may

Re: 404 for date-based generic views--Help!

2007-08-02 Thread Mackenzie Kearl
You should put some template code up as well i know that I recently could not see posts that existed because allow_future: defaults to False http://www.djangoproject.com/documentation/generic_views/#django-views-generic-date-based-archive-day

Re: Count the times a user has logged into the system

2007-08-02 Thread Mackenzie Kearl
you can just create a profile with a field number of times logged in. This could be updated in a custom login view that you write. check out http://www.djangobook.com/en/beta/chapter12/ def login(request): username = request.POST['username'] password = request.POST['password'] user

Sitemap Index problems

2007-08-04 Thread Mackenzie Kearl
Hi I am trying to get a sitemap index generated however I only get "Exception Type:ValueError Exception Value:Empty module name" I am not sure what I am doing wrong. urls.py sitemaps = { 'blog':BlogSitemap, 'gallery':GallerySitemap, } urlpatterns = patterns('',

custom form validation in newforms-admin

2008-06-05 Thread Mackenzie Kearl
I am using newforms admin and need to be able to have a validation check against multiple fields on the form. I was reading that all you need to do is to go form_change = MyCustomForm() from within your subclass of admin.ModelAdmin however it seems like this has changed since the post that I

custom model field validation

2008-02-07 Thread Mackenzie Kearl
I am having trouble finding documentation on how to add custom validation to a custom model field. example: class PostalField(models.CharField): def __init__(self,*args,**kwargs): kwargs['max_length']= 6 super(PostalField, self).__init__(*args, **kwargs)

Re: custom model field validation

2008-02-07 Thread Mackenzie Kearl
On Feb 7, 2:53 am, Pigletto <[EMAIL PROTECTED]> wrote: > On 7 Lut, 09:58, Mackenzie Kearl <[EMAIL PROTECTED]> > wrote:> I am having trouble finding documentation on how to add custom > > validation to a custom model field. > > > example: > > > class P