django vs raw sql insert speed

2010-07-17 Thread Almir Karic
http://gist.github.com/479348 This is the trivial test script that i created to test the speed of raw sql insert vs the one done in django, here is the result of that script on my laptop: sql: 0:00:00.832262 django: 0:00:03.074965 i tried passing force_insert=True to save() and it didn't seem

Re: how save data into more than one table?

2009-07-29 Thread Almir Karic
Over ride your models save() method (or use signals) to execute arbitrary code when a model is saved. On Wed, Jul 29, 2009 at 7:52 PM, Asinox wrote: > > Well im talking about save a form yes, but in the same moment i want > to save x data in another table, for example, i want to generate some > "

Re: User login

2009-07-18 Thread Almir Karic
what is wrong with absolute urls? :) python/django hacker & sys admin http://almirkaric.com & http://twitter.com/redduck666 On Sat, Jul 18, 2009 at 2:51 PM, AKK wrote: > > hi, > > i have a form like this: > >   >    User name: >     >    Password: >     id="password"> > > >     >     >   > >

Re: Dynamic var passing in queryset for date_based.archive_index

2009-07-15 Thread Almir Karic
} > {% endfor %} > > But it does not parse the html elements, namely  html tags like > and > are displayed simply like text. > > Any inputs on this? > > Thanks a lot, > Sonal. > > On Jul 15, 12:11 pm, Almir Karic wrote: >> I would make an wrapper view that s

Re: Dynamic var passing in queryset for date_based.archive_index

2009-07-15 Thread Almir Karic
I would make an wrapper view that sets up the queryset and calls the generic view. python/django hacker & sys admin http://almirkaric.com & http://twitter.com/redduck666 On Wed, Jul 15, 2009 at 11:28 AM, Sonal Breed wrote: > > Hi all, > I am using django.views.generic.date_based.archive_index

Re: Modular website with XML-based backend in Django?

2009-07-13 Thread Almir Karic
On Mon, Jul 13, 2009 at 3:44 PM, Sander wrote: > >  I've been asked to find the most appropriate framework with which to > implement the following: > > A website with > 1. Modules, which separate (partially user-configurable) style, from > user settings, from content. A bit like the igoogle module

Re: url as folder path possible?

2009-07-13 Thread Almir Karic
For real world deployment you should use your web server to do that. For apache that would be an Alias (and make sure the Alias get's to be served before everything is passed to django). For development purposes you should have a look at http://docs.djangoproject.com/en/dev/howto/static-files/

Re: Errors in installing django-photologue, Help Please?

2009-07-12 Thread Almir Karic
he user apps in dev/ directory in my home, and have PYTHONPATH pointed there. note, that if you want permanence you should also add the export line to your .bashrc (assuming you use bash). > > Best Regards. > > On Jul 13, 7:39 am, Almir Karic wrote: >> that problem means you don

Re: Errors in installing django-photologue, Help Please?

2009-07-12 Thread Almir Karic
that problem means you don't have permission to write to that dir :-), an easy way out is to run the setup.py script as root (for example via sudo) another way is to point your PYTHONPATH to where the "photologue" app resides. On Sun, Jul 12, 2009 at 4:03 PM, djangonoob wrote: > > Hi all, > > I'

auth backends?

2008-06-12 Thread Almir Karic
is there any way to authorize with ldap so that django doesn't store the data in it's table (eliminating the benefit of centralized administration ldap offers) ? given things like: - http://code.djangoproject.com/ticket/7282 - http://www.carthage.edu/webdev/?p=12 - http://groups.google.com/group

Re: Django and Linux distros

2008-05-16 Thread Almir Karic
On Fri, May 16, 2008 at 12:24 PM, JonSidnell <[EMAIL PROTECTED]> wrote: > What works for you? debian & vim, tho i'm considering switching to openbsd as my primary OS. -- For far too long, power has been concentrated in the hands of "root" and his "wheel" oligarchy. We have instituted a dictato

Re: This field is required. NO!

2008-05-16 Thread Almir Karic
On Fri, May 16, 2008 at 2:06 PM, Andre Meyer <[EMAIL PROTECTED]> wrote: > pn = models.CharField('Publication number', max_length=20, null=True) missing a 'blank=True' -- For far too long, power has been concentrated in the hands of "root" and his "wheel" oligarchy. We have instituted a dict

Re: Django Performance Discoveries Part 1

2008-04-26 Thread Almir Karic
On Sun, Apr 27, 2008 at 7:16 AM, Prairie Dogg <[EMAIL PROTECTED]> wrote: > Perhaps more on this to come. yes please :-) thanks for posting it -- error: one bad user found in front of screen --~--~-~--~~~---~--~~ You received this message because you are subs

