Re: django deserialize and save new model object from xml

2008-12-26 Thread Russell Keith-Magee
On Wed, Dec 24, 2008 at 6:33 AM, dick...@gmail.com wrote: > > looking at the serialization serializers, is is possible to save "new" > instance of a model object represented in xml? > > i'm getting an error: > > node is missing the 'pk' attribute, but basically, there > isn't

Re: Fastest way to import datas into a database

2008-12-26 Thread Russell Keith-Magee
On Thu, Dec 25, 2008 at 9:02 AM, bsergean wrote: > > Hi all, > > I'm populating my database manually using a script that create ORM > objects and save them... I have a lot of datas and it's fairly slow. > I'm wondering what is the best way to speed this up. > > From >

Re: Is there any possibility that one project connect with more than one databases?

2008-12-26 Thread Russell Keith-Magee
On Thu, Dec 25, 2008 at 5:41 PM, David wrote: > > Dear all, > > I am a newbie in Django and python, now trying to construct a website > with more than one databases on the backend. > > My question here is, if there any possibility that using 2 different > databases inside one

Re: How do I make Django evaluate a ForeignKey for json serialization?

2008-12-27 Thread Russell Keith-Magee
On Sat, Dec 27, 2008 at 2:11 PM, adambossy wrote: > > I have a model that refers to a ForeignKey, e.g.: > > class Template(models.Model): > type = models.ForeignKey(Type) > ... > > class Type(models.Model) > name = models.CharField(max_length=32) > ... > > I can fetch

Re: Calculate and store the average rating

2008-12-27 Thread Russell Keith-Magee
On Sat, Dec 27, 2008 at 7:48 AM, eldonp2 wrote: > > Is there a way to calculate and store the average rating in this > example: It's not entirely clear which part of this problem you want help with. - Computing the average rating. The brute force approach would be to

Re: Traceback in the ``runserver`` console

2008-12-27 Thread Russell Keith-Magee
On Sat, Dec 27, 2008 at 2:32 AM, Fridrik Mar Jonsson wrote: > > Hi Djangonians, > > I recently had an instance where it would have been really convenient > to see the error and a traceback in the ``runserver`` console instead > of just a single line telling me that the

Re: Invalid block tag: 'get_comment_count'

2008-12-27 Thread Russell Keith-Magee
On Sun, Dec 28, 2008 at 12:27 AM, Florian Lindner wrote: > > Hello, > > I'm trying to use the comment framework from Django 1.0.2. > > I've followed all the steps in > http://docs.djangoproject.com/en/dev/ref/contrib/comments/ > > (added it to installed apps, added to

Re: How do I make Django evaluate a ForeignKey for json serialization?

2008-12-27 Thread Russell Keith-Magee
On Sun, Dec 28, 2008 at 5:32 AM, adambossy wrote: > > Russ, > > Thanks for the reply. Specifically, I am wondering if there is some > feature of the Models API that allows me to retrieve the foreign key > object so that it is included in the serialized string. That is, >

Re: Django serializers and local/inherited model fields

