Re: how to scale

2007-10-04 Thread Andrey Khavryuchenko
James, JB> On 10/3/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: >> The only thing django app should know is that there are two different >> *kinds* of servers: read-only and whole access. It doesn't matter how many >> servers you have - you may well

Re: how to scale

2007-10-04 Thread Andrey Khavryuchenko
AA> Am 03.10.2007 um 12:36 schrieb Andrey Khavryuchenko: AA> It's possible to use circular replication together with some free AA> load balancing software. As I've told earlier, I know perfectly about circular replication. AA> Then there's MySQL Proxy th

Re: how to scale

2007-10-03 Thread Andrey Khavryuchenko
JB> On 10/2/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: >> Shouldn't it? In case of MySQL replication (which is quite widely used) >> and transactions someone somehow *has* to decide where the whole >> transaction is going - to a master or to a slave.

Re: how to scale

2007-10-02 Thread Andrey Khavryuchenko
JB> As for database clustering, there's a philosophical issue here: Django JB> shouldn't need to know whether there's one database server behind it, JB> or five, or a hundred. Shouldn't it? In case of MySQL replication (which is quite widely used) and transactions someone somehow *has* to de

Re: Django Email Failure

2007-10-02 Thread Andrey Khavryuchenko
k> I am trying to use the send_email facility from django.core.mail with k> the following k> in my settings.py k> EMAIL_HOST = 'smtp-server.cfl.rr.com' k> EMAIL_PORT = '25' k> EMAIL_HOST_USER = 'username' k> EMAIL_HOST_PASSWORD = 'password' k> I get the error message: k> SMTP AUTH ext

Re: Data truncated for column 'text' at row 1

2007-09-25 Thread Andrey Khavryuchenko
SD> Data truncated for column 'text' at row 1 [...] SD> The POSTing works 'cause when I return to the site I can see the post. SD> I guess this has something to do with unicode or something, but I SD> don't really know where to look. SD> Any hint is really appreciated! This means exactly

Re: Using a Single Sign-on Server with Django

2007-09-25 Thread Andrey Khavryuchenko
NAA> Does anyone know of a single sign-on server that can be used with NAA> Django? Similar to the approach taken by Cosign NAA> or Pubcookie but without the fluff that is NAA> LDAP and Kerberos. Just a simple database of users and passwords to

Re: Capisdjango

2007-09-09 Thread Andrey Khavryuchenko
Chris, CH> Sure. Anyone to join me? Show me a code and I'll join, since have a nagging need for such tool. -- Andrey V Khavryuchenko Django NewGate - http://www.kds.com.ua/djiggit/ Development - http://www.kds.com.ua Call akhavr1975 on www.gizmoproject.com --~--~-~--~--

Re: Using multiples version of Django on the same server

2007-09-07 Thread Andrey Khavryuchenko
FS> I'm setting up a new server to host my Django projects and they don't FS> each use the same version of Django (0.95, 0.96 and svn). Is their a FS> way to configure each virtualhost to use their own version of Django ? Put each version in it's own directory (say, django-0.95 and django-0.9

Re: need help for transaction with postGreSql....

2007-09-06 Thread Andrey Khavryuchenko
s> I just wanna know how to do the trasnsaction with postgresql. If s> anyone has any clue / document, or has some working code on this s> issue, just send me the related excerpts. Quick google search on "django transaction" reveals http://www.djangoproject.com/documentation/transactions/

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Andrey Khavryuchenko
C> I'm curious, is there a way to do this without regenerating all of C> the code inside of the views.py file? C> I've been reading about setting up templatetags, would this work for C> what I want to do, and if so would it be better? Regenerating? The polls or latest_poll_list should some

Re: database permissions

2007-08-08 Thread Andrey Khavryuchenko
Steve, SB> Perhaps I am wrong, or just going about this the wrong way, but I have SB> been looking the Django documentation and asking around in #django and SB> nobody can (or do not want to) give me a straight answer and the minimum SB> database permissions Django needs to operate. So I am

Re: db mock for unit testing

