Dynamic Form Wizard

2009-02-11 Thread Jonathan Lukens
I am trying to dynamically add forms to a form wizard. Initially the form wizard subclass is instantiated with three forms as follows: # from urls.py (r'^add/$', RecipeWizard([HeaderForm, IngredientForm, BodyForm])), The idea is that a user will add any number of ingredients to a recipe, so the

problems with custom template library

2008-02-02 Thread jonathan . lukens
Hi all, I am new to Django and am trying to get my site, which is now built with ExpressionEngine, running on my development machine. I am trying to write a custom filter. When I place it in a template, I get the following error message: 'blog_extras' is not a valid tag library: Could not load

Re: problems with custom template library

2008-02-03 Thread jonathan . lukens
Thanks for the input. > try: @register.filter <--- without the '()' so long as this is in the file, I get a syntax error if I run the file from the command prompt, with the caret pointing to the '@', with or without the '()'. I get the same thing if I do this after the function: try: register

Re: problems with custom template library

2008-02-03 Thread jonathan . lukens
Hi Ned, I figured as much, but since without the 'try' made no difference, I thought I'd give it a whirl here is the source. 'lukenslanguages' is the project directory. #lukenslanguages/weblog/models.py from django.db import models class Category(models.Model): name = models.CharField

Re: problems with custom template library

2008-02-03 Thread Jonathan Lukens
This is a good idea for consistency, but did nothing to fix the problem. Is the a Category class somewhere in Django that I don't know about that could be conflicting?? On Feb 3, 2008 8:15 AM, Ned Batchelder <[EMAIL PROTECTED]> wrote: > It looks like you are using different styles of importing

static content permissions

2008-02-13 Thread jonathan . lukens
Forgive my idiocy, I have just installed Ubuntu + Apache 2.2 + MySQL + mod_python + django on an old machine and am using it for development. I am having difficulty getting my stylesheets to render. If I'm not using the *bad* way of serving the static content, do I still need a view to process

Re: static content permissions

2008-02-13 Thread jonathan . lukens
Hi Michael, This is actually just about what I had in my httpd.conf, but for some reason looking at it shook loose the wax in my brain and I realized I had a broken symlink... so thank you for the help! Programming is not my day job (as is evident), but I have a project that i want to get online

TemplateDoesNotExist for django-registration (but it does)

2008-02-13 Thread jonathan . lukens
Trying to get django-registration up and running, and I bumped into this error: TemplateDoesNotExist at /accounts/register/ registration/registration_form.html BUT: below, I can see that Django actually found the template, which I created and placed in the place specified by the documentation:

Re: TemplateDoesNotExist for django-registration (but it does)

2008-02-13 Thread jonathan . lukens
Hi Karen, Thanks, that is what the problem was. Doh. Jonathan On Feb 13, 7:11 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Feb 13, 2008 6:04 PM, <[EMAIL PROTECTED]> wrote: > > > > > > > Trying to get django-registration up and running, and I bumped into > > this error: > > > TemplateDoes

plaintext upload in newforms

2008-02-14 Thread jonathan . lukens
I am writing an app where site users upload a plaintext file full of unstructured *unicode* data, which is then processed and a CSV file is returned. I have just been informed that using newsforms.FileField() I am only going to get binary data. If it comes down to it, I could just retool this sn

Re: plaintext upload in newforms

2008-02-14 Thread jonathan . lukens
Scratch that. Had it stuck in my head that the attributes for UploadedFile objects were dictionary keys, confusion with older stuff. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to th

Re: plaintext upload in newforms

2008-02-15 Thread jonathan . lukens
Thank you Malcolm, Duly noted. My understanding of everything network-related is pretty fuzzy, and I guess I was failing to really make a distinction between Unicode and UTF-8 or UTF-16, though I should know better. Much obliged, Jonathan On Feb 15, 12:45 am, Malcolm Tredinnick <[EMAIL PROTECT

More file upload problems -- 'NoneType' unsubscriptable

2008-02-16 Thread Jonathan Lukens
Unless I am missing something, I have to work around using newforms.FileField because I need to do some specific validation on the file on upload, and FileField returns UploadedFile, which is not really a file anymore but the guts of the file and its name. So, I have the following form/field vali

Re: More file upload problems -- 'NoneType' unsubscriptable

2008-02-16 Thread Jonathan Lukens
Typo found, too many indents. Apologies. On Feb 16, 8:04 am, Jonathan Lukens <[EMAIL PROTECTED]> wrote: > Unless I am missing something, I have to work around using > newforms.FileField because I need to do some specific validation on > the file on upload, and FileField retur

single-field, single-instance models

2008-02-23 Thread Jonathan Lukens
I am building a site for a customer, a restaurant owner, who wants to be able to edit virtually all of the text on the site, including the home page introductory text, etc. It would be simple enough to create a model with a single field like this http://groups.google.com/group/django-developers/b

usernames and case sensitivity

2008-03-28 Thread Jonathan Lukens
I am writing an application that involves a number of nested parent- child relationships, where users create objects that each in turn have sub-objects. So far the URL structure looks like this: example.com/username/ example.com/username/child1/, example.com/username/child2/ example.com/username

Re: usernames and case sensitivity

2008-03-28 Thread Jonathan Lukens
Hi Evert, > > 2) Validate new usernames for case-insensitive uniqueness and filter > > with case-insensitive queries whenever the username is URL param. > def view(request, username, child=None, ...): >username = username.lower() The problem here is that that even if 'Charlie' and 'charlie'