2008-12-30 Thread Russell Keith-Magee
On Wed, Dec 31, 2008 at 4:27 AM, psj wrote: > > Django's base serializers only serialize a model's local fields, not > inherited ones, which seems odd at first blush (if an Employee is a > Person, and a Person has a name, wouldn't I be likely to want to see > the

Re: Getting SQL from QuerySet

2008-12-30 Thread Russell Keith-Magee
On Wed, Dec 31, 2008 at 5:11 AM, Info Cascade wrote: > > Hi -- > > I am getting intermittent errors on certain database queries on our > production server. > I am having a hard time duplicating them (most of the time they run > okay, only sometimes on the production

Re: specify alternative settings.py file at startup

2008-12-31 Thread Russell Keith-Magee
On Wed, Dec 31, 2008 at 11:45 AM, dick...@gmail.com wrote: > > i'm confused on the --settings option on manage.py. > > if i have a project call foo, i'd have in ./foo/settings.py > > to run: python manage.py runserver 8080 > > let's say i have a bar.settings.py which contains

Re: about templatetags

2008-12-31 Thread Russell Keith-Magee
On Thu, Jan 1, 2009 at 8:18 AM, Alan wrote: > Happy new year List! > So, I have in a project several apps and they basically use the same > templatetags. I found out by luck that I just need to define it in one > application, something like: > app1/ > models.py > ... >

Re: SimpleDB Support

2008-12-31 Thread Russell Keith-Magee
On Thu, Jan 1, 2009 at 3:21 AM, Travis Reeder wrote: > > I've read some old threads discussing this, but I'm wondering if any > progress has been made? There certainly isn't anything official to report. Adding support for SimpleDB, CouchDB, Google AppEngine, HBase, or any

Re: manage.py test without using a database?

2008-12-31 Thread Russell Keith-Magee
On Wed, Dec 31, 2008 at 7:08 AM, Bo Shi wrote: > > Hi, > > One of our django applications does not use django's ORM. Is there a > way to run > > ./manage.py test my_app > > Such that it does not perform test database setup? There are two ways that you could do this. The

Re: about templatetags

2009-01-01 Thread Russell Keith-Magee
On Fri, Jan 2, 2009 at 1:01 AM, Alan wrote: > Hi Russell > Thank you very much for your explanation. > I understand that being an apps reusable, should it be so its templatetags > and so, probably, the best place is in apps folder. > However, in my case, where all my apps

Re: is it possible to provide initial data for a model with a foreign key to User model?

2009-01-03 Thread Russell Keith-Magee
On Sat, Jan 3, 2009 at 3:01 AM, adrian wrote: > > > I happen to have a bunch of models that all have foreign keys, but > there is an order in which they could all be initialized. I have > figured out how to initialize the built-in User model using Json data, > but I can't

Re: Why Django doesn't force testing?

2009-01-05 Thread Russell Keith-Magee
On Mon, Jan 5, 2009 at 9:04 PM, HB wrote: > > Sure, I mean encourage not force :) Ok, then - what could we do to encourage testing? We have a test framework; it is documented, there are plenty of blog entries around that discuss how to use it, and there are some utilities

Re: django and database views

2009-01-05 Thread Russell Keith-Magee
On Mon, Jan 5, 2009 at 11:31 PM, drakkan wrote: > > Hi all, > > I mapped a database view in django model as a normal database table, ... > there is a know workaround for this? any way to declare read only the > model? In short, no. Django doesn't currently provide any

Re: django and database views

2009-01-05 Thread Russell Keith-Magee
On Tue, Jan 6, 2009 at 8:11 AM, drakkan <drakkan1...@gmail.com> wrote: > > > > On 6 Gen, 00:06, "Russell Keith-Magee" <freakboy3...@gmail.com> wrote: >> On Mon, Jan 5, 2009 at 11:31 PM, drakkan <drakkan1...@gmail.com> wrote: >> >>

Re: license problem

2009-01-05 Thread Russell Keith-Magee
On Tue, Jan 6, 2009 at 7:46 AM, Sebastian Bauer wrote: > > Hello, i want to release some code, but i have one problem: > > how impel peoples to send me back patches? > > Any suggestions are welcome :) First, participate in the dark arts until to ascend to the level of minor

Re: Permissions: is something wrong with them?

2009-01-06 Thread Russell Keith-Magee
On Tue, Jan 6, 2009 at 4:26 AM, Artem Skvira wrote: > On Jan 2, 6:26 pm, Artem Skvira wrote: >> Would anyone be able to comment on the issues raised? > Can I get Russell's comment on that? I'm not entirely sure why I've been flagged personally on

Re: Speeding up the tests, what am I missing?

2009-01-06 Thread Russell Keith-Magee
On Wed, Jan 7, 2009 at 4:51 AM, Todd O'Bryan wrote: > > So, I've been trying to speed up tests. Surprise. I came across a > fairly easy solution, so I'm sure I must be missing something. If > someone could tell me what I'm missing, I'd really appreciate it. ... >

Re: Related articles based on keywords.

2009-01-10 Thread Russell Keith-Magee
On Sat, Jan 10, 2009 at 6:27 AM, Ariel Mauricio Nunez Gomez wrote: >>> In the view for a single article, I would like to be able to pull up >>> related articles based on shared keywords. Just pulling up all the >>> articles that share at least one keyword would be to

Re: Forcing content_types.json to be loaded before any other fixtures

2009-01-13 Thread Russell Keith-Magee
On Wed, Jan 14, 2009 at 9:34 AM, Giovannetti, Mark wrote: > > Is there a way to force a fixture to be loaded first > when running manage.py test? > > I'd like to load a content_types.json fixture immediately > before any other fixtures are loaded. > > This

Aggregates come to Django