2007-07-31 Thread Andrey Khavryuchenko
Russ, RK> On 7/29/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: >> >> I'm not using django's testing framework for several reasons: >> - I'm using django from 0.91 days and wasn't following django-users all >> this way >> -

Re: db mock for unit testing

2007-07-31 Thread Andrey Khavryuchenko
Russ, RK> On 7/29/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: >> >> So what advantages are there to the mocking approach over just replacing >> the setting? RK> Genuine mocking (as opposed to this proposal) has one really big RK> advantage - it's lightning fast. All the db-calls get

Re: db mock for unit testing

2007-07-29 Thread Andrey Khavryuchenko
Malcolm, MT> That isn't an answer to the question Russell asked, though. You can get MT> exactly the same end-effect (using in-memory SQLite) if you specify MT> SQLite as the database engine in the settings file you use for testing. MT> Deriving your testing settings file from the main settin

Re: db mock for unit testing

2007-07-28 Thread Andrey Khavryuchenko
Russell, RK> On 7/27/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: >> >> Then I've paused and wrote DbMock class for django that uses some black >> magic to steal django db connection and substitute it with temporary sqlite >> in-memory db. RK

db mock for unit testing

2007-07-27 Thread Andrey Khavryuchenko
I do hardcore test-driven development and hate when tests hit my mysql database (even local one). Things get only worse when testcases start demanding radically different datasets. Then I've paused and wrote DbMock class for django that uses some black magic to steal django db connection and sub

Re: Can Django call cscript.exe to run vbscripts

2007-07-27 Thread Andrey Khavryuchenko
b> Does someone have a solution ? Have you tried subprocess module mentioned before? What was your experience? BTW, it's nothing django-specific in calling external software from your python app... -- Andrey V Khavryuchenko Django NewGate - http://www.kds.com.ua/djiggit/ Devel

Re: transaction commit

2007-07-25 Thread Andrey Khavryuchenko
Nimrod, NAA> On 7/25/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: >> >> Yes, I read carefuly your question and thought the answer was >> >> straighforward. I don't understand why you don't want decorators, but >> >> you >&

Re: transaction commit

2007-07-24 Thread Andrey Khavryuchenko
NAA> On 7/25/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: >> Yes, I read carefuly your question and thought the answer was >> straighforward. I don't understand why you don't want decorators, but you >> could just check the decorator definition t

Re: Auth framework - initials et of users/groups ?

2007-07-24 Thread Andrey Khavryuchenko
Przemyslaw, PW> I'm just trying to do is using django.contrib.auth framework. PW> What I'd need is the possibility to create initial set of groups, users PW> and user-group assignements, when 'syncdb' is performed. PW> One option I see is to add custom statements to one of SQL files used to

Re: transaction commit

2007-07-24 Thread Andrey Khavryuchenko
Michal, MK> I suppose you read my question attentively and therefore you know that MK> I searched the web (and django documentation of course including the MK> transaction page). And I suppose you know that I was looking for MK> example how to use transactions without decorators. MK> The pr

Re: transaction commit

2007-07-24 Thread Andrey Khavryuchenko
MK> Hi, MK> I would like to use transactions (in MySQL and InnoDB). I know there MK> are decorators but I don't want to use them now. Is there any example MK> how to use transactions without decorators? I couldn't find anything MK> on django website, this user-group... Quick google on "djan

Re: Django Blocking/ Background Jobs

2007-07-23 Thread Andrey Khavryuchenko
Paul, PB> On Jul 23, 3:50 pm, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: >> Paul, >> PB> Are there any better approaches? I'm sure someone has needed PB> background tasks liked spidering, querying whois, downloading PB> images,... before,

Re: Django Blocking/ Background Jobs

2007-07-23 Thread Andrey Khavryuchenko
Paul, PB> Are there any better approaches? I'm sure someone has needed PB> background tasks liked spidering, querying whois, downloading PB> images,... before, without stalling the whole process. I'm using plain cron jobs that do regular jobs. There are plenty of example snippets describing

suggestion for sql error handling