Re: prepopulate_from

2008-04-10 Thread Almir Karic
On Thu, Apr 10, 2008 at 12:13 PM, Daniel Roseman <[EMAIL PROTECTED]> wrote: > > On Apr 10, 10:50 am, "Almir Karic" <[EMAIL PROTECTED]> wrote: > > i have an error caused by the following line (which worked without > > problems on regular django tru

[newforms-admin] prepopulate_from

2008-04-10 Thread Almir Karic
i have an error caused by the following line (which worked without problems on regular django trunk) slug = models.SlugField("url_prefix",max_length=50,unique=True,prepopulate_from=('name',),help_text='e.g. "janez_marijan_potokar_novak" (PAZI, SUMNIKI)') any ideas what am i doing wrong? Traceb

__init.py__ executed more than once?

2008-02-22 Thread Almir Karic
http://dpaste.com/36380/ here is my code as well as the error, it seems that __init__.py is executed more than once, any ideas why? any ideas how to fix it? (i am trying to follow the reccommandations from http://code.djangoproject.com/wiki/NewformsAdminBranch ) -- error: one bad user found i

Re: inline editing?

2008-02-21 Thread Almir Karic
ok, thanks /me goes in the corner RTFM :-) -- error: one bad user found in front of screen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@

Re: [newforms-admin] inline editing?

2008-02-21 Thread Almir Karic
On Thu, Feb 21, 2008 at 3:02 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Thu, Feb 21, 2008 at 3:55 AM, Almir Karic <[EMAIL PROTECTED]> wrote: > > > > > from django.db import models > > from django.contrib import admin > > > > > > # Create

[newforms-admin] inline editing?

2008-02-21 Thread Almir Karic
from django.db import models from django.contrib import admin # Create your models here. class Category(models.Model): name = models.CharField(max_length=50) def __str__(self): return self.name class Forum(models.Model): cat = models.ForeignKey(Category

Re: costumizing admin

2008-02-18 Thread Almir Karic
On Feb 18, 2008 2:22 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Feb 18, 2008 1:18 AM, Almir Karic <[EMAIL PROTECTED]> wrote: > > > > > it seems that the name of the template is hardcoded in the code > > > > def result_list(cl): > >return

Re: costumizing admin

2008-02-17 Thread Almir Karic
nge_list_results.html")(result_list) :( can anyone confirm this? On Feb 16, 2008 8:15 AM, Almir Karic <[EMAIL PROTECTED]> wrote: > i would like to change the way django admin writes out the results for > one object, the code i would like to change is located in > change_list_res

costumizing admin

2008-02-15 Thread Almir Karic
i would like to change the way django admin writes out the results for one object, the code i would like to change is located in change_list_results.html, however if i put that file in my templates/admin/// django doesn't seem to pick it up. any hints? -- error: one bad user found in front of sc

Re: django runserver freeze after 10-15 min

2008-02-15 Thread Almir Karic
On Fri, Feb 15, 2008 at 11:55 AM, diadya_vova <[EMAIL PROTECTED]> wrote: > > Thank you for quick response! > > Dev. server not crashes. It's stop to respond on browsers requests. > Yeah, Apache is better choice for this. > But I need this application to be portable. Without instalation. > Bec

Re: Displaying the id in admin

2008-02-11 Thread Almir Karic
probably something like (in your model) def __str__(self): return self.id On Feb 11, 2008 6:09 PM, Tom Badran <[EMAIL PROTECTED]> wrote: > Is there a way i can display the id of an object in the admin pages? I've > had a look over the docs and nothing jumps out. This is using django svn >

Re: custom admin action?

2008-02-10 Thread Almir Karic
thank you very much :) On Feb 10, 2008 12:31 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Sun, 2008-02-10 at 03:20 -0800, [EMAIL PROTECTED] wrote: > > i have an ImageField in my model (editable only by staff memebrs), i > > would like to generate a thumbnail everytime a staff memebe