2009-01-15 Thread Russell Keith-Magee
Hi all, For those watching trunk, revision 9742 added aggregate support to Django. (Yay!) The short version is that Querysets now have two additional operations - annotate() and aggregate(). For details on how to use these new operations, see the documentation:

Re: Traceback in the ``runserver`` console

2009-01-18 Thread Russell Keith-Magee
On Sun, Jan 18, 2009 at 8:25 PM, Simon Forman <sajmik...@gmail.com> wrote: > > On Dec 27 2008, 5:14 am, "Russell Keith-Magee" > <freakboy3...@gmail.com> wrote: >> On Sat, Dec 27, 2008 at 2:32 AM, Fridrik Mar Jonsson <fridr...@gmail.com> >> wrote:

Re: How do i display a count of items related to a model?

2009-01-22 Thread Russell Keith-Magee
On Thu, Jan 22, 2009 at 10:37 PM, Gath wrote: > > In Django how can i return the total number of items (count) that a > related to another model, e.g the way stackoverflow.com does a list of > questions then on the side it shows the count on the answers related > to that

Re: Setting a field based on foreign key data

2009-01-22 Thread Russell Keith-Magee
On Thu, Jan 22, 2009 at 10:57 PM, jason.t.stein wrote: > > Perhaps this is an sql question, and not a Django question so please > have patience. I am writing a student management app that keeps track > of student events. The relevant tables are: > > class

Re: Fixtures in production use - best practices

2009-01-22 Thread Russell Keith-Magee
On Fri, Jan 23, 2009 at 5:31 AM, Delta20 wrote: > > Fixtures are geared towards unit testing; I'm wondering if they are > considered a good way to populate the database with some initial > default values. > > For example, say we have a model TicketState, and the

Re: Comparing values from multiple tables; *show new posts* forum feature

2009-01-23 Thread Russell Keith-Magee
On Fri, Jan 23, 2009 at 4:19 PM, Piotr Husiatyński wrote: > > On 18 Sty, 12:06, Malcolm Tredinnick wrote: >> Wait a few days until ticket #7210 is resolved and you'll be able to use >> references to other fields as rhs values in filters. The

Re: Adding a slug

2009-01-24 Thread Russell Keith-Magee
On Sun, Jan 25, 2009 at 2:14 AM, Adi Sieker wrote: > > Hi, > > as far as I know loaddata doesn't use the ORM to insert the data. Incorrect. loaddata does use the ORM, but it uses raw save mode, which disables custom save methods. Raw save mode also disables any database field

Re: How to access mail.outbox

2009-01-25 Thread Russell Keith-Magee
On Mon, Jan 26, 2009 at 12:20 AM, Oleg Oltar wrote: > Hi! > I am trying to write nose tests for my django application. One of the points > is to check if > emails are sent properly. > The suggested in the doc >

Re: Django docs and automation tests

2009-01-25 Thread Russell Keith-Magee
On Mon, Jan 26, 2009 at 12:32 AM, Oleg Oltar wrote: > Hi! > Can you please explain me idea of testing django applications with Client() > There many examples in doc, where test cases just checked the > response.status_code == 200, > But I am often getting 302 instead of

Re: Multithreaded development server

2009-01-25 Thread Russell Keith-Magee
On Sun, Jan 25, 2009 at 10:45 PM, Almad wrote: > > For those interested, patch from #3357 works nicely and can be started > from within: > http://devel.almad.net/trac/django-sane-testing/changeset/d2c24247d7e4 > > However, it's still buggy for my case. If You want it too, You

Re: XML Serialization Speed

2009-01-26 Thread Russell Keith-Magee
On Tue, Jan 27, 2009 at 12:35 AM, Taylor wrote: > > Okay, that makes sense. Thanks for the link to Python timing! > > Can anyone familiar with the internals of django's serialization and > templating offer any suggestions? My suggestion is this: Try it. I can't say I've

Re: GROUP BY

2009-01-26 Thread Russell Keith-Magee
On Tue, Jan 27, 2009 at 10:55 AM, Glenn Maynard wrote: > > How are aggregates grouped on anything other than a simple column? I'm a little bit confused as to what you think is happening here - what do you mean by "other than a simple column"? The default aggregate

Re: GROUP BY

2009-01-26 Thread Russell Keith-Magee
On Tue, Jan 27, 2009 at 1:20 PM, Glenn Maynard <glennfmayn...@gmail.com> wrote: > > On Jan 26, 10:20 pm, Russell Keith-Magee <freakboy3...@gmail.com> > wrote: >> I'm a little bit confused as to what you think is happening here - >> what do you mean by "ot

