Re: Select only two posts from a database list and show them on a HTML page

2008-11-05 Thread JoeJ
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

Re: webfaction django installation

2008-11-02 Thread JoeJ
>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

Re: Keeping track of online users

2008-11-02 Thread JoeJ
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

Re: __str__, __unicode__ representation of model fields

2008-11-02 Thread JoeJ
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

render failed on utf-8 column ??

2008-09-15 Thread JoeJ
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 and edit_inline -- where'd it go?

2007-09-28 Thread JoeJ
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

Re: edit_inline problem

2006-09-13 Thread JoeJ
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

Re: edit_inline problem

2006-09-13 Thread JoeJ
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 ...