I've done some work on FileField lately that address some of your concerns.
On 10/16/07, Mark Green <[EMAIL PROTECTED]> wrote:
> * does django properly sanitize the filename or rather, use
> safe temp files? i wonder what would happen if i tried to
> upload a file called "../../traverse.txt"
On 10/16/07, Doug Van Horn <[EMAIL PROTECTED]> wrote:
>
> On Oct 16, 7:06 am, "Fco. Javier Nievas" <[EMAIL PROTECTED]> wrote:
> > Could you give a link to that patch?
> >
> > Thanks
>
> One last note, there's a link at the bottom of my post to Marty's
> patch. Here it is if you'd rather just hea
On 10/17/07, Mark Green <[EMAIL PROTECTED]> wrote:
> > The ticket I mentioned above also makes it much easier to subclass
> > FileField and ImageField to add or change whatever functionality you
> > like. I don't know whether PIL already does what you need, but if
> > you're paranoid, this patch s
On 10/19/07, johnny <[EMAIL PROTECTED]> wrote:
> upper() in output.upper(), I am assuming is the name of the template
> tag. When I try to do it as in this example, I get an error:
>
>
>
> I didn't understand the output.upper() part. I think the
> documentation above is written for people who a
On 10/19/07, Ken <[EMAIL PROTECTED]> wrote:
> Thanks for your reply. It was a great help. I followed up on reading
> the HTML spec and the posted data is returned in document order. Next
> section.
Ah, so it is! Color me crazy, but when information about how browsers
should process data wasn't
I haven't done any testing on this, but I'd like to point out one
thing. The HTML spec[1] doesn't specify anything about browsers having
to assemble the data set in document order. This means that even if
Django made sure that the multivalues are put in POST in the order
they were received, there
On 10/20/07, james_027 <[EMAIL PROTECTED]> wrote:
> but when I try to use it on my models.py in my forms.py it seems that
> the from app_name.XXX.models import * doesn't work anymore.
It sounds like you have a circular import problem. models.py is
importing forms.py, which is in turn importing mo
On 10/24/07, Taft <[EMAIL PROTECTED]> wrote:
> I'd like to do something like this:
>
>
>
> ...
> type="text/css" title="Style" />
> ...
>
> ...
>
>
>
> Though I've searched high and low, I can't seem to find documentation
> that tells me how to do something like this. And l
Once again, I'll defer to the Django documentation. My apologies for
not including this link in my original message.
http://www.djangoproject.com/documentation/templates_python/#django-core-context-processors-media
And the following section, just above, shows that this context
processor is in th
You want something like this:
{% block image %} {% endblock %}
-Gul
--~--~-~--~~~---~--~~
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 unsubs
On 10/25/07, Ryan K <[EMAIL PROTECTED]> wrote:
> Why can't I change the User's name like so:
>
> results[0].user.name = 'Brian'
> results[0].user.save()
>
> ?
>
> I instead have to assign it first:
>
> found_user = results[0].user
> found_user.name = 'Brian'
> found_user.save()
>
> Any help unders
Speaking as someone who's tried their hand at both sides of the coin,
I definitely agree with you, Ross. I'm currently employed, but when I
was trying to make it as a contractor (because a job fell through), I
couldn't land a single job because of the market dillution. Working in
PHP as I was, I f
On 10/26/07, Hugh Bien <[EMAIL PROTECTED]> wrote:
> I haven't really used generic views that often, but I know you could always
> extend them by creating your own views.
>
> Inside your views.py:
>
>
> from django.views.generic.list_detail import object_list
>
> @login_required
> def my_list(*args
On 10/29/07, Jökull <[EMAIL PROTECTED]> wrote:
> There is a lively discussion on an interesting upcoming feature of
> Django called FileStorage. This will allow any sort of file storage
> mechanism to plug into FileFields and process uploads. A good example
> would be Amazon's S3 where a FileStora
On 10/30/07, Roodie <[EMAIL PROTECTED]> wrote:
> I am working on a small portal, and there is a sidebar which is
> visible on every page. It contains the list of latest news and forum
> topics - the "usual" portal stuff.
> Now the question is - how do you do that effectively in Django? I am
> refe
On 10/30/07, Gigs_ <[EMAIL PROTECTED]> wrote:
>
> error:
> IntegrityError at /accounts/register/
> accounts_playersprofile.first_name may not be NULL
> Request Method: POST
> Request URL:http://localhost:8000/accounts/register/
> Exception Type: IntegrityError
> Exception Value
On 10/30/07, Milan Andric <[EMAIL PROTECTED]> wrote:
> I'm writing an application form (allow people to apply for a workshop)
> and we allow the applicant to submit unfinished applications because
> they can return to complete them at a later date. So most of the
> model fields are blank=True.
On 10/30/07, cjl <[EMAIL PROTECTED]> wrote:
> class Transaction(models.Model):
> ...
> def save(self):
> self.account.current_balance = self.account.current_balance +
> self.amount
> super(Transaction, self).save()
>
> This does not work. How do I access the 'current_balan
On 10/30/07, cjl <[EMAIL PROTECTED]> wrote:
> > def save(self):
> > self.account.current_balance += self.amount
> > self.account.save()
> > super(Transaction, self).save()
>
> That did the trick, thank you.
I'm glad to hear that. On second thought, though, you might want to
move self.
On 10/30/07, Ben <[EMAIL PROTECTED]> wrote:
> Actually, that's given me ideas but I can't seem to work out how to do
> what I want. That works by simply storing the values after the change
> each time the model is updated. However, I don't seem to have both the
> before and after values in a singl
On 10/30/07, Ben <[EMAIL PROTECTED]> wrote:
> I don't specifically need the before value, I need to know which of
> the fields have changed.
Okay, well, it still raises the same question, anyway.
But, regardless, you pretty much have two options:
- Store the values when the object is instantiat
On 10/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> for example the field 'order' is set to: -publish_date,section
>
> I know that in my view I can't do this:
>
> Story.objects.filter(id_site=Site.objects.get_current().id).select_related().order_by(order)
>
> so...how can I do?
You could
On 11/1/07, Jon Atkinson <[EMAIL PROTECTED]> wrote:
> As I understand it, this is all I need to do to have the context
> processor execute properly, however neither 'spam' is output to the
> console (I'm using the ./manage.py server), nor is 'eggs', or the
> token 'cp_test' passed to the template.
Honestly, I'm surprised this is such a big deal. The expectation (as I
understand it), is that Django projects are made up of applications.
If anything's assumed to be distributed, it's an application, not a
project. Sure, there are some exceptions for huge projects (like
Satchmo), but that's exac
On 11/2/07, Marty Alchin <[EMAIL PROTECTED]> wrote:
> Sure, there are some exceptions for huge projects (like
> Satchmo), but that's exactly the point: those are exceptions, not the
> rule.
And I should also add this: I'm a seasoned developer, and have been
hacking Dja
Also, note that I just put up a new patch for adding a
DurationField[1] and I just blogged about it as well.[2] Hopefully
this will help you out.
-Gul
[1] http://code.djangoproject.com/ticket/2443
[2] http://gulopine.gamemusic.org/2007/11/storing-passages-of-time.html
--~--~-~--~~--
> metaclass and code __set__ and __get__ directly, as Marty has done in
> his duration field).
Interesting approach with the metaclass, I hadn't considered that.
Just a one-line update to what seems like it should work, and all is
well. I'll get to work tonight, updating Durat
On 11/6/07, Frank 7200 <[EMAIL PROTECTED]> wrote:
> I have a Field class for attachments and I would like to rename the
> attachment after upload. This class inherits from models.ImageField.
>
> The problem is that in field method save_file() and _save() all values
> pointing to ID are None.
> new
On 11/7/07, Florian Lindner <[EMAIL PROTECTED]> wrote:
> But why does the root urls.py works that also contains the line
>
> from django.conf.urls.defaults import *
>
> or the manage.py script or another installed app in the same project
> directory?
If you post the whole contents of the 'xgm.Blo
Sorry folks, there was a bit of confusion with this thread, having
started out on django-developers. GMail didn't seem to think I really
wanted it to go to django-users instead, so I only just noticed it had
continued on django-developers. If you're interested in what's going
on, check the followi
On 11/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Unfortunately I don't think they solve my problem here - the rest of
> the page needs to be dynamic and driven by custom content; it's only a
> subset of the page elements that I want to be static in this way. I
> suppose what I'm looking
On 11/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I have to initially go live with this on Sunday (madness) but your
> project sounds really interesting. Definately something I would be
> interested in following. Do you have a message list for it or should I
> keep an eye on the google co
On 11/7/07, Florian Lindner <[EMAIL PROTECTED]> wrote:
> (r"^newComment/$", django.views.generic.create_update.create_object,
> dict(model=BlogComment))
Just as I suspected. You need quotes around
'django.views.generic.create_update.create_object' here. It's looking
for an object named 'djang
On 11/8/07, äL <[EMAIL PROTECTED]> wrote:
> Do I have an error in the import syntax? How can I import ROLE?
You don't. Just import Karateka and use Karateka.ROLE.
-Gul
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
On Nov 9, 2007 12:34 PM, Brot <[EMAIL PROTECTED]> wrote:
> I have defined a 500.html template in my root template directory.
> This template "extends" from my base.html template. In the base
> template I have something like:
>
>
> But if there is an 500 error in the admin interface, it seems th
On Nov 9, 2007 2:40 PM, James Bennett <[EMAIL PROTECTED]> wrote:
> If you want to specify a different handler for 500s, that's up to you,
> but be prepared for the inevitable complete breaking of your site when
> something running inside it raises another exception.
I think I'll settle for hardco
On 11/12/07, tunnel <[EMAIL PROTECTED]> wrote:
> 2) There is a "modules" module, that seems in similar shape. Repository
> hasn't much in it yet.
> http://code.google.com/p/django-modular/ Django-modular
> Does anyone else know of working code that can create
> widgets/portlets/modules on a page?
On Nov 13, 2007 11:03 AM, Peter <[EMAIL PROTECTED]> wrote:
> Also, is there a big reason to override this vs the _save_FIELD_file
> method as shown in this example:
> http://gulopine.gamemusic.org/2007/11/customizing-filenames-without-patching.html
I'll admit, that post was thrown together in a h
I'm generally with James on this, that users are already able to use
whatever they like; after all, it's just Python.
The one potential concern I have is, what about generic views? As far
as I can tell, if you want to change template systems, you'd have to
abandon the existing generic views. Eith
On Nov 16, 2007 7:41 AM, Tim Chase <[EMAIL PROTECTED]> wrote:
> - how to mark a field as redacted
My thought here would be to use some kind of modifier function that
you can wrap around a model's Fields.
fromo django.db import models
from redaction import redact
class Person(models.Model):
My first question would be: Are you absolutely certain that none of
those 1000 other people will ever need a login?
Basically, if any of those users would ever need to be promoted to
login status, the User model is your best bet. As Samuel mentioned,
just set "is_active" to False and probably set
On Nov 20, 2007 10:24 AM, Greg <[EMAIL PROTECTED]> wrote:
> self.create(50, 50, "round")
>
> def create(self, wsize, hsize, shape):
> var = self.get_shape_filename()
>
> In the above case I'm sending 'round' to the method. So it's supposed
> to be get_round_filename.
Well, to be fair, it
On Nov 20, 2007 2:22 PM, Nader <[EMAIL PROTECTED]> wrote:
> If I use the "python manage.py shell" to go to shell, I got the next
> message:
>
> _builtin__.exit += _exit
> TypeError: unsupported operand type(s) for +=: 'Quitter' and 'str'
>
> It is actually part of error.
> Some idea what the probl
ot;, "credits" or "license" for more information.
>
> On Nov 20, 9:01 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
>
> > On Nov 20, 2007 2:22 PM, Nader <[EMAIL PROTECTED]> wrote:
> >
> > > If I use the "python manage.py
On Nov 20, 2007 3:33 PM, Chris Hoeppner <[EMAIL PROTECTED]> wrote:
> It would be nice to be able to include this in the upload_to parameter.
> Something like
> 'upload/%(model_name)s/%(instance_id)s.%(mimetype_extension)s' perhaps?
> Maybe, if the parameter ends with a slash, the handler could kno
On Nov 20, 2007 3:36 PM, Nader <[EMAIL PROTECTED]> wrote:
> I have looked at my system and found that I has installed also
> Python-2.4.4 and IPython. I have firstly uninstalled Python-2.4.4 and
> tried once more the same command "python manage.py shell'' in project
> directory. I have got the sam
For the record, pyClamd[1] does look promising, as it supports
scanning streams as well as files. Even before the filestorage stuff
lands, you might want to check it out.
-Gul
[1] http://xael.org/norman/python/pyclamd/
--~--~-~--~~~---~--~~
You received this mess
On 11/20/07, Vance Dubberly <[EMAIL PROTECTED]> wrote:
>
> Before it's saved to a file... that would be tricky.
>
> But this might get you started: http://www.clamav.net/ . It'll run a
> daemon though I don't know if it opens sockets or ports...
If there are Python bindings for it, the upcoming
On Nov 28, 2007 10:12 AM, Ryan K <[EMAIL PROTECTED]> wrote:
> I have a basic registration form for my site that has fields for a
> postal code, state and a country. Since our site caters to
> international users, I only want to require a state and postal code
> only if the country is the United St
.
>
> Of course, the best solution would be including this functionality in
> the django core, since everything else is bound to get obsolete sooner
> or later, and most people wouldn't bother updating this to keep it up
> with the trunk.
>
> I've gone trough the links
I'm a bit confused as to what you're actually trying to accomplish
here. Will there always only be three fields (a, b and c), or will
they actually be dynamic (and you could have many of them). If three
is just an arbitrary number, I think you're looking at creating a new
Model, containing "new" a
On 12/3/07, omat <[EMAIL PROTECTED]> wrote:
> In the actual case I have more fields in the Record model, and
> repeating those fields in the Review model is not DRY.
Ah, I see now. Using just "a" "b" and "c", I didn't realize they
actually mapped directly to the other model.
> If I create a mode
On Dec 5, 2007 12:25 PM, DeliciousPy <[EMAIL PROTECTED]> wrote:
> As for Marty's response...
> >However, I haven't looked at what it
> > would take to actually commit changes to the already-synced tables. I
> > have a feeling Django Evolution[2] will help with this, but I haven't
> > done any test
I doubt the problem is with base.html itself, but there might still be
a mismatch of block names.
contact.html is expecting the following blocks to be defined in base.html:
* fulltitle
* header
* extrahead
* content-wrap
While thankyou.html is expecting the following blocks instead:
* billboar
You might take a look at my writeup on dynamic models,[1] which
specifically covers a way to specify Django models in a database,
which can be changed at run-time. However, I haven't looked at what it
would take to actually commit changes to the already-synced tables. I
have a feeling Django Evolu
On Dec 10, 2007 7:46 AM, Julien <[EMAIL PROTECTED]> wrote:
> In the following example, the "save_avatar_file" method is never
> called. However the "_save_FIELD_file" method is called.
> It looks a bit dirty to me, and I'd like to get rid of the
> "_save_FIELD_file method", to only use a method fo
On 12/10/07, l5x <[EMAIL PROTECTED]> wrote:
> Any ideas?
from django.newforms.models import ModelForm
-Gul
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
On 12/10/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> > from django.newforms.models import ModelForm
>
> That's not necessary. What the original poster is trying to do should
> work (it certainly does for me). ModelForms is imported into the
> django.newforms namespace.
Ah, okay. I hadn't
There are several things you need to know, so I'll lay them out.
1) You can get any Field instance from a class by using the
model._meta.get_field() method. Instead of your list comprehension,
just use the following line:
picfield = p._meta.get_field('picture')
2) If you read the comments in de
http://www.djangoproject.com/documentation/model-api/#verbose-name-plural
On Dec 11, 2007 2:37 PM, Goldy <[EMAIL PROTECTED]> wrote:
>
> I have a table ending in 'ery', however in the admin it is spelt 'ys',
> if course this is wrong it should end in 'ies'.
> Is it possible to change this?
> >
>
On Dec 11, 2007 3:42 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> When I try to run syncdb on a model which uses the PickledObjectField
> (see my sample model at http://dpaste.com/hold/27713/), I get this
> traceback:-
Your problem is that you're importing the PickledObjectField into your
c
You might look into databrowse[1], which is available in the SVN
version of Django. There are some screenshots[2] available as well, so
you can like to see what it's like.
-Gul
[1] http://www.djangoproject.com/documentation/databrowse/
[2]
http://www.flickr.com/photos/ubernostrum/2010704987/in/
On Dec 13, 2007 9:58 AM, sector119 <[EMAIL PROTECTED]> wrote:
> urlpatterns = patterns('django.views.generic',
> (r'^location/$', 'list_detail.object_list', location_list_info,
> name='locations-location_list'),
> )
In order to name your URLpatterns, you'll need to use the url() function.
ur
Ken,
There was someone else working on this recently as well, so you might
take a look at the conversation,[1] the beginnings of the code,[2] and
probably contact the author directly to see if you two can't share
ideas. It'd be a shame to duplicate effort. It'd be a great candidate
for a snippet.
On Dec 13, 2007 3:11 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Heh, I just picked this up, too! I got the field working almost
> straight away after your kind help (all apart from queries, which I
> haven't fixed yet as I've been traveling up until this evening)
Glad to hear you're makin
On Dec 17, 2007 7:05 PM, radioflyer <[EMAIL PROTECTED]> wrote:
> I have a Student model with a Foreign Key relationship to Teacher.
> When a teacher is removed, so go the students. Too dangerous for my
> particular scenario. There doesn't seem to be a Django feature that
> allows for adjusting the
On Dec 18, 2007 12:08 PM, Ryan K <[EMAIL PROTECTED]> wrote:
> def save(self, user):
> if user != self.scheduled_product.teacher:
> return False
> media = Media(name=self.cleaned_data['media'].filename,
> media=self.cleaned_data['media'].content
It looks like you've configured the built-in admin at "/admin/", and
you're defining your custom URLs *later* in the list of URL patterns.
This means that the admin's URL configuration will see
"/admin/display/12/" and assume it's supposed to route to its view for
an app named "display" and a mode
I'm guessing the problem is in one of the "..." portions of your view.
In particular, I'd be interested to see how you're instantiating your
form. If you're using "Information(request.POST)", that's your
problem. Try using "Information(request.POST, request.FILES)" instead,
and see if that helps.
On Dec 19, 2007 11:28 AM, Jiri Barton <[EMAIL PROTECTED]> wrote:
> My question is still the same though; is this the right way to work
> with ImageField (FileField)? I still feel this is awkward. One has to
> call methods on the model instead methods on the field to update it.
Currently, that is
On Dec 19, 2007 12:41 PM, Norman Harman <[EMAIL PROTECTED]> wrote:
> Now I find my self needing to save lists and restore python lists from db.
>
> save is np.
>
> def save(self):
> # must convert to_email list into string
> self.to_email = repr(self.to_email)
> su
My guess is that you're using 0.96, or if you're using SVN, you're
using a revision before r6269. I've just updated the wiki article to
reflect this requirement.
-Gul
On 12/20/07, worker <[EMAIL PROTECTED]> wrote:
>
> Hi to everybody,
> I need help from those who have already used AuditTrail:
>
I'm not sure what your end goal is here, but since you seem to be
storing settings in a database, you might consider my dbsettings
app[1], designed for exactly that purpose. I can't guarantee it does
what you need, but it's probably worth looking into.
To answer your question specifically though,
On Dec 21, 2007 10:05 AM, Gio <[EMAIL PROTECTED]> wrote:
> Hi all,
> I'm writing a custom field wishing to implement something similar to a
> multiplechoice.
> The problem is that when I run syncdb I receive a
> AttributeError: 'ListField' object has no attribute 'db_column'
> Any idea?
I didn't
Given that I've thought a bit about this not too long ago[1], I'll
pipe in with my little bit of philosophy, along with some advice on
the topic at hand.
Exceptions are, by definition, exceptional. They defy the rule. That
could mean errors, but it could also mean any other situation that a
parti
101 - 175 of 175 matches
Mail list logo