Re: Multithreaded development server

2009-01-27 Thread Russell Keith-Magee
On Tue, Jan 27, 2009 at 11:21 PM, Almad wrote: > > P.S.: Sorry for the sarcastic tone of my e-mail. I appreciate Your > work as well as Django framework (or at least some parts of it), but I > just don't get it: for each and every project I've written in Django, > I banged my

Re: Creating test databases. Nose framework

2009-01-27 Thread Russell Keith-Magee
On Wed, Jan 28, 2009 at 5:51 AM, Oleg Oltar wrote: > Hi! > I am trying to create few nose test for my application. > I need to test registration/login, so want to create a test sqlite3 > database, and pre-populate it with some data. > No sure how to do it. > I created a

Re: About django validation system

2009-01-28 Thread Russell Keith-Magee
On Wed, Jan 28, 2009 at 8:45 PM, Matias Surdi wrote: > > Shouldn't validation be defined in the modell instead of the forms? There are cases where form validation is the right thing to do - for example, if you have a web form that isn't backed by a model. However, there

Re: Changing database fields

2009-01-28 Thread Russell Keith-Magee
On Thu, Jan 29, 2009 at 6:53 AM, Mark Jones wrote: > > This is where Rails rocks and DJango doesn't. I haven't been able to > find any kind of DB Migrations in Django like those in Rails. Sad > too, because other than that, Python is a lot nicer than Ruby (Syntax > wise for

Re: ContentTypes and fixtures

2009-01-28 Thread Russell Keith-Magee
On Thu, Jan 29, 2009 at 7:36 AM, Oliver Beattie wrote: > > How can I be sure that the ContentType IDs are always constant, and > therefore my data in fixtures is guaranteed to always point to the > right object? Oliver, meet ticket #7052. Ticket #7052, meet Oliver :-) This

Re: Improving the response time in Django Admin

2009-01-28 Thread Russell Keith-Magee
On Thu, Jan 29, 2009 at 7:41 AM, Tipan wrote: > > Can anyone suggest some areas to explore to improve the response time > on the Admin. We're currently on release 7476 (pre new forms admin), > but due to go to the latest development release next week, although > I'm not sure

#7210 - F() Query Expressions

2009-01-29 Thread Russell Keith-Magee
Hi all, With [9792], I've committed F() query expressions to trunk. For details, see the docs: http://docs.djangoproject.com/en/dev/topics/db/queries/#filters-can-reference-fields-on-the-model There are two caveats worth knowing about: 1) This patch reveals a bug in the SQLite package that

Re: #7210 - F() Query Expressions

2009-01-29 Thread Russell Keith-Magee
On Fri, Jan 30, 2009 at 2:47 AM, koenb wrote: > > This is really great! Thanks all for the good work. > > Just curious, has there been any work done to make this also work for > dates ? > > like in > > longevents =

Re: #7210 - F() Query Expressions

2009-01-30 Thread Russell Keith-Magee
On Fri, Jan 30, 2009 at 7:59 PM, koenb wrote: > >> As committed, the expressions framework is fairly dumb - it is really >> just a way to do two things: >> 1) Expand Django-style field references into column names (and joins >> if required) >> 2) Turn Python

Re: guidance on serialization

2009-01-30 Thread Russell Keith-Magee
On Fri, Jan 30, 2009 at 7:30 AM, Jason Geiger wrote: > > Hello all. Say I have some models like these: > > class Image(models.Model): >file = models.ImageField(upload_to=get_image_path) > > class Line(models.Model): >image = models.ForeignKey(Image) >color =

Re: "invalid reference to FROM-clause" for nested annotate query

2009-01-31 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 12:44 AM, omat wrote: > > Hi all, > > I obtain a list of tag ids by: > tag_ids = TaggedItem.objects.all().order_by('-added__max').annotate(Max > ('added'))[:10] > > and try to use it in the following query to obtain tag objects: >

Re: commit=False and m2m relations in forms

2009-02-01 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 9:53 PM, Konstantin <ktechli...@gmail.com> wrote: > > On Feb 1, 2:23 pm, Russell Keith-Magee <freakboy3...@gmail.com> wrote: >> Yes. Read up on how to use the save() method in the modelforms docs. >> >> http://docs.djangoproject.com/en/