Re: usernames and case sensitivity

2008-03-28 Thread Jonathan Lukens
You've understood me perfectly. I was just being picky. I would *like* to preserve the option of cased usernames, but if wikimedia doesn't fuss with it, why should I? I'll just add a clean_username method to the registration form that .lower() 's the name entered as suggested. Thank you for you

Re: usernames and case sensitivity

2008-03-28 Thread Jonathan Lukens
> Using the "iexact" option would fix this case. Take a look > at:http://www.djangobook.com/en/1.0/appendixC/ > towards the bottom, in the Field Lookups section. Yes, this is what I meant by "filter with case-insensitive queries whenever the username is URL param" -- I just couldn't remember t

Re: usernames and case sensitivity

2008-03-28 Thread Jonathan Lukens
> (Now that I think of it, I'm somewhat surprised that Django's > contrib.auth allows mixed case usernames. Quickly scanning through it, > all examples seem to use all lower-case anyway.) Surprised me too, but I'm not a real web developer (I pay the bills by translating technical literature) so

template IndexError (list index out of range)

2008-04-12 Thread Jonathan Lukens
I started getting an IndexError on a page today that has worked fine in the past. The uses a wrapped object_list generic view to render a template with the following loop: {% for baby in object_list %} {% if baby.photo %} {% endif

Re: template IndexError (list index out of range)

2008-04-12 Thread Jonathan Lukens
Of course. Thank you. I'm nearly braindead from doing taxes. On Apr 12, 11:12 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, Apr 12, 2008 at 9:28 AM, Jonathan Lukens <[EMAIL PROTECTED]> > wrote: > > > > > > > I started getting an

Re: Announcing the Django Dash!

2008-04-13 Thread Jonathan Lukens
What about Python libraries like PIL or ReportLab? On Apr 11, 10:42 pm, "Daniel Lindsley" <[EMAIL PROTECTED]> wrote: > We'd like to announce the firstDjangoDash > (http://www.djangodash.com/) to the community.DjangoDashis a web > application building competition forDjangodevelopers. The gist is >

single feed for multiple models

2008-05-01 Thread Jonathan Lukens
I have found myself in a situation where I need one RSS feed for two models that are related by a FK to the same model, something like Member.foo_set.all() and Member.bar_set.all(). How would I go about doing this? It doesn't seem possible to use the syndication framework in this case. --~--~---

When and how is dispatcher.connect() called?

2008-05-03 Thread Jonathan Lukens
I have two functions in a signals.py module that I would like called whenever instances of a number of models are saved or deleted. Everything works as intended when I add all of this to each models.py module: from django.dispatch import dispatcher from django.db.models import signals from projec

Re: Get first_name from User Model in to my Model

2008-05-04 Thread Jonathan Lukens
Maybe are wanting to populate that field automatically and you are looking for a custom save() method? This would do the trick: ... def save(self): self.first_name = self.user.first_name super(Student, self).save() You will also want to add blank=True or editable=False to the CharField arg

custom tag error related to import

2008-05-14 Thread Jonathan Lukens
I have a custom tag called {% photo %}. It takes two arguments: an object and a size. I've tinkered with django-photologue to use a GenericForeignKey. The tag returns the get_SIZE_url() for the Photo instance associated with a given object. I've posted the code for the tag here: http://dpaste.

Re: custom tag error related to import

2008-05-14 Thread Jonathan Lukens
Sure thing: def event_list(request, username, baby_id): events = Event.objects.filter(baby__id=baby_id).order_by('-date') baby = Baby.objects.get(id=baby_id) return object_list(request, queryset=events, extra_context={'baby':baby}) --~--~-~--~~~---~--~~

Re: custom tag error related to import

2008-05-14 Thread Jonathan Lukens
ks too, so long as I get rid of the import path for the Photo model. On May 14, 3:17 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, May 14, 2008 at 10:40 AM, Jonathan Lukens <[EMAIL PROTECTED]> > wrote: > > > > > I have a custom tag called {% p

Re: custom tag error related to import

2008-05-15 Thread Jonathan Lukens
-- and that did it. I guess there was a conflict somewhere. Thanks for the help! On May 14, 11:21 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, May 14, 2008 at 6:09 PM, Jonathan Lukens <[EMAIL PROTECTED]> > wrote: > > > > > Karen, > > >

possible bug in template tags

2008-05-21 Thread Jonathan Lukens
I'm encountering a problem using ContentType.model_class() within a template tag. The tag parses an “.“ argument and then tries to get the model object, like this: http://dpaste.com/51963/ When I place “{% magic_archives . %}“ in a template, I get the following: (u'', u'', '', "") So everythin

Re: Django bug or very strange behavior - new to Django don't know which

2008-06-04 Thread Jonathan Lukens
It is my understanding that the delete method you are calling is a QuerySet method, not a model method, and thus there is nothing overriding it. I'm sure that if you did this: for x in xxRaid.objects.all(): x.delete() Then your method will be called as desired. The overrides are for the DB

documentation-creating app

2008-07-11 Thread Jonathan Lukens
I am wondering if there is a pluggable Django app that does something like this. The app would include the following models: class Document(models.Model): body = models.TextField() title = models.CharField(max_length=x) toc = models.TextField() class Section(model.Model): bo