Re: What does an ideal django workflow setup look like?

2010-10-22 Thread Kenneth Gonsalves
On Fri, 2010-10-22 at 08:02 -0700, Ken wrote: > Basically, please explain it in a way that a layman can follow the > steps and setup a workflow without pulling his hair out. =P my method (I am not a professional programmer): 1. set up my code and create a mercurial repository. Test each change

Re: Fixtures with deferred / auto-generated primary keys?

2010-10-22 Thread Russell Keith-Magee
On Saturday, October 23, 2010, Paul Winkler wrote: > Tried it out. Interestingly, natural keys are currently used only for > foreign key references, > the dump still contains primary keys. > Looks like there's a patch for leaving out PK's when natural keys are > used: >

Re: Database Setup

2010-10-22 Thread Everett
Thanks everyone for all your help! I found a binary for Python 2.7 Here's a the link: http://www.codegood.com/archives/129 Just in case someone stumbles upon these posts. On Oct 16, 3:58 pm, Karen Tracey wrote: > 2010/10/16 Jonathan Barratt > >

Re: moving from Postgres to MySQL

2010-10-22 Thread Felipe Prenholato
hm seriously... why not use Django 1.2 and multidb? It is very easy not? conf two dbs, default is your postgres db, I'll call db2 your mysql db and you assert that you did a syncdb in both... so for each model you do: for item in Model.objects.all(): item.save(using='db2',force_insert=True)

too many options error when launching sqlite3 dbshell

2010-10-22 Thread John Yeukhon Wong
I have django 1.2.3.0 Final In my setting, I have 'sqlite3' filled for the DATABASE_ENGINE. I am able to work with the sqlite3 until I am told that I need to access python manage.py dbshell At first I got the error "sqlite3 is not recongized" Then I read threads and I found that this can be

Re: Global variable during request

2010-10-22 Thread Daniel Roseman
On Oct 22, 5:35 pm, Jop wrote: > Hello all, > > I've been googeling for a while but haven't been able to find a > solution for my problem. I will try to describe the problem > > I want to be able to set a variable in a view function on the start of > the request. During

Re: Global variable during request

2010-10-22 Thread Jop
Thnx, i'll try that :) On 22 okt, 18:39, Michael wrote: > Use middleware to set a threadlocal variable in a global namespace on > request, and unset it on response. > -- > Michael > > > > On Fri, 2010-10-22 at 09:35 -0700, Jop wrote: > > Hello all, > > >

inheriting User class

2010-10-22 Thread Miguel Araujo
Hello everyone, I'm not very aware about what's the direction Django is taking about the User model and making it swappable. Meanwhile I would like to ask if inheriting the User class is advisable or not. As I have read many places obscure bugs can happen and my code will be in production. I'm

Re: Fixtures with deferred / auto-generated primary keys?

2010-10-22 Thread Paul Winkler
Tried it out. Interestingly, natural keys are currently used only for foreign key references, the dump still contains primary keys. Looks like there's a patch for leaving out PK's when natural keys are used: http://code.djangoproject.com/ticket/13252 That would get me 100% of the way there. - PW

Re: What does an ideal django workflow setup look like?

2010-10-22 Thread Brian Bouterse
There are whole books devoted to this topic, which is more of an industry best practices question than a django question. Personally I like this bookon continuous integration. If not that one try googling

[solved] Re: Can't uninstall debug toolbar?

2010-10-22 Thread ringemup
Never mind, restarting Apache did the trick, although I have no clue why that was necessary. On Oct 22, 1:01 pm, ringemup wrote: > For some reason, even though I've removed it from my INSTALLED_APPS > and MIDDLEWARE_CLASSES, and touched my wsgi file, the debug toolbar > just

Can't uninstall debug toolbar?

2010-10-22 Thread ringemup
For some reason, even though I've removed it from my INSTALLED_APPS and MIDDLEWARE_CLASSES, and touched my wsgi file, the debug toolbar just won't go away. I'm sure I'm doing something remarkably stupid, but at this point can't fathom what that might be. Any ideas? Thanks! -- You received

Re: Global variable during request

2010-10-22 Thread Michael
Use middleware to set a threadlocal variable in a global namespace on request, and unset it on response. -- Michael On Fri, 2010-10-22 at 09:35 -0700, Jop wrote: > Hello all, > > I've been googeling for a while but haven't been able to find a > solution for my problem. I

Re: Fixtures with deferred / auto-generated primary keys?

2010-10-22 Thread Paul Winkler
Thanks Shawn! That was quick! Meanwhile I just discovered http://farmdev.com/projects/fixture which I have just confirmed works fine for hand-written fixtures with my app, although using python classes as fixtures feels a little odd. Nice that it's cross-platform though, it supports sqlalchemy

Global variable during request

2010-10-22 Thread Jop
Hello all, I've been googeling for a while but haven't been able to find a solution for my problem. I will try to describe the problem I want to be able to set a variable in a view function on the start of the request. During the same request i want to use the variables value in a manager

Re: What does an ideal django workflow setup look like?

2010-10-22 Thread Phil Gyford
After reading a few articles on this kind of thing, I tried to figure out a good, repeatable way to do some of this, and wrote up the whole process here: http://www.gyford.com/phil/writing/2010/09/29/django-environment.php It doesn't (yet) cover the best ways of integrating dev/production