Re: Someone using django trunk for production?

2009-02-01 Thread Russell Keith-Magee
On Sat, Jan 31, 2009 at 7:24 PM, Alessandro Ronchi wrote: > > I need to use aggregation features of django 1.1 (i need AVG, SUM). > > My production site uses 1.0.2. > > Can I upgrade to trunk without worrying? Would I expect to see any major failures? No. Would I

Re: Using ./manage.py test without a database and with a custom test runner fails

2009-02-01 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 7:42 PM, Jarkko Laiho wrote: > >> The doc about defining a different test runner starts with the assumption >> you are not using Django's test framework -- I read that to mean you are not >> using django.test.TestCase tests, for example. You can't

Re: commit=False and m2m relations in forms

2009-02-01 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 8:12 PM, Konstantin S wrote: > > Hello! > > I couldn't add m2m relations in my form if I use delayed commit, i.e. > form.save(commit = False) and form.save() later on. See code at > http://dpaste.com/hold/115253/. Is there some common pattern to >

Re: "invalid reference to FROM-clause" for nested annotate query

2009-02-02 Thread Russell Keith-Magee
On Mon, Feb 2, 2009 at 4:46 PM, omat wrote: > > I just remembered that the above error occured when running on > Postgresql 8.2. Sorry for the misinformation about SQLite. > > Then to give it a try with SQLite, I built a fresh database with > syncdb on SQLite. > > This time, at

Re: Custom Aggregate Objects

2009-02-03 Thread Russell Keith-Magee
On Tue, Feb 3, 2009 at 11:16 AM, alex.gay...@gmail.com wrote: > > On Feb 2, 9:05 pm, nsitarz wrote: >> Hey, >> >> Back when the ORM aggregate support was a patch in trac I used to >> create custom aggregate objects that looked like this: >> >> class

Re: Custom Aggregate Objects

2009-02-03 Thread Russell Keith-Magee
On Tue, Feb 3, 2009 at 8:34 PM, Russell Keith-Magee <freakboy3...@gmail.com> wrote: > On Tue, Feb 3, 2009 at 11:16 AM, alex.gay...@gmail.com > <alex.gay...@gmail.com> wrote: >> >> On Feb 2, 9:05 pm, nsitarz <nsit...@gmail.com> wrote: >>> Hey

Re: How do you serialize a model that has a common base model

2009-02-03 Thread Russell Keith-Magee
On Tue, Feb 3, 2009 at 11:24 PM, souper wrote: > > Then if I try: > all_objects = list(BurgerStand.objects.all()) + list(Place.objects.all > ()) > data = serializers.serialize('xml', all_objects) > > I get all Place objects - even the ones that are not related in any >

Re: Django contrib apps in different db schema

2009-02-03 Thread Russell Keith-Magee
On Tue, Feb 3, 2009 at 11:26 PM, haestan none wrote: > Hi, > > I'm trying to use Django for implementing new stuff in some of our legacy > apps. > All the existing apps use PostgreSQL as their database backend. Now in order > to > do this as transparent as possible, I'd like

Re: #django community etiquette observations

2009-02-03 Thread Russell Keith-Magee
On Wed, Feb 4, 2009 at 2:16 PM, Kenneth Gonsalves wrote: > > On Wednesday 04 Feb 2009 1:57:46 am sierramtns wrote: >> there are certainly other people acting as such in varying degrees, >> and i only cite Magus- because of the twitter feed and django log >> entry being

Re: syncdb dry run

2009-02-04 Thread Russell Keith-Magee
On Wed, Feb 4, 2009 at 11:57 PM, tow wrote: > > Is there a way to do a dry run of "manage.py syncdb", to see what sql > commands it's about to execute? > > "./manage.py sqlall" isn't good enough for my purposes because > > 1) I have to specify the list of

Re: Django Templates: Dynamically addressing 2-D Dictionary

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 7:30 AM, Glen Jarvis wrote: > > Notice that I can reference grants.2.63 through direct reference, but > when trying to use the variables alpha=2, and beta=63, this lookup > fails. Yes - it will. > I'm beating my head up against the wall with this.

Re: Modifying Handler to support multiple customized, inheriting clients

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 8:39 AM, bbeaudreault wrote: > > Sorry to spam, but in re-reading my post I realized that I assumed > people know what I mean by "Shared Code." That's not the unclear bit. The unclear bit is your terminology and how your are interpreting it. What,

