I have a somewhat complex problem or at least it appears like this. In my project I'm dealing with really big image files uploaded by users. Storage is provided by separate media server which also generates thumbnails. Thumbnails are not created immediately, so there will be a cron function to check if they're ready. There are also files...
For example If I have the following models, views and code in a template...
class news(models.Model):
type = models.ForeignKey(----) (charfield)
title = models.CharField(max_length=100)
published = models.DateTimeField(default=datetime.now)
summary = models.CharField(max_length=200)
def ----():
items = news.objects...
I want to make a Google App Engine app that does the following:
Client makes an asynchronous http request
Server starts processing that request
Client makes ajax http requests to get progress
The problem is that the server processing (step #2) may take more than 30 seconds.
I know that you can't have threads on Google Application E...
Am having a real problem with the geodjango saving an entry.
It produces a "Error: Access Violation reading 0x???????"
The error does not indicate which file or folder it's trying to gain read/write access to.
Upon researching i found other non-django programs that also have this issue, some were fixed by turning off Vista's DEP control...
Hello,
is it possible to prevent certain fields to be edited after they've been saved?
They should be editable when the user creates a new item of a certain model but then when they try to open them to edit certain fields are 'blocked'.
thanks
...
hi,
I've got a new pet project: a pure django search app. I know there are some apps for searching (django-solr, solango, django-hackstack) but they all use a backend for high-end searching. I've got a little experience in information retrieval and natural language processing in general so I want to try to write another search app which...
Now to convert this strings to date time object in Python or django?
2010-08-17T19:00:00Z
2010-08-17T18:30:00Z
2010-08-17T17:05:00Z
2010-08-17T14:30:00Z
2010-08-10T22:20:00Z
2010-08-10T21:20:00Z
2010-08-10T20:25:00Z
2010-08-10T19:30:00Z
2010-08-10T19:00:00Z
2010-08-10T18:30:00Z
2010-08-10T17:30:00Z
2010-08-10T17:05:00Z
2010-08-10T17:05:...
The title says it all or almost... I have a slug field that I would like to be auto-populated from a value in a manytomany. It kind of works as it displays in realtime the ID of the selection in the manytomany field.
The model of the manytomany field has its own def unicode(self) to return a string value with its name but this doesnt app...
I'm trying to code an application that can work for several projects. I'm facing a problem that I have always to specify the name of the project when I do the imports like doing import some_project_name.models inside my app, how can I overcome this coupling so that I can use the app in several projects?
...
When Django is up, it handles 500 errors. When Django is screwed,
mod_python will throw a bare bones "Internal Server Error." This is
described well in the docs at the following link:
http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#error-handling
My question: Is there a way to override that "Internal Server Error"
page...
Hi, i've got a problem when i'm doing dev
I managed to use
python manage.py runserver in a CMD shell
but the system cant find python
How could I add python to the system dependency to make the commandline work?
...
I have a task that runs in a celerybeat instance. When that talk is executed, it sometimes modifies a model object, which should fire off a post/pre_save signal, but it doesn't. The signal is not happening. I imagine this is due to django's signals being synchronous while celery is doing it's thing on a different server in a different th...
I am using django-storage's Mosso backend to store image files in the Rackspace CDN. However, I am facing very slow page loads due to the back and fourth of model.image_field.url lookups to the api. Does anyone know a good way to cache this value?
...
I am still a bit confused about the relation of Proxy models to their Superclasses in django. My question now is how do I get a instance of a Proxy model from an already retrieved instance of the Superclass?
So, lets say I have:
class Animal(models.Model):
type = models.CharField(max_length=20)
name = models.CharField(max_length=...
hi, i'm using the Apache Batik SVG Rasterizer Library in python, but when i try to convert a svg into png i get this error Gtk-WARNING **: cannot open display:
How can i do to don't use GTK to convert the SVG file
Thanks and sorry for my english!
...
Is there a way I can serialize a FloatField model instance in django? I have the following in a management command:
def chart_data(request):
i = 1
chart = open_flash_chart()
chart.title = t
for manager in FusionManagers.objects.all():
net_data = manager.netio_set.values_list('Net', flat=True)
clean = seria...
I have a view that returns my sales summary grouped by sales_date e.g.
[{'sale_date':datetime.datetime(2010,10,5,0,0), 'salesum':2, 'item':1},
{'sale_date':datetime.datetime(2010,10,5,0,0), 'salesum':10,'item':3},
{'sale_date':datetime.datetime(2010,10,6,0,0), 'salesum':1, 'item':1}]
I have done the grouping inside the template, and...
Using for example
class model(models.Model)
....
def my_custom_method(self, *args, **kwargs):
#do something
When I try to call this method during pre_save, save, post_save etc, Python raises a TypeError; unbound method.
How can one add custom model methods which can be executed in the same way like model.objects.get()...
One very annoying thing with strict MVC is that you can make the smallest processing in template. While it's usually a good practice, in this case it gets in the way:
I make a for loop on a queryset of a lot of objects and display some attributes;
Attributes are properties, making heavy processing (I don't want to trigger them twice).
...
What I'm looking for is a piece of Django middleware that catches a FileNotFound exception and attempts to rsync the file from the production webserver. This way you can develop your site with a copy of production data without having to continually rsync down all the uploaded files.
I'm sure I've seen a solution to this problem on the i...