Hi All,
I have a simple model Node defined as such:
class Node(models.Model):
name = models.CharField(max_length=255, unique=True)
description = models.CharField(max_length=255)
active = models.BooleanField(default=True)
Now I want to create a formset of this form:
class NodeSelect
I need to validate an uploaded XML file in my Form clean method, but
I'm unable to open the file for validation. It seams, in the clean
method, the file hasn't yet been moved from memory (or the temporary
directory) to the destination directory.
For example the following code would fail because t
Perhaps instead of rejecting specific file types, you should only
allow specific file types? Most of the time a file upload is taking
place the programmer has some sort of idea what the user will upload.
This is probably the most secure method, even though it won't work for
everyone.
On Feb 20, 6
I'm new to Python and Django, and I'd like some advice on how to
layout the code I'd like to write.
I have the model written that allows a file to be uploaded. In the
models save method I'm checking if the file has a specific extension.
If it has an XML extension I'm opening the file and grabbing
Turns out the problem was the FileField value. It can't start with a
forward slash, it has to be relative.
On Feb 20, 2:28 pm, Ty wrote:
> That's the thing... (and I probably should have mentioned this) I'm
> developing on Windows XP using the "manage.py runserver&quo
gt; issue before I set the directory group to be Apache and gave it RWX
> privileges
>
> On Feb 20, 2:21 pm, Ty wrote:
>
> > When I login to the administration and try to delete a file I get a
> > "SuspiciousOperation" error. Here's the traceback:http://dpaste.com
When I login to the administration and try to delete a file I get a
"SuspiciousOperation" error. Here's the traceback:
http://dpaste.com/123112/
Here's my full model:
http://dpaste.com/hold/123110/
Any help would be appreciated.
--~--~-~--~~~---~--~~
You received
Ah, DURR. I just had to put "initial=" before the dictionary. Now it
all makes sense!
On Feb 2, 9:48 pm, Ty wrote:
> Yes, but that would bound the data to the form and the data would try
> to be validated on page load. I'm looking to pass default values to an
> unbound f
ictionary of the values in your session under some name that you'll
> know to use.
>
> On Fri, Jan 30, 2009 at 5:04 PM, Tyler Brownell
> wrote:
> >http://groups.google.com/group/django-users/browse_thread/thread/ed74...
>
> > On Fri, Jan 30, 2009 at 5:03 PM,
I've went through the documentation for "modelforms" and "forms" but I
couldn't figure our how someone would set the default value for a form
field to a session variable.
I have a checkbox in my comment form that says "remember my
information". After a comment is submitted and if the checkbox is
#x27;ll
probably just go that route.
On Jan 26, 1:28 pm, "Eduardo O. Padoan"
wrote:
> On Mon, Jan 26, 2009 at 4:23 PM, Ty wrote:
>
> > I write HTML 4.01 strict documents and I'm using the django.forms form-
> > handling library.
>
> > Currently when pr
I write HTML 4.01 strict documents and I'm using the django.forms form-
handling library.
Currently when printing input fields on the template, the output
includes the ending slash: "".
Is there any way, other then manually writing the input field to the
template, to get these variables to outpu
mit=False)
> comment.entry = entry <http://entry.id/>
> comment.save()
>
> On Mon, Jan 26, 2009 at 7:28 PM, Ty wrote:
>
> > Here's a snip of my model:
>
> > class Comment(models.Model):
> > entry = models.ForeignKey('Entry')
&
Here's a snip of my model:
class Comment(models.Model):
entry = models.ForeignKey('Entry')
name = models.CharField(max_length=100)
email = models.EmailField(max_length=200, blank=True)
website = models.URLField(verify_exists=True, blank=True)
body = models.
@Alex:
Nope, that's only pulling back entry's that have approved comments.
On Jan 20, 12:43 pm, "alex.gay...@gmail.com"
wrote:
> On Jan 20, 11:53 am, tlow wrote:
>
>
>
> > I think you can not do that with only one query using annotate.
>
> > You could do it manually in python using the code ab
I'm currently using the extra method (subquery) and it's working
perfectly.
Thanks for clearing that up for me Thomas.
On Jan 20, 11:53 am, tlow wrote:
> I think you can not do that with only one query using annotate.
>
> You could do it manually in python using the code above including the
> a
Here are my models:
class Entry(models.Model):
name = models.CharField(max_length=200, unique=True)
date_published = models.DateTimeField()
is_published = models.BooleanField(default=False)
class Comment(models.Model):
entry = models.ForeignKey('Entry')
na
Thanks for the clarification.
On Jan 16, 2:18 pm, Daniel Roseman
wrote:
> On Jan 16, 7:03 pm, Ty wrote:
>
> > Follow-up question:
> > I have a project that was created using the 1.0.2 version. Is it a
> > good idea to basically recreate the project and apps using the n
It seams we have posted at almost the same time. Thanks for the reply.
On Jan 16, 1:59 pm, Ramiro Morales wrote:
> On Fri, Jan 16, 2009 at 4:47 PM, Ty wrote:
>
> >http://docs.djangoproject.com/en/dev/topics/install/#installing-the-d...
>
> > I'm currently on a Window
method.
Follow-up question:
I have a project that was created using the 1.0.2 version. Is it a
good idea to basically recreate the project and apps using the newest
version of the django-admin.py file, and then migrate the code over?
I'm assuming so.
On Jan 16, 1:47 pm, Ty wrote:
> http://d
http://docs.djangoproject.com/en/dev/topics/install/#installing-the-development-version
I'm currently on a Windows system and stuck on step #3. I have no idea
how to continue because I don't know what an "environment variable"
actually is and what they do.
I've looked into how to create "environ
Thanks for the help, much appreciated.
On Jan 13, 1:28 pm, Brian Neal wrote:
> On Jan 13, 12:06 pm, Ty wrote:
>
>
>
> > I've started creating a photo blog project to get familiar with Python
> > and Django. I'm using Python 2.6.1 and Django 1.0.2. I
I've started creating a photo blog project to get familiar with Python
and Django. I'm using Python 2.6.1 and Django 1.0.2. I'm working on
the models and the administration first, before I tackle the front end
side of the site. I have everything working fine, for the exception of
an image upload f
I'd like to grab the users external IP address. I'm using it for a
spam catching class that I'm porting over to Django/Python. Is this
possible?
This person outlines how to 'hack' it, but I'd rather not depend on an
external site.
http://dmiessler.com/blog/how-to-use-python-to-get-your-external-i
Great! Changing the list_display to 'post' and changing the return
value of Post's __unicode__ worked perfectly. Thanks for your help!
On Oct 17, 4:16 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Fri, Oct 17, 2008 at 3:21 PM, Ty <[EMAIL PROTECTE
# admin.py:
from django.contrib import admin
from clydefrog.blog.models import Post, Comment
class PostAdmin(admin.ModelAdmin):
list_display = ('name', 'slug', 'date', 'is_published',)
list_filter = ('is_published',)
ordering = ('is_published', '-date', 'name',)
se
26 matches
Mail list logo