2007-07-22 Thread Andrey Khavryuchenko
Hi! Sometimes we all get sql errors from our code. Nevertheless the traceback kind of File "/usr/lib/python2.4/site-packages/django/db/models/query.py", line 242, in count cursor.execute("SELECT COUNT(*)" + sql, params) File "/usr/lib/python2.4/site-packages/django/db/backends/util.py"

Re: Can Django call cscript.exe to run vbscripts

2007-07-20 Thread Andrey Khavryuchenko
b> I'm an Windows System Administrator and for my job i often use b> vbscripts to automate my tasks. I was wondering if Django can call b> cscript.exe to execute a vbscript file (Offcourse django is assumed to b> run under Windows)? I know that i can also script wmi with python but b> i'm al

custom order_by?

2007-07-18 Thread Andrey Khavryuchenko
Folks, In spirit of recent question regarding custom 'where'... Is there a way to put a custom ORDER BY into QuerySet? I have an sql function that does all the math on db side and would like to use it at order_by clause I quickly skimmed _get_sql_clause and haven't found any way to incorporate

Re: trunk, sqlite backend bug with date handlig

2007-07-07 Thread Andrey Khavryuchenko
Malcolm, Thanks, your answers helped to trace down the problem. It appeared that just sqlite connection was opened without proper 'detect_types' parameter. MT> On Sat, 2007-07-07 at 23:04 +0300, Andrey Khavryuchenko wrote: >> MT> On Sat, 2007-07-07 at 20:57 +0300

Re: trunk, sqlite backend bug with date handlig

2007-07-07 Thread Andrey Khavryuchenko
MT> On Sat, 2007-07-07 at 20:57 +0300, Andrey Khavryuchenko wrote: >> While I'm digging in sqlite backend sources, may anyone share his >> experience? MT> I just tried this with some models I have here using sqlite and they all MT> loaded DateTime fields as

trunk, sqlite backend bug with date handlig

2007-07-07 Thread Andrey Khavryuchenko
Hi! Had anyone noticed that loading DateField and DateTimeField from sqlite in-memory db results in getting plain strings instead of datetime objects? Code: f = models.Feed(feed_url='no such url', is_active=True) f.save() post = models.Post(feed = f, title='test post', l

Re: proper and easy way to urlencode unicode string?

2007-06-11 Thread Andrey Khavryuchenko
MT> I've just this minute committed a fix in [5461]. So let me know if there MT> are any further problems there, but it should at least not explode now. Thanks, see the change, will check how it performs now. -- Andrey V Khavryuchenko Django NewGate - http://www.kds.com.ua/djigg

Re: proper and easy way to urlencode unicode string?

2007-06-11 Thread Andrey Khavryuchenko
MT> On Mon, 2007-06-11 at 05:03 +0300, Andrey Khavryuchenko wrote: >> Malcolm, >> MT> On Tue, 2007-06-05 at 17:47 +0300, Andrey Khavryuchenko wrote: >> >> Well, I think here you've missed the point. Python fails *before* >> >> iriencode

Re: proper and easy way to urlencode unicode string?

2007-06-10 Thread Andrey Khavryuchenko
Malcolm, MT> On Tue, 2007-06-05 at 17:47 +0300, Andrey Khavryuchenko wrote: >> Well, I think here you've missed the point. Python fails *before* >> iriencode - during urlencode. Check the traceback again: MT> Ah, I see. For some reason I forgot to switch the urlenc

Re: proper and easy way to urlencode unicode string?

2007-06-05 Thread Andrey Khavryuchenko
MT> Have a look at the iriencode filter (only in the unicode branch, so MT> you'll need to read docs/templates.txt from the source). This handles MT> the last stage of encoding to ASCII. Thanks for pointer. MT> You cannot necessarily skip the urlencode portion, but you may be able MT> to.

proper and easy way to urlencode unicode string?

2007-06-05 Thread Andrey Khavryuchenko
Folks, I'm working on multiligual app using unicode branch and hit an interesting bit yesterday. I'm trying to present a (cyrillic) tag in url-ready form. Usually this is solved by {{ tagname|urlencode }} But when the 'tagname' contains non-ascii symbols, urlencode barfs: KeyError at