Re: Best way to (re)load test data in Mongo DB

2019-02-25 Thread Martin Sand Christensen
Nagy László Zsolt writes: > We have a system where we have to create an exact copy of the original > database for testing. The database size is over 800GB. [...] That all sounds pretty cool, but it's precisely the opposite of what I'm trying to acheive: keeping things as simple as possible.

Re: Best way to (re)load test data in Mongo DB

2019-02-24 Thread Martin Sand Christensen
breamore...@gmail.com writes: > I was going to suggest mocking. I'm no expert so I suggest that you > search for "python test mock database" and go from there. Try to run > tests with a real db and you're likely to be at it until domesday. Mocking is definitely the order of the day for most

Best way to (re)load test data in Mongo DB

2019-02-23 Thread Martin Sand Christensen
Hi! I'm toying around with Pyramid and am using Mongo via MongoEngine for storage. I'm new to both Pyramid and MongoEngine. For every test case in the part of my suite that tests the data access layer I want to reload the database from scratch, but it feels like there should be a better and

Templating and XML modelling

2012-11-13 Thread Martin Sand Christensen
looking for? -- Martin Sand Christensen IT Services, Dept. of Electronic Systems -- http://mail.python.org/mailman/listinfo/python-list

Re: How decoupled are the Python frameworks?

2009-12-08 Thread Martin Sand Christensen
aside, allow me to recommend Meld3 as a good templating library. It's basically ElementTree with a lot of practical templating stuff on top, so it's not a mini-language unto itself, and you don't embed your code in the page. -- Martin Sand Christensen IT Services, Dept. of Electronic Systems

Re: How decoupled are the Python frameworks?

2009-12-08 Thread Martin Sand Christensen
little experience with other frameworks than CherryPy, so I do not want to draw any general conclusions. My programmer's instincts say that it's true, though. -- Martin Sand Christensen IT Services, Dept. of Electronic Systems -- http://mail.python.org/mailman/listinfo/python-list

Re: New CMS in Python

2008-07-31 Thread Martin Sand Christensen
there's actually something to work on. And that means that you should have a reasonably clear idea where you're going before setting out. Anyway, the best of luck to you! -- Martin Sand Christensen IT Services, Dept. of Electronic Systems -- http://mail.python.org/mailman/listinfo/python-list

Re: how would you...?

2008-05-19 Thread Martin Sand Christensen
inhahe == inhahe [EMAIL PROTECTED] writes: inhahe Btw, use float() to convert a textual GPA to a number. It would be much better to use Decimal() instead of float(). A GPA of 3.6001 probably doesn't make much sense; this problem doesn't arise when using the Decimal type. Martin --

Why don't generators execute until first yield?

2008-05-07 Thread Martin Sand Christensen
Hi! First a bit of context. Yesterday I spent a lot of time debugging the following method in a rather slim database abstraction layer we've developed: , | def selectColumn(self, table, column, where={}, order_by=[], group_by=[]): | Performs a SQL select query returning a single column

Re: Why don't generators execute until first yield?

2008-05-07 Thread Martin Sand Christensen
Ian == Ian Kelly [EMAIL PROTECTED] writes: Ian Isn't lazy evaluation sort of the whole point of replacing a list Ian with an iterator? Besides which, running up to the first yield when Ian instantiated would make the generator's first iteration Ian inconsistent with the remaining iterations.

Re: Why don't generators execute until first yield?

2008-05-07 Thread Martin Sand Christensen
Duncan == Duncan Booth [EMAIL PROTECTED] writes: [...] Duncan Now try: Duncan Duncanfor command in getCommandsFromUser(): Duncanprint the result of that command was, execute(command) Duncan Duncan where getCommandsFromUser is a greedy generator that reads from stdin, Duncan and see

Re: Code folder with Emacs

2008-03-25 Thread Martin Sand Christensen
Grant == Grant Edwards [EMAIL PROTECTED] writes: Grant Has anybody figured out how to do code folding of Python source Grant files in emacs? I use outline-minor-mode with the following home baked configuration: ;; Python stuff for outline mode. (defvar py-outline-regexp ^\\([

Re: new style class

2007-11-02 Thread Martin Sand Christensen
gert == gert [EMAIL PROTECTED] writes: gert Why doesn't this new style class work in python 2.5.1 ? Whether you declare your class as a new style class or an old style class, your code is completely and utterly broken. Calling non-existing methods has never been a good way of getting things

Re: Copy database with python..

2007-11-02 Thread Martin Sand Christensen
Abandoned == Abandoned [EMAIL PROTECTED] writes: Abandoned Yes i understand thank you. Now i find that maybe help the Abandoned other users. Abandoned import os Abandoned os.system(su postgres) Abandoned ... I get the distinct impression that you're trying to replace simple shell scripting

Re: Copy database with python..

2007-11-02 Thread Martin Sand Christensen
Abandoned == Abandoned [EMAIL PROTECTED] writes: Abandoned I want to copy my database but python give me error when i Abandoned use this command. cursor.execute(pg_dump mydata old.dump) Abandoned What is the problem ? cursor.execute() is for executing SQL commands, and this is not an SQL

Re: Proxying downloads

2007-10-30 Thread Martin Sand Christensen
But I can't figure out how I would solve the following: 1 Alice asks Sam for foobar.iso 2 Sam can't find foobar.iso in cachedir 3 Sam requests foobar.iso from uplink 4 Sam saves and forwards to Alice 5 At about 30 % of the download Bob asks Sam for foobar.iso 6 How do I serve Bob now? Let