Re: Ann: DSE v.3.0.0 Beta #1

2011-06-23 Thread Thomas Weholt
On Fri, Jun 24, 2011 at 3:54 AM, Russell Keith-Magee wrote: > On Fri, Jun 24, 2011 at 9:44 AM, Cal Leeming [Simplicity Media Ltd] > wrote: >> >> >> On Fri, Jun 24, 2011 at 2:34 AM, Russell Keith-Magee >>

Re: Tests got ~10x slower after upgrading to Django 1.3

2011-06-23 Thread Russell Keith-Magee
On Fri, Jun 24, 2011 at 11:54 AM, Cesar Canassa wrote: > Hi Russ! > I did some more testing, I found out that each test is taking an extra ~1s > to run, no matter the test size. See this TestCase for example, it > takes 4.067s to run. > from django.test import TestCase >

Re: Social Networking basics? -Raj

2011-06-23 Thread Peter Murphy
+1 for Fabián's link. Not only is it better-tempered than ESR on the subject, it's a lot _shorter_. I like how it is split into 10 simple sections. Love points 4, 5 and 6! Not everyone on this list has English as a first language. Some newcomers may be confused or daunted by Eric's lengthy prose,

Re: Tests got ~10x slower after upgrading to Django 1.3

2011-06-23 Thread Cesar Canassa
Hi Russ! I did some more testing, I found out that each test is taking an extra ~1s to run, no matter the test size. See this TestCase for example, it takes 4.067s to run. from django.test import TestCase class JobTest(TestCase): def test_1(self): pass def test_2(self):

Re: Social Networking basics? -Raj

2011-06-23 Thread Russell Keith-Magee
On Fri, Jun 24, 2011 at 10:17 AM, Fabian Ezequiel Gallina wrote: > 2011/6/23 Russell Keith-Magee : >> On Fri, Jun 24, 2011 at 12:49 AM, Cal Leeming [Simplicity Media Ltd] >> wrote: >>> >>> >>> On Thu, Jun 23, 2011

Re: Social Networking basics? -Raj

2011-06-23 Thread Russell Keith-Magee
On Fri, Jun 24, 2011 at 11:33 AM, Kenneth Gonsalves wrote: > On Fri, 2011-06-24 at 08:14 +0800, Russell Keith-Magee wrote: >> s a side note, if someone were to redraft that document in such a way >> that it *doesn't* have that tone, I'd gladly include the text in >>

Re: Social Networking basics? -Raj

2011-06-23 Thread Kenneth Gonsalves
On Fri, 2011-06-24 at 08:14 +0800, Russell Keith-Magee wrote: > s a side note, if someone were to redraft that document in such a way > that it *doesn't* have that tone, I'd gladly include the text in > Django's own documentation. last time you posted on this topic you had given a link to

Re: Best practices to secure admin site

2011-06-23 Thread Phui-Hock
> * Only allow HTTPS (to the admin, and perhaps to the entire site). > * Don't use "/admin/" -- I usually use a separate subdomain like > "backend.example.com", or sometimes just a different root (I often see > "nqzva" -- figuring out why is left as an exercise for the reader :). > * Limit access

django 1.3 timing out on empty POST request

2011-06-23 Thread mehdi ait oufkir
Hello, I recently upgraded to django 1.3 and POST request with empty body seem to timeout. This call : block = getattr(request, POST, { }) seems to never return, when the request is POST request with an empty body. Let me know if you think you know what's going on. Thanks! -- You

Creating simple view app based on Admin site

2011-06-23 Thread Alexei
Hi, I'm trying to create a simple application whose most important feature is going to be to view/search the contents of my database. I have the Admin site configured to exactly how I want the end product to look (searching, filtering, etc.) but I'm having trouble porting this over to the user

Re: Django password_change

2011-06-23 Thread Yuri Piratello
I use in that project https://github.com/yuripiratello/nilo (r'^alterarSenha/$', 'nilo.views.alterarSenha'), My template: /templates/alterarSenha.html Att; Yuri Zanola Piratello = blog: http://yuri-piratello.blogspot.com msn:

Re: Social Networking basics? -Raj

2011-06-23 Thread Fabian Ezequiel Gallina
2011/6/23 Russell Keith-Magee : > On Fri, Jun 24, 2011 at 12:49 AM, Cal Leeming [Simplicity Media Ltd] > wrote: >> >> >> On Thu, Jun 23, 2011 at 5:46 PM, Shawn Milochik wrote: >>> >>> On 06/23/2011 12:36 PM, Cal

Re: Ann: DSE v.3.0.0 Beta #1

2011-06-23 Thread Russell Keith-Magee
On Fri, Jun 24, 2011 at 9:44 AM, Cal Leeming [Simplicity Media Ltd] wrote: > > > On Fri, Jun 24, 2011 at 2:34 AM, Russell Keith-Magee > wrote: >> >> On Fri, Jun 24, 2011 at 9:28 AM, Cal Leeming [Simplicity Media Ltd] >>

Error while trying to link up to a view from search results in a template .

2011-06-23 Thread Satyajit Sarangi
My views.py is this def map_display(request): if request.method == 'POST': form = DispForm(request.POST) if form.is_valid(): this_user = request.user user1= this_user.pk LName =

Re: Ann: DSE v.3.0.0 Beta #1

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jun 24, 2011 at 2:34 AM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > On Fri, Jun 24, 2011 at 9:28 AM, Cal Leeming [Simplicity Media Ltd] > wrote: > > +1 on this new feature. > > For those that don't understand how this impacts

Re: Ann: DSE v.3.0.0 Beta #1

2011-06-23 Thread Russell Keith-Magee
On Fri, Jun 24, 2011 at 9:28 AM, Cal Leeming [Simplicity Media Ltd] wrote: > +1 on this new feature. > For those that don't understand how this impacts performance, I'm dedicating > a chunk of the (soon to come) webcast to explaining how this works and the >

