How can I NOT have the full result set from mysql copied into memory in django? I'm itterating over a BIG table which is blowing up my ram when the query copies.
It seems that mysql uses SSCursor for this purpose, and I can do all that with the mysql low level interface, but is there a Django way to do it?
...
Platform: Python 2.5, Django development root, PostgreSQL 8.4, Windows Vista Ultimate SP2.
Procedure: Django Documentation, Release 1.0, link text, Section 34.2, Providing initial SQL data.
CODE:
models.py:
class aisc_customary(models.Model):
MTYPE = models.CharField(max_length=4, editable=False,
...
I was wondering if there's any django module, or in such case any python module, that will allow me to create my own application to manage the creation, administration, etc of GnuPG keys, as well as the ability to sign and encrypt documents through this application?
If there's no such module, how can I do that?
Thank you.
...
Hi guys, i would like to make a django custom tag for display 10 entry title from the category where the user is reading a article... but how ill do?, i need to send the category from the actual entry...
Any idea?
Thanks
...
While looking across the Django documentation, I came across the FormPreview.
The description says this:
Django comes with an optional “form preview” application that helps automate the following workflow:
“Display an HTML form, force a preview, then do something with the submission.”
What is meant by "force a preview"? Wha...
Hi,django newbie here. I have an attempt of a registration page.
It consists of text fields (name, username, password, etc) and a DateField (birthday).
I'm trying to use a forms.DateTimeInput widget for the DateField, but when the page is rendered, nothing happens. Am i doing something wrong? Does this have something im overlooking? It...
I wish to test my django project form IDLE shell in windows.
I run following commands
from django.template import Template, Context
t = Template('test template')
but I get following error.
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
t = Template('test template')
File "C:\Program Files\Python26\...
I've got some Django content that I plan to host on a vps, web facing. It dynamically generates images that are cached to disk (regeneration is not often needed except (1)user changes content within image or (2) the layout is updated globally so all images need regeneration) right now when a user requests a view, it checks to see if what...
How on earth do people debug Django templatetags?
I created one, based on a working example, my new tag looks the same to me as the existing one. But I just get a
'my_lib' is not a valid tag library: Could not load template library from django.templatetags.my_lib, No module named my_lib
I know that this is probably because of someth...
I have a django project in which database values need to be updated fairly often on their own. There's a cronjob that runs to update these values in the database, but some of the operations require atomic transactions. Does anybody know how to make a model method be a complete transaction in django without going through views?
Ideally, ...
How do I get the domain name of my current site from within a Django template? I've tried looking in the tag and filters but nothing there.
...
I have a general question regarding the ordering in
the ManyRelatedManager object. For example,
There are two classes in my model: one is
called Book for books and another is Author for authors.
A many-to-many field is defined in class Book
authors = models.ManyToManyField(Author)
In database, the many-to-many relationship
is de...
Hee guys. I have a form with a dropdown for all companies. Now i want to display all the people that work for that company when the user changes the value in the company dropdown box without hitting the submit button on the form. Anybody have a good example for that?
tks
...
Hi guys, i have a simple search in my project, but my project is in Spanish , we have a lot of word with accents, and my search dont bring this word with accents.... there's any django /python function for this?
view.py
def search(request):
categorias = Categoria.objects.filter(parent__isnull=True) # menu
query = request.GET.ge...
By default, the admin models are grouped by the app, and the app name is in the caption (accounts, auth, etc.). How to override the name in the caption without writing the admin templates?
...
I'm trying to find an easy way to build forms which show dates in the Australian format (dd/mm/yyyy). This was the only way I could find to do it. It seems like there should be a better solution.
Things to note:
Created a new widget which renders date value in dd/mm/yyyy format
Created new date field to prepend the locate date for...
Hello (please excuse me for my ugly english :p),
Imagine these two simple models :
from django.contrib.contenttypes import generic
from django.db import models
class SomeModel(models.Model):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField(_('object id'))
content_object = generic.Generi...
I wasn't able to find a way to identify the type of a field in a django template. My solution was to create a simple filter to access the field and widget class names. I've included the code below in case it's helpful for someone else.
Is there a better approach?
## agency/tagutils/templatetags/fieldtags.py
##########################...
I've got a small snippet that I want in my sidebar. The snippet will be visible on each page, and while cheap to fetch (about 50ms on my super-slow netbook!), will change so infrequently that I'd quite like to cache it (partly because I've yet to use Django's cache framework, and I'd like to learn).
I'm not sure what the best way to go ...
Hi (sorry for my bad english :p)
Imagine these models :
class Fruit(models.Model):
# ...
class Basket(models.Model):
fruits = models.ManyToManyField(Fruit)
Now I would like to retrieve Basket instances related to all fruits.
The problem is that the code bellow returns Basket instances related to any fruits :
baskets = Baske...