Re: Fixtures with deferred / auto-generated primary keys?

2010-10-22 Thread Shawn Milochik
And like magic, it's there! http://docs.djangoproject.com/en/dev/topics/serialization/#natural-keys -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this

Fixtures with deferred / auto-generated primary keys?

2010-10-22 Thread Paul Winkler
It would sometimes be useful to be able to write fixtures that essentially say "I don't care what the PK of this record is, as long as I have a way for other records in this fixture to refer to it." Use case: I'd like a way to pass around useful data sets that people can load into deployments of

Re: What does an ideal django workflow setup look like?

2010-10-22 Thread Max Countryman
There was a great article on HN regarding project structure although now I can't seem to find it. Perhaps someone has it bookmarked? On Oct 22, 2010, at 11:02, Ken wrote: > *I've Googled, but have not found any really organized and layman- > friendly overview, which is

What does an ideal django workflow setup look like?

2010-10-22 Thread Ken
*I've Googled, but have not found any really organized and layman- friendly overview, which is why I came here* I know how to get python/django working on my computer (PC or Mac) and have developed simple test apps using django's built-in dev server and a mysql back-end. So I can get things to

Re: moving from Postgres to MySQL

2010-10-22 Thread ringemup
Not spectacular, but mysqldump has flags that can increase the chances of portability, and one would hope pg_dumpall does too. I figured something like that might be worth a try before you write a custom migration script. On Oct 22, 2:58 am, Chris Withers wrote: > On

Re: AutoField field that increments with regards to a foreign key?

2010-10-22 Thread derek
Have a look at this thread: http://groups.google.com/group/django-users/browse_thread/thread/deda522d2545325e/bbaa8edbeda204e3?lnk=gst=production+number#bbaa8edbeda204e3 The author has a similar problem i.e. he says: "There is a high risk of concurrency so just finding the previous max and then

Re: Django-autocomplete - styling?

2010-10-22 Thread derek
OK - managed to fix this myself... In the inline_searchinput.html file, add a line after the section of code that starts: $('#lookup_{{ name }}').autocomplete('{{ search_path }}', { extraParams: { 'search_fields': '{{ search_fields }}', 'app_label':

django-filter as part of Django Admin?

2010-10-22 Thread Derek
For anyone who is using django-filter - http://github.com/alex/django-filter/ - do you know if it is possible to either: (a) use it directly as part of Django Admin, or (b) replicate its functionality Django Admin (and, if so, how?? because the existing "sidebar" filters are not dynamic)

Re: dump sqlite to file when testing

2010-10-22 Thread Phlip
On Oct 21, 10:54 pm, Russell Keith-Magee wrote: > On Fri, Oct 22, 2010 at 12:37 PM, Phlip wrote: > > I just tried it: > > > DATABASES = { > >    'default': { > >        'ENGINE': 'django.db.backends.sqlite3', > > #  TODO restore        'NAME':

Pg pool II configuration in Django

2010-10-22 Thread yabins...@yahoo.co.in
Hai friends, I am trying to implement pg pool II in my django application .Followings are configuration parameter i used in the settings.py file DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.

Re: Cross Domain POST Request

2010-10-22 Thread Masklinn
On 2010-10-22, at 11:53 , Viet Nguyen wrote: > Hi there, I am quite new to Django and encounters a problem which > takes me a lot of time to figure out. As I known, Django provides some > functionality to prevent cross domain AJAX requests. Last time I checked, Django didn't integrate any ajaxy

Cross Domain POST Request

2010-10-22 Thread Viet Nguyen
Hi there, I am quite new to Django and encounters a problem which takes me a lot of time to figure out. As I known, Django provides some functionality to prevent cross domain AJAX requests. However, using jQuery you can specify a callback (JSONP) and could talk and get data back from the server.

Re: filepath (system file system path) field

2010-10-22 Thread BigBlogMaker
look like this solved the problem a source in Russian http://translate.google.ru/translate?js=n=_t=ru=UTF-8=2=1=ru=en=http://blog.vernart.ru/programming/python/django/sobstvennye-filepathfield-dlya-django-spisok-direktorij/ On 23 сен, 01:07, pixelcowboy wrote: > That

Customize behavior of admin inlines

2010-10-22 Thread Bojan Mihelac
I would like to customize behavior of admin inlines interface so when the editor edit a parent model he is offered with all possible variations of child objects. Here is simplified use case: class Shirt(models.Model): name = models.CharField(max_length=80) class

Re: moving from Postgres to MySQL

2010-10-22 Thread Kenneth Gonsalves
On Fri, 2010-10-22 at 07:58 +0100, Chris Withers wrote: > On 21/10/2010 15:40, ringemup wrote: > > MySQL has a tool (mysqldump) that will output the contents of an > > entire database to a SQL file that can then be loaded directly into > > another database. Does Postgres not have anything

Re: moving from Postgres to MySQL

2010-10-22 Thread Chris Withers
On 21/10/2010 15:40, ringemup wrote: MySQL has a tool (mysqldump) that will output the contents of an entire database to a SQL file that can then be loaded directly into another database. Does Postgres not have anything analogous? Sure, pg_dumpall. Now, what're the chances of the SQL that