Re: Ann: DSE v.3.0.0 Beta #1

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
+1 on this new feature. For those that don't understand how this impacts performance, I'm dedicating a chunk of the (soon to come) webcast to explaining how this works and the future ideas for monkey-patching the ORM with deferred execution (which basically means to make this a 99% drop-in

Re: What are the advantages of Model inheritance?

2011-06-23 Thread Matthew Gardner
I think you're right, Rich, that when you query on a table, it'll only grab the results for that table. So when you do user.post_set.all(), it only creates Post objects, because it only pulls data from that one table. When you do user.betterpost_set.all(), the reason you don't see anything is

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Matthew Gardner
Thanks for your input, Bill, I appreciate it. I think I'm just going to take a hit and switch to an explicit OneToOneField instead of trying to make this work with inheritance. The other way things will just work, because django's built to make it work, but doing it with inheritance is difficult

How do I add this particular url in my template ?

2011-06-23 Thread Satyajit Sarangi
This is the url http://127.0.0.1:8000/admin/maps/test/ . When I click on a link on a particular template , it should take me there . How do I manage it ? The reason why I am asking is this is in the admin . -- You received this message because you are subscribed to the Google Groups "Django

Re: manytomany query problem

2011-06-23 Thread Tony
Nikhil, This email will be significantly shorter than the one I wrote 5 minutes ago before my laptop ran out of battery and failed to get sent. I didn't explain this clearly so I am going to give an example (a much smaller one than the one I jsut wrote). Lets say I have 3 object As (a1, a2, a3)

Re: Social Networking basics? -Raj

2011-06-23 Thread Russell Keith-Magee
On Fri, Jun 24, 2011 at 12:49 AM, Cal Leeming [Simplicity Media Ltd] wrote: > > > On Thu, Jun 23, 2011 at 5:46 PM, Shawn Milochik wrote: >> >> On 06/23/2011 12:36 PM, Cal Leeming [Simplicity Media Ltd] wrote: >>> >>> The perfect link to

Re: Django password_change

2011-06-23 Thread Eiji Kobayashi
Hi, Maybe you made a mistake, but your url says /account/password/change, but you put the password*.html files to /templates/registration. Shouldn't it be inside your project's templates/account directory? Maybe that is why you're getting a 404? Just a guess Eiji On Thu, Jun 23, 2011 at 11:53

Custom form on formset does not use Meta 'widgets', bug?

2011-06-23 Thread adrian
Django dev, Python 2.6.6 Just wondering if I should file a bug report or am I just doing something wrong. I have an inline: class ProductImageInline(admin.StackedInline): model = ProductImage formset = ProductImageFormset ...the form declaration and formset factory call: class

Re: Newbie question, I'm having difficulty getting the admin panel to work!

2011-06-23 Thread Eiji Kobayashi
Hello, I'm not exactly sure about your other problems, but the problem with not getting any styles seem to me like you didn't set your ADMIN_MEDIA_PREFIX correctly in your settings file and/or your web server configuration file. You must let it know how to access all the javascript, css and image

Ann: DSE v.3.0.0 Beta #1

2011-06-23 Thread Thomas Weholt
For the impatient: http://pypi.python.org/pypi/dse/3.0.0.Beta-1 Source at https://bitbucket.org/weholt/dse2/src Modified BSD license. New in the 3.x version of DSE is the bulk_update-method, more intuitive syntax and code clean up. NB! The new syntax is not backwards compatible so existing code

Re: mach-o, but wrong architecture

2011-06-23 Thread Malcolm Box
Re your cacheing problem the behaviour you are seeing is exactly what would be expected using locmem cache. Apache is presumably running multiple processes each of which will have it's own locmem cache. Since the odds ate against two successive requests hitting the same apache process, you

How to use the foreign key to get the exact row of that particular table ?

2011-06-23 Thread Satyajit Sarangi
My models.py is this class PermiLayer(models.Model): user = models.ForeignKey(User) table = models.ForeignKey(ContentType) permi = models.IntegerField() My views.py is this perm.table = ContentType.objects.get(app_label="OsmMap",model="osmlayers") Perm.table is storing an integer .

Re: What would be a better views.py code to achieve this particular task .

2011-06-23 Thread Satyajit Sarangi
I'm afraid I can't help you any further on this, as I don't know enough about the contenttypes framework, and I still don't really understand what it is you are asking. Cal I got it fixed . Now I have smaller issue . Foreign key ( of a particular model) is returning me a table_id with some

Re: Best practices to secure admin site

2011-06-23 Thread Jacob Kaplan-Moss
On Thu, Jun 23, 2011 at 3:33 PM, Phui-Hock wrote: > This question has been asked a few times, but is there a general set > of best practices one should follow to secure Django admin site? A > quick check on some of the Django powered websites leave /admin/ open > to public

Re: What are the advantages of Model inheritance?

2011-06-23 Thread Rich Jones
Even ignoring the select_related then - the fact is that user.post_set works and user.betterpost_set won't work, seemingly as the result of using model inheritance. Perhaps I could get all of the posts (post and betterposts) and then filter by time? Does that make sense / is there a way to do

Re: mach-o, but wrong architecture

2011-06-23 Thread Andy Dustman
Did you make sure you completely cleaned out the build directory between attempts? I.e. manually remove it. Also see (if you haven't already) http://stackoverflow.com/questions/3061277/python-mysql-wrong-architecture-error I don't know exactly why it's so hard to build on Mac OS X, and I wrote

Re: Inconsistent keyword filtering on FK

2011-06-23 Thread Ethan Miller
On Jun 23, 2011, at 2:30 PM, Ian Clelland wrote: > person_id is a column in the payee table, and Django will construct SQL which > compares against that. It's the reverse actually payee_id is a column on the person table so I guess the resulting SQL would need to be select * from

Re: Inconsistent keyword filtering on FK

2011-06-23 Thread Ethan Miller
On Jun 23, 2011, at 2:21 PM, Cal Leeming [Simplicity Media Ltd] wrote: > Payee.objects.filter( > person = Person(id=26) > ) > > or.. Payee.objects.filter( > person__id = 26 > ) Both of these return the same error - it lists out all the "choices" which are all fields on the payee

Re: What are the advantages of Model inheritance?

2011-06-23 Thread Micky Hulse
On Thu, Jun 23, 2011 at 2:17 PM, bruno desthuilliers wrote: > FWIW, I have been using model inheritance - abstract and concrete - in > half a dozen projects, with about 30 model subclasses in one of them, > and it JustWorks(tm). That sounds pretty sweet! :D I

Re: Inconsistent keyword filtering on FK

2011-06-23 Thread Ian Clelland
On Thu, Jun 23, 2011 at 2:21 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > The problem: >> >> Utility.objects.filter(person=1144) # works fine >> Payee.objects.filter(person=26) # gives us FieldError: Cannot resolve >> keyword 'person' into field >> > >

Re: Inconsistent keyword filtering on FK

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
On Thu, Jun 23, 2011 at 10:16 PM, EAMiller wrote: > I'm getting a 'cannot resolve keyword' on a objects.filter that > doesn't seem to make sense. > > Here is the model: > > class Person(models.Model): >payee = models.ForeignKey( >Payee, >null=True, >

Re: What are the advantages of Model inheritance?

2011-06-23 Thread bruno desthuilliers
On Jun 23, 8:24 pm, Rich Jones wrote: > Other than the convenience of writing them, I can't seem to find any > advantages of using model inheritance. Really ??? > Please allow me to explain the trouble I am having with an example. > Suppose, > > class Post(models.Model): >  

Inconsistent keyword filtering on FK

2011-06-23 Thread EAMiller
I'm getting a 'cannot resolve keyword' on a objects.filter that doesn't seem to make sense. Here is the model: class Person(models.Model): payee = models.ForeignKey( Payee, null=True, blank=True, ) ut = models.ForeignKey( Utility, null=True,

Re: What are the advantages of Model inheritance?

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
Here you go :) https://docs.djangoproject.com/en/dev/topics/db/models/#proxy-models On Thu, Jun 23, 2011 at 10:12 PM, Rich Jones wrote: > Where would _meta need to go? > > This code does appear to work the way I am describing it, this is just > a slightly stripped down of a

Re: What are the advantages of Model inheritance?

2011-06-23 Thread Rich Jones
Where would _meta need to go? This code does appear to work the way I am describing it, this is just a slightly stripped down of a real application I have made. R On Jun 23, 4:59 pm, "Cal Leeming [Simplicity Media Ltd]" wrote: > I might be wrong here, but

Re: What would be a better views.py code to achieve this particular task .

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
Again, please keep your replies on-list. I'm afraid I can't help you any further on this, as I don't know enough about the contenttypes framework, and I still don't really understand what it is you are asking. Cal On Thu, Jun 23, 2011 at 10:07 PM, Satyajit Sarangi < writetosatya...@gmail.com>

Newbie question, I'm having difficulty getting the admin panel to work!

2011-06-23 Thread Rishi
Hi everyone, I've just started using Django, and everything has been smooth sailing up until this part. I added 'django.contrib.admin' in settings.py for installed apps, and changed urls.py to allow for the admin page to work. However, the admin page works erratically. That is, at some points no

Re: What would be a better views.py code to achieve this particular task .

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
Please keep your replies on-list so others may benefit in the future. On Thu, Jun 23, 2011 at 10:01 PM, Satyajit Sarangi < writetosatya...@gmail.com> wrote: > First of all , when I am doing this > perm.table = ContentType.objects.get(app_label="OsmMap",model="Osm_Layers") > I am getting a

mach-o, but wrong architecture

2011-06-23 Thread John
O.K. I know that there are a lot of suggestions out there for this problem, I think I have tried all of them but I am still getting the dreaded error in the subject line loading the MySQLdb module. Everything was working fine, but I was having problems with a LocMemCache so I decided to upgrade

Re: What are the advantages of Model inheritance?

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
I might be wrong here, but I'm fairly sure that the below example you pasted is invalid code (i.e. you need to add a proxy _meta??). My apologies if I'm wrong though, as I have never encountered a need to do this before, and just going off vague memory. Cal

Re: What would be a better views.py code to achieve this particular task .

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
You're going to have to explain this a lot better, because I really did not understand what you mean. At a *GUESS*, are you trying to prevent against db save race conditions or something?? Please clarify. Cal On 23/06/2011 20:07, Satyajit

Content type returns this :ContentType matching query does not exist.

2011-06-23 Thread Satyajit Sarangi
My views.py is this if k == 3: perm = PermiLayer() perm.user = user perm.permi = k if int(rad4) == 0: perm.table =

Best practices to secure admin site

2011-06-23 Thread Phui-Hock
Hi, This question has been asked a few times, but is there a general set of best practices one should follow to secure Django admin site? A quick check on some of the Django powered websites leave /admin/ open to public access, and some don't even use https for login form submission. Although

What are the advantages of Model inheritance?

2011-06-23 Thread Rich Jones
Other than the convenience of writing them, I can't seem to find any advantages of using model inheritance. Please allow me to explain the trouble I am having with an example. Suppose, class Post(models.Model): title = models.CharField(max_length=200) user_owner_id =

Django password_change

2011-06-23 Thread Mark L.
Hey guys, I'm a newb to Django, but have some experience with Rails. Its fun to see the similarities and differences in both! After looking through https://docs.djangoproject.com/en/dev/topics/auth/#module-django.contrib.auth.views Under the section 'Other built-in views' I think password change

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Bill Freeman
So, we're talking about "Multi-table inheritance" (https://docs.djangoproject.com/en/1.3/topics/db/models/#multi-table-inheritance). Note that this uses "an automatically-created OneToOneField". What you really want to do is to create a python instance of the Verb class. It's id (in the Verb

Re: FileField model question

2011-06-23 Thread raj
I actually did google a lot, it's just that every link I got seemed to show a different way of doing this. I'm going to try that django snippet way and see where I get. Then I have to figure out how to put the files up for download after they have been uploaded. Thank you. On Jun 23, 1:06 pm,

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread Fatrix
I would like to attend, too. Thank you in advance! CU Fatrix -- 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@googlegroups.com. To unsubscribe from this group, send email to

What would be a better views.py code to achieve this particular task .

2011-06-23 Thread Satyajit Sarangi
This is my models.py of a different app . class PermiLayer(models.Model): user = models.ForeignKey(User) table = models.ForeignKey(ContentType) permi = models.IntegerField() In another app's views , I am accessing a form that has given me a username . I have to

Re: manytomany query problem

2011-06-23 Thread Nikhil Somaru
Hi Tony, Try this: q1 = A.objects.filter(B=your_b1_instance) # that gets you all A with B = your_b1_instance q2 = A.objects.filter(B__B=your_b2_instance) #that gets you all A with B.B = your_b2_instance result = set(q1).intersection(set(q2)) #gives you the A's that are common to both sets.

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Bill Freeman
I'm still confused about what you have (what form of inheritance you are using. In your database, are there both a Word table and a Verb table? Or is there just a (set of) Verb (and Noun and Adjective, etc.) table(s), derived from a non-Model Word class? If there's a Noun instance "record" and

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Matthew Gardner
I'm using django's model inheritance. Sorry I wasn't clear. So there's a Word model and a Verb model. class Word(models.Model): # Word stuff class Verb(Word): # Verb-specific stuff The way django handles this is to create a word table and a verb table. The verb table has a reference

Re: Accessing the auth user object in a template?

2011-06-23 Thread Travis Bear
On Jun 23, 1:27 am, Tom Evans wrote: > On Thu, Jun 23, 2011 at 8:28 AM, Travis Bear wrote: > > Hi, > > > I'm using the django.contrib.auth app to manage user login/logout.  I > > can successfully log in and out, but I cannot access the {{ user

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Matthew Gardner
On Thu, Jun 23, 2011 at 2:18 PM, Matthew Gardner wrote: > class Verb(models.Model): > word = models.ForeignKey('Word') > # Verb-specific stuff > Sorry, this is more accurate: class Verb(models.Model): word = models.OneToOneField('Word') # verb-specific stuff --

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread Jason
+1 Very interested. On Jun 22, 3:47 pm, "Cal Leeming [Simplicity Media Ltd]" wrote: > Nice, seems like there is a lot of positive feedback. > > Here's some further info about the webcast/webinar: > > *Expected Date:* July/August > *Expected Time:* Somewhere

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
(sorry, should have sent this reply on-list) You know, I was actually thinking about that, but the flights would cost way too much (like $1400+) ;/ If the project has interest next year, I'll probably ask about presenting at DjangoCon EU though. On Thu, Jun 23, 2011 at 6:13 PM, Steve Holden

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread Steve Holden
And, as luck would have it, the US Call For Papers was just published: http://djangocon.us/blog/2011/06/22/call-papers/ regards Steve On Wed, Jun 22, 2011 at 9:37 AM, Shawn Milochik wrote: > Cal, > > That sounds awesome. I wish you could present it at DjangoCon US too.

Re: FileField model question

2011-06-23 Thread Herman Schistad
On Thu, Jun 23, 2011 at 18:51, raj wrote: > I was reading https://docs.djangoproject.com/en/1.3/topics/http/file-uploads/, > and I got a little confused when looking at the handle_uploaded_file > function. You should read:

FileField model question

2011-06-23 Thread raj
I was reading https://docs.djangoproject.com/en/1.3/topics/http/file-uploads/, and I got a little confused when looking at the handle_uploaded_file function. def handle_uploaded_file(f): destination = open('some/file/name.txt', 'wb+') for chunk in f.chunks():

Re: Social Networking basics? -Raj

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
On Thu, Jun 23, 2011 at 5:46 PM, Shawn Milochik wrote: > On 06/23/2011 12:36 PM, Cal Leeming [Simplicity Media Ltd] wrote: > >> The perfect link to refer these users to: >> >>

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Matthew Gardner
On Thu, Jun 23, 2011 at 11:47 AM, Tom Evans wrote: > On Thu, Jun 23, 2011 at 4:36 PM, Matthew Gardner wrote: > > At this point, all I really want to do is add a row to the verb table > that > > contains the correct foreign key, without creating a new row

Re: Social Networking basics? -Raj

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
The perfect link to refer these users to: http://www.catb.org/~esr/faqs/smart-questions.html (props to harryr for finding this) On Mon, Jun 20, 2011 at 10:32 PM, Shawn Milochik wrote: > Is it just me or are we having a sudden spurt of e-mail that goes like > this: > >

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Tom Evans
On Thu, Jun 23, 2011 at 4:36 PM, Matthew Gardner wrote: > At this point, all I really want to do is add a row to the verb table that > contains the correct foreign key, without creating a new row in the word > table. Verb.objects.create(word=word) doesn't fulfill these criteria?

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Matthew Gardner
Thanks, Bill, for your comments. Shortly after I posted here I did a little more digging and found this thread from six months ago that described exactly my problem: http://groups.google.com/group/django-users/browse_thread/thread/9400999651577bc2/8cc4fe267128d6a3 That thread didn't seem to

Re: manytomany query problem

2011-06-23 Thread Tony
You have the question I was asking correct, your notation was fine. The only thing I should add is I want to return all A, but filter my "B1"s (as you put it) for each A. I will post my models if need be, but they are on another computer and its not convenient right now. In the meantime, do you

Re: Errors saving blank Admin Inline with FilePathField?

2011-06-23 Thread Nan
For the reference of future generations, the following seems to work: class MyAdminForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(MyAdminForm, self).__init__(*args, **kwargs) self.fields['some_fpath_field'].choices = [('','--'),]

Re: Test runner fails with Django 1.2.1 and psycopg2 2.4.2

2011-06-23 Thread ashwoods
do you get these errors with: 'OPTIONS': { 'autocommit': True, } ? On Jun 14, 6:06 pm, Andrew Brookins wrote: > Hey, > > Yesterday I started seeing test runner failures with Django 1.2.1 and > psycog2 2.4.2. > > Here's the traceback (where [project_dir] is the path

Best way of rendernig ""dynamic"" templates

2011-06-23 Thread Marc Aymerich
Hi, I'm deveolping some reusable apps with the aim of generating apache config files. The schema is: one 'base' app called apache and an arbitrary number of apps that act as OPTIONAL extensions. These extension apps fit with base app on django-admin as inlines forms, and the template is rendered

Re: I have two doubts when It comes to django url and django templates . Please help

2011-06-23 Thread Tom Evans
On Thu, Jun 23, 2011 at 3:52 PM, Satyajit Sarangi wrote: > {% extends "base.html" %} > > {% load i18n %} > Hello User {{user}} > {% block content %} >    {% if form.errors %} >    {% trans "Sorry there are corrections needed > in your form below:" %} {{

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread John DeRosa
Me On Jun 23, 2011, at 7:49, Chris Calitz wrote: > Sounds really cool. I'm definitely in. > > On 22 Jun 2011, at 14:16, "Cal Leeming [Simplicity Media Ltd]" > wrote: > >> Hi all, >> >> Some of you may have noticed, in the last

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread Chris Calitz
Sounds really cool. I'm definitely in. On 22 Jun 2011, at 14:16, "Cal Leeming [Simplicity Media Ltd]" wrote: > Hi all, > > Some of you may have noticed, in the last few months I've done quite a few > posts/snippets about handling large data sets in

I have two doubts when It comes to django url and django templates . Please help

2011-06-23 Thread Satyajit Sarangi
{% extends "base.html" %} {% load i18n %} Hello User {{user}} {% block content %} {% if form.errors %} {% trans "Sorry there are corrections needed in your form below:" %} {{ form.non_field_errors }} {% endif %} {% if form.is_multipart %} Hello User {{user}} {% else

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread Cal Leeming [Simplicity Media Ltd]
Hi Derek, I've had a look and apparently 4-5mbit should be sufficient enough for a HD webinar. If quite a few of you don't have this capability (or screen size), I could look into reducing it down to 1440x900 perhaps? Let me know your thoughts guys. (maybe it's something I need to do a web vote

Errors saving blank Admin Inline with FilePathField?

2011-06-23 Thread Nan
This is driving me batty... Because there's no blank option in the form field for a FilePathField with blank=False, then if you: - Have an Admin Inline with a FilePathField and another required field - Have extra (i.e. intentionally blank) inlines in your form You will get an error upon saving

Re: Creating an instance of a subclass when superclass instance already exists

2011-06-23 Thread Bill Freeman
First, if, despite being related by inheritance, Word and Verb are separate models, they have separate tables. Then if you do create a Verb, the Word still exists, unless you delete it. Is that what you want? If both are to exist, were you hoping that a query for the same key would still find

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread Derek
Carl Please post here when the recording becomes available... some of us do not have access to HD-capable bandwidth yet! Thanks Derek -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Returning a 503 response instead of a 500 response

2011-06-23 Thread Steven L Smith
Neat. I've been doing Django since the 0.9.6 days and have never written a middleware. I guess there's a first time for everything. Thanks! Steven L Smith, Web Developer Department of Information Technology Services Nazareth College of Rochester 585-389-2085

Re: Returning a 503 response instead of a 500 response

2011-06-23 Thread Tom Evans
On Thu, Jun 23, 2011 at 2:19 PM, Steven L Smith wrote: > Some of our apps have to talk to databases outside of our control, and their > operators don't have the same uptime standards that we do... > > What can I do to make Django return a "503 Service Unavailable"

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread higs
> If you're interested, please reply on-list so others can see. > would love to see this. thanks for posting. -- 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@googlegroups.com. To unsubscribe

Re: create_inactive_user() got an unexpected keyword argument 'profile_callback' Error in django registration . What can be the error ?

2011-06-23 Thread Shawn Milochik
It looks like you added an extra kwarg named profile_callback to a function call to use in your overridden version, then passed *kwargs on to the original version. Before you call the super() version you have to pop off your kwarg because it is an invalid parameter for the original version.

Re: django page loads forever

2011-06-23 Thread Shawn Milochik
On 06/23/2011 05:05 AM, Nikhil Somaru wrote: for a quick fix you could also import pdb pdb.set_trace() that will drop a shell in your "runserver" window and let you explore the value of variables in the context +1 on pdb http://www.doughellmann.com/PyMOTW/pdb/ -- You received this

Returning a 503 response instead of a 500 response

2011-06-23 Thread Steven L Smith
Some of our apps have to talk to databases outside of our control, and their operators don't have the same uptime standards that we do... What can I do to make Django return a "503 Service Unavailable" instead of a "500 Internal Server Error", when it encounters a DatabaseError or

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread Władysław Mettler
Definitely interested. Struggling with scaling a Django/Celery/Postgres/CouchDB/Memcach project now. Would love to see your approach. Cheers Vlad -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: django page loads forever

2011-06-23 Thread Nikhil Somaru
for a quick fix you could also import pdb pdb.set_trace() that will drop a shell in your "runserver" window and let you explore the value of variables in the context On Wed, Jun 22, 2011 at 8:59 PM, Shawn Milochik wrote: > On 06/22/2011 11:26 AM, jay K. wrote: > >> Hello,

Haystack No site conf error . How to debug ?

2011-06-23 Thread Satyajit Sarangi
This is my settings.py # Django global settings # This allows us to construct the needed absolute paths dynamically, # e.g., for the GIS_DATA_DIR, MEDIA_ROOT, and TEMPLATE_DIRS settings. # see: http://rob.cogit8.org/blog/2008/Jun/20/django-and-relativity/ import os GEOGRAPHIC_ADMIN_DIR =

create_inactive_user() got an unexpected keyword argument 'profile_callback' Error in django registration . What can be the error ?

2011-06-23 Thread Satyajit Sarangi
This is my stack trace . Traceback: File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.6/dist-packages/registration/views.py" in

Re: manytomany query problem

2011-06-23 Thread Nikhil Somaru
It is very hard to read your message. Please format it appropriately next time. Avoid repeating variable names and mixing classes with instances. Could you post your models here? Are you defining the following structure: A hasMany B; B hasMany A; B hasMany B; So you want* A such that

Re: Accessing the auth user object in a template?

2011-06-23 Thread Tom Evans
On Thu, Jun 23, 2011 at 8:28 AM, Travis Bear wrote: > Hi, > > I'm using the django.contrib.auth app to manage user login/logout.  I > can successfully log in and out, but I cannot access the {{ user }} > object in my templates.  If I'm reading these documents correctly, >

Accessing the auth user object in a template?

2011-06-23 Thread Travis Bear
Hi, I'm using the django.contrib.auth app to manage user login/logout. I can successfully log in and out, but I cannot access the {{ user }} object in my templates. If I'm reading these documents correctly, that should be enabled by default: @ zalun

manytomany query problem

2011-06-23 Thread Tony
I have two models with a manytomany through relation (A and B). B has a self referential manytomany relation (a userprofile model). How could I filter objects of model B per each relationship with model A? So lets say 3 arbitrary model A objects have 20 model B object relations each. I want to