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 have) a parent object, wh

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 f

Re: Q - returning a data to the template. (many models).

2008-09-29 Thread Tom MacKenzie
ults %} > Product: {{ product }}, company: {{ product.co }} > {% endfor %} > > As a sidenote, I'd use readable column names such as "company" instead of > "co". If you need to map to a legacy database which has "co_id" as the name > of the co

Re: Q - returning a data to the template. (many models).

2008-09-28 Thread Tom MacKenzie
If anyone could have a look it would be much appreciated. -Tom On Sat, Sep 27, 2008 at 6:40 PM, Tom MacKenzie <[EMAIL PROTECTED]>wrote: > http://django.pastebin.com/d1c579dbf > > Thanks! > > > On Sat, Sep 27, 2008 at 5:48 PM, Ovnicraft <[EMAIL PROTECTED]> wrote

Re: Q - returning a data to the template. (many models).

2008-09-27 Thread Tom MacKenzie
http://django.pastebin.com/d1c579dbf Thanks! On Sat, Sep 27, 2008 at 5:48 PM, Ovnicraft <[EMAIL PROTECTED]> wrote: > is posible use pastebin? http://django.pastebin.com/ > > 2008/9/27 [EMAIL PROTECTED] <[EMAIL PROTECTED]> > >> >> my view is below. >> >> >> >>Search{% if query %} Results{%

Setting up Admin on Fedora 9

2008-09-12 Thread Tom MacKenzie
Hi All, I am able to view the admin pages correctly via python's development server. Once I set up in Apache it looses its format. I have tinkered with the settings.py and /etc/httpd/conf.d/python.conf so much my eyes are starting to cross :) can anyone help out a newb and post instructions or

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 re

Re: question on ModelMultipleChoiceField

2008-04-07 Thread Mackenzie Kearl
you should use PostForm(instance=post) --~--~-~--~~~---~--~~ 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 ema

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

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)

Sitemap Index problems

2007-08-04 Thread Mackenzie Kearl
temap.py from django.contrib.sitemaps import Sitemap from paddlecrazy.blog.models import Post class BlogSitemap(Sitemap): def items(self): return Post.objects.all() def lastmod(self, obj): return obj.modified I can get the sitemap-.xml files just fine however the index

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 =

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: Syndication with kwargs from url

2007-07-26 Thread Mackenzie
Thanks for the help!!! --~--~-~--~~~---~--~~ 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 to [EMAIL P

Syndication with kwargs from url

2007-07-25 Thread Mackenzie
objects for the feed. Thanks Mackenzie --~--~-~--~~~---~--~~ 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,

Re: form processing

2007-07-13 Thread Mackenzie
Thanks for your help I was not understanding why I could not get both values. On Jul 13, 3:10 pm, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > > I have a form on one of my pages that has two fields with the same > > name. When I process the POST in my view I only get one of the values > > (

form processing

2007-07-13 Thread Mackenzie
I have a form on one of my pages that has two fields with the same name. When I process the POST in my view I only get one of the values ( the last one ). EXAMPLE: HTML DEBUG POST: VIEW request.POST['version'] the above line is = 35 if both checkboxes are checked any ideas why I don't get a