I would guess that this version:
messages = Message.objects.order_by('-created')[:2]
would be more memory efficient than the:
messages = Message.objects.all()
(and then using |slice:":2" to cut out the top 2)
although, I've done that second one often.
-- joe
On Nov 5, 6:56 am, "Ro
>From personal experience ...
The webfaction support crew is AWESOME and either interact with you at
a clue-level, if you have one ... or they will reach out and fix stuff
in your files, if you have somewhat less than a clue.
Their forums, FAQ and how-to docs are well populated.
And ... those a
Are you looking for something like 'django-tracking' ??
http://code.google.com/p/django-tracking/
I was just perusing this last night, for use on a site of mine.
-- joe
On Nov 1, 3:52 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I have found some post of 2007 on this argument but ma
To get an integer to print with leading 0s
print '%0d' % my_model.myinteger
To get an integer to print with 10 digits, filled with leading 0s
print '%0.10d' % my_model.myinteger
If you wanted this to be the default value shown for the model
def __unicode__(self): return u'%0.10d' % self.myinteg
1- Data loaded in DB from:
http://leathergallery.com/module/data/sql/products/Products.sql --
includes the phrase "Thinsulate®"
2- Django generic list_detail.object_list fails to render with:
Caught an exception while rendering: Could not decode to UTF-8 column
'product_desc' with text 'Black ga
ForeignKey never showing up in admin page.
But, oddly, I can get the model-form to show up in the OTHER models
admin form !!!
Set edit_inline in "FaqEntry" and *poof* ... the 'add entry' forms
show up when you are in the FaqCategory admin add-page !!!
Simplest darned model/ForeignKey example k
new news --
Add parent named 'foo', fill in some children, save ... parent exists,
no children exists.
Add admin-class to children code, so we can manually add children on
admin page.
Add a child *manually* linked to parent 'foo'.
View parent config --- VOILA, its there.
But ==> add 1 more chil
ditto -- just bumped into this today.
When I edit my "parent" class, can fill in 3 "children" ... but
only saves the parent. The database does not contain the 3 children I
added when creating the parent.
Children have a simple ForeignKey pointing back to parent with an
'inline_edit' setting ...
8 matches
Mail list logo