Re: Serialization

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 8:35 AM, issya wrote: > > My ideal situation would be to initially load the data through ajax > and update through ajax. But I cannot find an easy way to do this. If > I searialize the data, I don't see an easy way to deserialize it. Are you aware

Re: Serialization

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 1:09 PM, issya wrote: > > Thanks for the reply. I was aware of that but I guess I don't > understand how to go about using it. I do understand that I can > serialize a queryset. But I cannot just go and use the serialized data > as template context.

Re: [slightly offtopic] Which Python are people using on OSX?

2009-02-05 Thread Russell Keith-Magee
On Fri, Feb 6, 2009 at 6:07 AM, cjl wrote: > > I've been on Windows and Linux for many years, and recently picked up > a Macbook Pro for the fun of it. > > To be honest, I'm kind of disappointed with the Python included with > Leopard. I spent some time googling around to see

Re: Converting queryset filter() strings to their fields?

2009-02-06 Thread Russell Keith-Magee
On Sat, Feb 7, 2009 at 5:05 AM, Ben Gerdemann wrote: > > My question is how, can I can get a reference to the 'a21_ano' field > that this filter is referencing? If the filter didn't span through the > foreign key, I could just do: > > T60Curso._meta.get_field("ex") > > but

Re: Best Practices for filter()[0] and get()

2009-02-06 Thread Russell Keith-Magee
On Sat, Feb 7, 2009 at 8:14 AM, Michael Burton wrote: > I often have a need to get an object that I don't know for sure is in the > database. For example, > > Retrieving a person by username when the username may have been mistyped, > eg. User.objects.get(...) > Retrieving a

Re: Modify label from field.label_tag

2009-02-07 Thread Russell Keith-Magee
On Sat, Feb 7, 2009 at 6:03 PM, Kless wrote: > > Does anybody could help me with this? First off - please be patient. You've waited less than a day for a response. Sometimes it will take a day or two to get a response - especially when you ask your question on a Friday

Re: optional foreign key

2009-02-07 Thread Russell Keith-Magee
On Sun, Feb 8, 2009 at 8:03 AM, J wrote: > > The idea is to be able to query all the items that have a specific 'group' > record chosen, as well as all items that don't have anything set. Since some > of them can be NULL or None, how do I go about selecting in a query both

Re: Modify label from field.label_tag

2009-02-07 Thread Russell Keith-Magee
On Sun, Feb 8, 2009 at 7:08 AM, Kless <jonas@googlemail.com> wrote: > > Thanks Russel for your fast reply. > My answer is down > > On 7 feb, 10:05, Russell Keith-Magee <freakboy3...@gmail.com> wrote: >> On Sat, Feb 7, 2009 at 6:03 PM, Kless <jonas

Re: Exception in Django's Exception Handling

2009-02-08 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 4:20 AM, Devel63 wrote: > > Django is raising an exception while trying to process an exception, > resulting in no stack traces ... for many different types of errors. > > It has the problem in debug.py, at this line under > technical_500_response: >

Re: Adding project revision number to templates.

2009-02-08 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 8:17 AM, Dana wrote: > > Hi all, > > Wondering what the best approach would be to add my projects revision > number to my projects admin? I would like to show the revision number > of my SVNed project in my admin templates so I can easily see what >

Re: protect from brute force attacks on login

2009-02-09 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 6:21 PM, Markos Gogoulos wrote: > Hi all, > > I'm using django-registration to handle logins, registrations etc. It is > very handy and easy to set up, but allows unlimited login attempts, and thus > people can brute-force any django-application! > >

Re: Troubles with unicode in django-trunk

2009-02-09 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 6:58 PM, jfmxl wrote: > > Hello, > > I downloaded the 1.0.2 version of django to my ubuntu 8.10 box and > began the tutorial. I got as far as adding the unicode print > definitions for poll and choice, and then saw no difference between > afterward : > >

Re: mod_python vs. Django?

2009-02-09 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 6:54 PM, Vincent wrote: > > Hello > > I'd like to write a Web 2.0-type web application. I find Python a lot > more pleasurable than PHP. > > I'd like to have information about the pro's and con's of using > Apache's mod_python vs. an application

Re: Troubles with unicode in django-trunk

