return super(ContentView, self).render_to_response(context,
**response_kwargs)
On May 23, 3:01 pm, Brian Morton wrote:
> I have some legacy code that I used to dynamically load a template based on
> url if it exists and render a 404 if it doesn't exist.
>
> def content(request, t
I have some legacy code that I used to dynamically load a template based on
url if it exists and render a 404 if it doesn't exist.
def content(request, template_name='index'):
try:
return direct_to_template(request, '%s.html' % template_name)
except TemplateDoesNotExist:
r
I have a generic view that accepts its template_name attribute from
the urlconf dynamic variable:
(r'^(?P[^/]+)$', TemplateView.as_view()),
But I get an exception:
TemplateResponseMixin requires either a definition of 'template_name'
or an implementation of 'get_template_names()'
I've read the c
Can we see some code? The description of what you're doing sounds
just fine, so that leaves open the possibility of a technical error.
On Apr 28, 7:42 am, Sam Lai wrote:
> Maybe database connections aren't closing properly? Don't know where
> to start looking though.
>
> A few weeks ago, I saw s
This is a tough question for sure.
If you prefer Ruby syntax, then to me it seems clear. If it feels
clunky, it won't flow properly and you won't code as well.
Then again, you point out that you built a finished product quickly
and you're happy with it compared to what you built with Rails. Isn
log for MySQLdb and post here and in the ticket if I
can figure anything out.
On Oct 9, 2:18 pm, Karen Tracey wrote:
> On Fri, Oct 9, 2009 at 12:40 PM, Brian Morton wrote:
>
> > This is a very strange problem, so I thought I would post here and see
> > if anyone else had seen thi
This is a very strange problem, so I thought I would post here and see
if anyone else had seen this problem.
I introspected a MySQL database with Python2.6 using Django SVN HEAD
and it produced my models as expected. However, all CharFields have
the max_length set to 3x the actual varchar field
Very strange problem going on with one of my Django sites. This only
happens in my production env using Debian stable, Apache 2.2.9 with
mod_python and django trunk (updated).
All GET requests execute in a timely manner. However, all POSTs take
way too long. I've inserted debugging into my vie
D'oh. Thanks. I was confusing load and loads. I thought they were
the same thing.
On Apr 30, 12:55 pm, Malcolm Tredinnick
wrote:
> On Thu, 2009-04-30 at 09:47 -0700, Brian Morton wrote:
> > Thanks. That makes perfect sense. Since my session data is persisted
> > in the
n the pickle module accept a string as input and
output the unpickled data? I know it does it with file objects via
load, but I can't find any reference on how to do this with a string.
On Apr 30, 12:43 pm, Malcolm Tredinnick
wrote:
> On Thu, 2009-04-30 at 04:58 -0700, Brian Morton wr
I am considering filing an enhancement request but I want to check
first to make sure this functionality doesn't already exist.
Is there some way to make Django include the contents of session in
the traceback email received from a 500 error? It is very useful in
the case of debugging an error w
Given how expensive developer time is relative to current hardware
costs (especially on the x86 server platforms), it is almost always
more cost effective to throw hardware at the problem than it is to
spend countless hours porting apps from one language or framework to
another for performance rea
I am having trouble getting this script to work. My intent is to load
images into the db in bulk from the filesystem.
http://pastebin.com/m40565da9
When I execute this, I get the following error:
Traceback (most recent call last):
File "load_images.py", line 16, in
GalleryImage.objects.
>From the traceback, it would appear that one or more of your
processors is named or formed improperly. Can you post the code from
your setting.py file where you specify your processors? Not just the
strings, but the entire Python structure where you define those.
On Mar 1, 7:51 am, AKK wrote:
I am working with PIL to resize and thumbnail images during a model
save method. I am using SimpleUploadedFile as a wrapper to facilitate
the thumbnail field's save method. SimpleUploadedFile requires that
the proper content type be passed in as an argument.
The trouble is, I may be working wit
I am trying to do raw HTML output in a form field's label. I've tried
using mark_safe on the string being passed as the label argument, but
it is still escaped. Can anyone point me in the right direction
please?
--~--~-~--~~~---~--~~
You received this message beca
Thanks for the clarification. I will definitely look forward to
having file-like objects work this way. I'll keep my eye out for the
commit.
On Aug 27, 7:23 am, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 27, 2008 at 12:37 AM, Brian Morton <[EMAIL PROT
The docs (and an analysis of the code) indicate that the second
argument to save should be the content.
http://docs.djangoproject.com/en/dev/ref/files/file/#ref-files-file
I am assuming this is binary or text content to be written to the file
in question. ImageFieldFile calls get_image_dimensio
g for in
cleaned_data. Ideally, I need to capture the song ids that were
selected in some kind of iterable datatype, then loop through them and
look them up in the model to get info for output.
On Apr 11, 6:10 am, "Phil Davis" <[EMAIL PROTECTED]> wrote:
> On 11/04/2008, Brian
I have run into an interesting problem with newforms. I am trying to
create an arbitrary number of fields on a form based on model data.
This works fine.
class SonglistForm(forms.Form):
def __init__(self, *args, **kwargs):
super(SonglistForm, self).__init__(*args, **kwarg
2019 is an right single quote in unicode. Perhaps that title is
causing the problem? Did you paste it from some editor that would
have created it as that character rather than an apostrophe? Maybe
you should correct that by hand if it was pasted.
On Mar 6, 7:37 pm, "[EMAIL PROTECTED]" <[EMAIL
http://www.djangoproject.com/documentation/db-api/#select-related
On Dec 11, 1:18 pm, Joe <[EMAIL PROTECTED]> wrote:
> I've found the largest memory hog to be the native way related tables
> are setup.
>
> Check class definitions with related tables and edit as such:
>
> class ...(models.Mode):
>
Sorry, just saw your earlier post about debug being turned off. I
would say it is definitely time to start profiling your code.
On Dec 11, 2:11 pm, Brian Morton <[EMAIL PROTECTED]> wrote:
> Joseph raises a good point. I only recently discovered what a
> performance killer DEBUG
there athttp://www.djangosnippets.org/snippets/93/
>
> -joe
>
> On Dec 11, 2007 10:49 AM, Richard Coleman <[EMAIL PROTECTED]> wrote:
>
>
>
> > Brian Morton wrote:
> > > Are you serving static content from the same apache instance? Also,
> > > wh
Are you serving static content from the same apache instance? Also,
what kind of network connectivity do you have between your web and
mysql servers? It sounds like apache might need some tuning in terms
of thread parameters. Have you enabled caching yet? Turn on the
cache framework site-wide
, the "key" would repeat and the
row would not be inserted.
However, no exception was ever raised about a duplicate primary key on
save(). I am puzzled by this. Why would it not complain about a
primary key violation?
On Dec 5, 12:29 pm, "Karen Tracey" <[EMAIL PROTECTED]
I'm not sure what could be causing this problem. This is a loader
script that is loading a CSV and using the Django ORM to do lookups
and inserts. This is on a workstation with 1GB of memory running
Ubuntu Gutsy (the MySQL server is local also). I'm using MySQLdb
1.2.2 and there do not seem to
Thanks for the advice Malcolm. I am going to give this more thought
and see if I can come up with a generic high performance hash
function.
On Nov 30, 3:26 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2007-11-30 at 12:08 -0800, Brian Morton wrote:
> > I have an i
I have an interesting idea that I am not quite sure how to pursue.
I'm wondering if any of you have figured this out already.
What I would like to do is set the cache expiration for a particular
object in the cache to be very high, and then delete the item from the
cache when an instance of its m
Deleting your checkout and re-checking out the SVN tree couldn't
hurt. Can you tell us more about your environment? What OS? What
version of Python? What web server are you using?
On Oct 29, 3:53 am, oversize <[EMAIL PROTECTED]> wrote:
> Hello,
> my (very strange) problem is: When i want to e
I would remove your source built code and reinstall python2.5 and the
development package for it. Make sure any other versions of python
are uninstalled unless other packages depend on them.
On Sep 10, 3:11 pm, shabda <[EMAIL PROTECTED]> wrote:
> I am trying to deploy django on a fedora 7 system
What happens if you use a simple or dummy cache?
On Sep 9, 2:51 pm, Sasha Weberov <[EMAIL PROTECTED]> wrote:
> On Sep 9, 6:15 am, Thomas Badran <[EMAIL PROTECTED]> wrote:
>
>
>
> > My best guess would be that you are missing the / at the start and end
> > of the url
>
> > Tom
>
> > On Sat, 2007-0
/company/website and put the separate apps (based
on function) under the project.
On Sep 6, 4:49 pm, "Adam Jenkins" <[EMAIL PROTECTED]> wrote:
> On 9/6/07, Brian Morton <[EMAIL PROTECTED]> wrote:
>
>
>
> > Well, by its nature, each Django project has its own DB.
Well, by its nature, each Django project has its own DB. Multi-db
support is coming soon, but not in trunk yet.
If these are all applications that belong to the same project, Django
is not designed to handle them on a per-DB basis. The convention
Django uses is a DB for the project and _ for th
Also, do you have django.core.context_processors.request in your
context_processors? It looks like you're trying to overwrite a dict
element that already exists.
On Sep 6, 12:14 pm, Bram - Smartelectronix <[EMAIL PROTECTED]>
wrote:
> Hello Everyone,
>
> I have a request context which sets {'requ
Can we see your context processor code?
On Sep 6, 12:14 pm, Bram - Smartelectronix <[EMAIL PROTECTED]>
wrote:
> Hello Everyone,
>
> I have a request context which sets {'request':request}...
>
> On windows (dev-server) everything is fine and dandy, but on our live
> site (splicemusic.com, Apache2
class Hardware(models.Model):
blah = models.CharField()
...
#called every time the model instance is saved
def save():
#if you want many hardware history records for a piece of
hardware
history = HardwareHistory.create(hardware=self, ...)
#if you only want
It sounds like what you need to build is a custom ForeignKey type of
field that creates another table for that field. Then, you can store
an arbitrary number of revisions of that field, along with versioning
information, and a wrapper around diff that can perform the functions
you mention.
On Au
I'm not sure I really understand. It sort of sounds like you are
talking about a CharField with a choices argument. Is what you're
looking for more complex? Can you describe it in more detail?
On Aug 16, 4:06 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> Has there been any work on a "RevisionCont
Malcolm.
Resolving it takes newforms forward a giant step.
On Aug 15, 8:51 am, "Jonathan Buchanan" <[EMAIL PROTECTED]>
wrote:
> On 8/15/07, Brian Morton <[EMAIL PROTECTED]> wrote:
>
>
>
> > As I understand it, ticket 3297 is closed as resolved. However, I am
&
As I understand it, ticket 3297 is closed as resolved. However, I am
still experiencing problems uploading files in newforms as of the
latest svn checkout. Am I incorrect in my assumption that this has
been fixed? Or am I experiencing issues of my own? Thanks.
--~--~-~--~~---
Django also makes use of "messages" in the django.contrib.auth module
for this purpose. Of course, that only applies if you are using users
and authentication for your site. I think you can use them with
anonymous users though, so I think they will still work for you.
http://www.djangoproject.c
If you are using NewForms, you should implement this in the clean()
method for a field. See the newforms docs and unit tests for more
details.
On Jul 16, 4:49 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> OK, fixed the above problem -- figured out that it was related to my
> setting uniqu
I am getting the following error in my application's admin area trying
to add a record for a particular object. It seems to stem from the
fact that I am relating this record to a "member" object, and a member
is OneToOne with User. If I relate the object directly to User as a
foreignkey, I have
I have not done this before with Django, but I have set up a MySQL
cluster before. It is the same as a standard MySQL server. Just
connect to the management node as your SQL server.
On Jul 6, 3:01 pm, johnny <[EMAIL PROTECTED]> wrote:
> Is it even possible to run Django and MySQL Cluster or I h
I am trying to write a custom form that will handle updates for several
models. What is the best way to do this? Do I have to write a custom
manipulator to handle the data? Or can I create a hybrid view of
several different default manipulators?
--~--~-~--~~~---~
I can't figure out how to make a validation summary on a form. I have
examined the code in forms\__init__.py, and it reveals nothing about
where the complete list of field/error pairs are stored. I would like
to do a for loop on that dictionary and output a validation summary,
then mark each
47 matches
Mail list logo