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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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
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
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'
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
> 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
> (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
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
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
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
>
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.
--~--~---
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
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
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.
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})
--~--~-~--~~~---~--~~
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
-- 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,
>
> >
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
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
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
33 matches
Mail list logo