2009-02-09 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 8:43 PM, jfmxl <jf...@yahoo.com> wrote: > > On Feb 9, 5:21 pm, Russell Keith-Magee <freakboy3...@gmail.com> wrote: >> On Mon, Feb 9, 2009 at 6:58 PM, jfmxl <jf...@yahoo.com> wrote: > Sorry, I am new to python and I guess you hadn't

Re: Exception in Django's Exception Handling

2009-02-09 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 1:59 AM, Devel63 wrote: > > I'll see if I can extract some small subset and post the details. > > In the meantime, more info: the problem only occurs when an error is > encountered during a call in which the server will return a > HttpResponse('',

Re: comparisons with java framework

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 4:21 PM, igorlash wrote: > > Hi everybody. > I'm java developer , and I like comparing web frameworks. > Members of django community talk a lot about easiness of django > especially comparing with java frameworks. But they have not compared > all

Re: Group By and aggregation

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 6:47 PM, Alessandro Ronchi wrote: > I have to get the max value of a model grouped by a field. > > The RAW SQL query is this: > > SELECT max(energy_tot) FROM fotovoltaico_modules,fotovoltaico_module_scheme > WHERE

Re: Group By and aggregation

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 8:43 PM, Alessandro <alessandro.ron...@gmail.com> wrote: > > > 2009/2/10 Russell Keith-Magee <freakboy3...@gmail.com> >> >> >> However, if you're using Django trunk, what you want is: >> >

Re: comparisons with java framework

2009-02-10 Thread Russell Keith-Magee
On Wed, Feb 11, 2009 at 6:52 AM, Greg Ewing wrote: > > Alex Gaynor wrote: > >> As I said above, a checkout of the django source includes all the docs, >> which can be built into nice HTML just as online with the sphinx module >> for python. It takes all of 30

Re: comparisons with java framework

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 8:41 PM, igorlash wrote: > > The django community should allow to download html version of > documentation to make this project more attractive , I'm sure it > doesn't take a lot of time to generate it on configured environment. You're sure, are you?

Re: comparisons with java framework

2009-02-11 Thread Russell Keith-Magee
On Wed, Feb 11, 2009 at 4:24 PM, igorlash wrote: > > Russ Magee , I've got a question personally to you. > Why do we need to use make ? Why this build can't be done without make > but only with python ? A lot of companies try to avoid using make and > moving projects to

Re: comparisons with java framework

2009-02-11 Thread Russell Keith-Magee
On Wed, Feb 11, 2009 at 8:09 PM, igorlash wrote: > > But if you take a look at Makefile you will find that this file has > only creating folders and running processes. So make isn't used as > real build tool in django. If this is what you believe, then you either don't

Re: Really slow functional tests

2009-02-11 Thread Russell Keith-Magee
On Wed, Feb 11, 2009 at 10:11 PM, Andrea Reginato wrote: > > On Feb 11, 1:59 pm, felix wrote: >> do you have large initial_data fixtures ? >> >> tables get flushed and initial_data is added each time. > > Yes, looking at it it's quite huge, and

Re: comparisons with java framework

2009-02-11 Thread Russell Keith-Magee
On Thu, Feb 12, 2009 at 12:06 AM, Andrew Ingram wrote: > > 2009/2/11 Alex Gaynor : >> This is another case of generating work for someone as far as I can tell, >> sphinx autogenerates the make file for us, we didn't write it. To switch to >> some

Re: Thoughts on nested Model references and JSON serialization

2009-02-12 Thread Russell Keith-Magee
On Thu, Feb 12, 2009 at 10:17 PM, django_fo...@codechimp.net wrote: > > I wanted to get the communities thoughts on this subject. I am > working on a simple site that has news articles, each of which has a > reference to a User object provided by django.contrib.auth that is

Re: Group By and aggregation

2009-02-13 Thread Russell Keith-Magee
On Fri, Feb 13, 2009 at 6:54 PM, Alessandro <alessandro.ron...@gmail.com> wrote: > > > 2009/2/10 Alessandro <alessandro.ron...@gmail.com> >> >> >> 2009/2/10 Russell Keith-Magee <freakboy3...@gmail.com> >>> >>> >>> i.e., plur

Re: load huge dataset through fixtures

2009-02-16 Thread Russell Keith-Magee
On Mon, Feb 16, 2009 at 7:42 PM, Konstantin S wrote: > > Hello! > > I am trying to load really huge dataset (contains millions of records) > into database through fixtures and it seems that django loads entire > data into memory before commiting it into db so python process

Re: Settings for an application - define as a model?

2009-02-16 Thread Russell Keith-Magee
On Tue, Feb 17, 2009 at 6:24 AM, Rob wrote: > > I'm writing a Django app to act as the front-end interface to a backup > application, using MySQL as the database. I need to store some > variables to act as the "global" settings specific to my app - like > UNIX backup

Re: You don't have permission to edit anything - new forms admin

2009-02-17 Thread Russell Keith-Magee
On Wed, Feb 18, 2009 at 2:17 AM, Rajesh Dhawan wrote: > > >> >> # Admin: >> ('^hiveadmin/(.*)', admin.site.root), > > > That's no longer the right way to hook the admin into your URL conf. > See here: > >

Re: Struggling with annotations / aggregations

2009-02-18 Thread Russell Keith-Magee
On Thu, Feb 19, 2009 at 2:32 AM, Stefan Tunsch wrote: > > Hi there! > > I'm trying to see what's the best approach in my scenario. > The problem is how to make a list display different sums and > calculations based on it's child objects. > > My scenario could be the following:

Re: MetaWeblog API vs. Atom Publishing Protocol support

2009-02-19 Thread Russell Keith-Magee
On Thu, Feb 19, 2009 at 7:45 PM, Gour wrote: > Hi! > > I'm new to Django exploring what can be done with it and I'd like that > blog users could use some of desktop blog clients to publish their posts > to Django-powered blog site, so I did some research about support for >

Re: Aspect Orientation?

2009-02-19 Thread Russell Keith-Magee
On Fri, Feb 20, 2009 at 1:04 AM, RaoB wrote: > > Is anything being done to include aspect orientation in dJango, to be > able to easily and dynamically modify behaviors etc.? > http://www.cs.tut.fi/~ask/aspects/download.shtml seems interesting? In short - no. If you

Re: grouping save() queries into a single query

2009-02-20 Thread Russell Keith-Magee
On Sat, Feb 21, 2009 at 12:08 AM, Alessandro Ronchi wrote: > > is it possible to group different model save() to avoid the > multiplication of db connections and queries? > > I need to make a lot of save() of different new models and it should > be very useful to

Re: checking if db is empty

2009-02-25 Thread Russell Keith-Magee
On Thu, Feb 26, 2009 at 4:24 AM, knight wrote: > > Hi, > > I'm using postgres database in my Django application. > Is there a way to check if the database is empty from my models.py? (I > mean before the first syncdb) There isn't a simple 'is_my_database_empty' command that

Re: How to select a single field from database with django QuerySet API?

2009-02-26 Thread Russell Keith-Magee
On Thu, Feb 26, 2009 at 7:23 PM, marco sedda wrote: > > Hi, >   I want to select a "single" field from a table, i've read the > QuerySet API reference but i can't find anything to solve my query. > > Just to explain: > > If i've a table like: > > User >   first_name =

Re: Undocumented comment setting

2009-02-27 Thread Russell Keith-Magee
On Fri, Feb 27, 2009 at 8:02 PM, Chris McCormick wrote: > > Hi, > > The COMMENTS_ALLOW_PROFANITIES setting is undocumented at > http://docs.djangoproject.com/en/dev/ref/contrib/comments/settings/ A known omission, with a purpose: http://code.djangoproject.com/ticket/9530

Re: Undocumented comment setting

2009-02-27 Thread Russell Keith-Magee
On Fri, Feb 27, 2009 at 11:59 PM, Tim Chase wrote: > >>> The COMMENTS_ALLOW_PROFANITIES setting is undocumented at >>> http://docs.djangoproject.com/en/dev/ref/contrib/comments/settings/ >> >> A known omission, with a purpose: >> >>

Re: Appropriate placement for my testcases belonging to a non-app in Django

2009-03-04 Thread Russell Keith-Magee
On Wed, Mar 4, 2009 at 10:10 PM, madhav wrote: > > I have built my website in Django. And like any other django project I > have got apps inside the project root directory and some special > folders like(extensions a.k.a custom django command extensions). With > an app, we

Re: New to Django and a few basic questions

2009-03-04 Thread Russell Keith-Magee
On Wed, Mar 4, 2009 at 9:54 PM, ch...@secondfoundation.net wrote: > > Hi group, > > as the subject says, I'm new to Django. I worked through some > tuturials and djangobook.com for the 1.0.2 version as far as there > already is documentation. Anyway, I'm still not

  1   2   3   4   5   6   7   8   9   10   >