Re: django tinymce/filebrowser issue

2010-04-28 Thread Xavier Ordoquy
Hi, Filebrowser is a bit tricky to setup. Did you had a look at 404 requests made by your browser ? There should be something that isn't available at some point. Took me some time to setup it up correctly the first time. Regards, Xavier. Le 28 avr. 2010 à 04:57, Bobby Roberts a écrit : > hey g

Error with django-registration

2010-04-28 Thread andy saksena
Hi all, I'm having some troubles while using django-registration used from bitbucket http://bitbucket.org/ubernostrum/django-registration/src After getting evrtythng done Im stuck and having this error. error at /accounts/register/ (111, 'Connection refused') Request Method: POST Request

Re: Template tag to display boolean values?

2010-04-28 Thread derek
On Apr 25, 6:55 pm, Dmitry Dzhus wrote: > Derek wrote: > > I am looking for a way to display a boolean value, with the "on" / "off" > > http://docs.djangoproject.com/en/1.1/ref/templates/builtins/#yesno > -- Thanks - but that outputs strings, not URL links to images... -- You received this messa

Re: Error with django-registration

2010-04-28 Thread James Bennett
On Wed, Apr 28, 2010 at 2:46 AM, andy saksena wrote: > (111, 'Connection refused') As a Google search would have told you, this is the error Python's smtplib module will raise when you tell it to connect to a mail server and it can't. Which means you need to go double-check the settings you've gi

Re: Track "before" and "after" state of an object when editing in the Admin?

2010-04-28 Thread derek
Nick & Tony - many 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 django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For m

Re: OS X install, not in home directory?

2010-04-28 Thread Rob
Doh! Problem solved... I had created a ~/.pydistutils.cfg file a couple weeks ago, for some stupid reason I can't remember. I forgot to delete that file. It's contents were: [install] install_lib = ~/Library/Python/$py_version_short/site-packages install_scripts = ~/bin So it was overriding t

Re: Template tag to display boolean values?

2010-04-28 Thread Daniel Roseman
On Apr 28, 9:08 am, derek wrote: > On Apr 25, 6:55 pm, Dmitry Dzhus wrote:> Derek wrote: > > > I am looking for a way to display a boolean value, with the "on" / "off" > > >http://docs.djangoproject.com/en/1.1/ref/templates/builtins/#yesno > > -- > > Thanks - but that outputs strings, not URL lin

Re: Many2Many / Generic Relation filter, doesn't behave like expected, how is the right way to do it?

2010-04-28 Thread Tom Evans
On Wed, Apr 28, 2010 at 1:00 AM, HWM-Rocker wrote: > I have a TaggedObject that has a GenericRelation to Foo with the name > tags. When I am searching something like that > > TaggedObject.objects.filter(Q(tags__tag=1)&Q(tags__tag=4)) > > I get no Objects in return. But when I filter with (or) '|'

Re: Template tag to display boolean values?

2010-04-28 Thread derek
On Apr 28, 11:12 am, Daniel Roseman wrote: > On Apr 28, 9:08 am, derek wrote: > > > On Apr 25, 6:55 pm, Dmitry Dzhus wrote:> Derek wrote: > > > > I am looking for a way to display a boolean value, with the "on" / "off" > > > >http://docs.djangoproject.com/en/1.1/ref/templates/builtins/#yesno > >

Re: Template tag to display boolean values?

2010-04-28 Thread Daniel Roseman
On Apr 28, 10:25 am, derek wrote: > On Apr 28, 11:12 am, Daniel Roseman wrote: > > > On Apr 28, 9:08 am, derek wrote: > > > > On Apr 25, 6:55 pm, Dmitry Dzhus wrote:> Derek wrote: > > > > > I am looking for a way to display a boolean value, with the "on" / > > > > > "off" > > > > >http://docs.

Re: usage of TIME_ZONE and zone-to-zone conversion

2010-04-28 Thread David De La Harpe Golden
Thanks for the tip on pytz. It might be what I need. See django-timezones, django-related helpers around pytz: http://github.com/brosner/django-timezones its LocalizedDateTimeField model/form fields construct non-naive python datetimes with pytz tzinfo. (see its tests.py for some additio

Re: Interesting Django or Python Issue

2010-04-28 Thread Sam Lai
Maybe database connections aren't closing properly? Don't know where to start looking though. A few weeks ago, I saw something similar (more Django and postgresql processes than usual, not doing anything special), but it hasn't happened since. Thinking about it, it happened when I was reindexing/u

Re: Recommendations for a twitter oauth library?

2010-04-28 Thread Aliaksandr Abushkevich
Hi Adam, OAuth2 works for me. You can use it in any of your python projects. Best regards, Alex On Wed, Apr 28, 2010 at 5:33 AM, adamjamesdrew wrote: > Hi has anyone found a good twitter oauth library for django? > > -- > You received this message because you are subscribed to the Google Grou

Admin Inline empty extra - how to access parent form model ID?

2010-04-28 Thread mixit
Using an Inline in an Admin form: The main Form model has various text fields, and one Inline, using a custom little form of its own. The Inline model has an parentFK pointing to the parent Form model and has an different FK to a large table, which is displayed as a popup (or dropdown) menu with AL

Re: Admin Inline empty extra - how to access parent form model ID?

2010-04-28 Thread Daniel Roseman
On Apr 28, 10:48 am, mixit wrote: > Using an Inline in an Admin form: > The main Form model has various text fields, and one Inline, using a > custom little form of its own. > The Inline model has an parentFK pointing to the parent Form model and > has an different FK to a large table, which is di

Re: django tinymce/filebrowser issue

2010-04-28 Thread Bobby Roberts
not sure how to do that... i'm not really getting any javascript errors or anything. On Apr 28, 3:26 am, Xavier Ordoquy wrote: > Hi, > > Filebrowser is a bit tricky to setup. > Did you had a look at 404 requests made by your browser ? There should be > something that isn't available at some poi

Re: Interesting Django or Python Issue

2010-04-28 Thread Brian Morton
Can we see some code? The description of what you're doing sounds just fine, so that leaves open the possibility of a technical error. On Apr 28, 7:42 am, Sam Lai wrote: > Maybe database connections aren't closing properly? Don't know where > to start looking though. > > A few weeks ago, I saw s

Re: Getting a Blog included in the Django community aggregator

2010-04-28 Thread Gustavo Narea
Hello, Russell et al. We also have a relatively new blog where we talk about Django and the extensions we write for Django, and one of my fellow developers contacted Jacob a few months ago but he never replied. Here's the feed for Django-related posts: http://dev.2degreesnetwork.com/feeds/posts/d

Re: Track "before" and "after" state of an object when editing in the Admin?

2010-04-28 Thread Euan Goddard
Hi Derek, > How and where can this be done? I've recently been developing a project that uses MongoDB to audit Django models. I've just published an early version of this work on launchpad: https://launchpad.net/django-audit/ I haven't got around to writing any documentation yet, but if you're ke

Internationalization and defaults

2010-04-28 Thread Tom Evans
Hi I'm trying to make my website fully i18n/l10n compliant, but I'm hitting a few issues with default values for translations. To test my website, I've set my Accept-Language to French, and compiled a complete french po file for all the currently marked up content on my website. This works for th

Re: django tinymce/filebrowser issue

2010-04-28 Thread Bill Freeman
In firebug (in firefox) there is a "NET" tab that shows you all the stuff that got loaded, including which ones 404. When I was installing this stuff I made the mistake of installing as an egg, and the media subdirectories didn't get pulled in. Both tinymce and filebrowser had problems like this.

forms question in django 1.1

2010-04-28 Thread knight
I have the following form: class ModuleItemForm2(forms.ModelForm): class Meta: model = Module_item fields = ('title', 'media', 'thumb', 'desc', 'default', 'player_option') The model is: class Module_item(models.Model): title = models.CharField(max_length=100) layout =

Saving the query object for later

2010-04-28 Thread Mark Jones
When someone searches for something on the site and finds nothing, I want to save that query for later reuse (so I can run it each night to see if anything new matches their request, and email what is found to the user). What is the best way to go about this? 1. Save the SQL that is generated an

Re: django tinymce/filebrowser issue

2010-04-28 Thread Bobby Roberts
hey bill i'm getting this traceback: NoReverseMatch at /tinymce/filebrowser/ Reverse for 'filebrowser-index' with arguments '()' and keyword arguments '{}' not found. Request Method: GET Request URL:http://www.rakeshark.com/tinymce/filebrowser/ Exception Type: NoReverseMatch

Re: Getting a Blog included in the Django community aggregator

2010-04-28 Thread Russell Keith-Magee
On Wed, Apr 28, 2010 at 9:50 PM, Gustavo Narea wrote: > Hello, Russell et al. > > We also have a relatively new blog where we talk about Django and the > extensions we write for Django, and one of my fellow developers > contacted Jacob a few months ago but he never replied. > > Here's the feed for

Re: Internationalization and defaults

2010-04-28 Thread Tom Evans
On Wed, Apr 28, 2010 at 3:30 PM, Tom Evans wrote: > Hi > > I'm trying to make my website fully i18n/l10n compliant, but I'm > hitting a few issues with default values for translations. > > To test my website, I've set my Accept-Language to French, and > compiled a complete french po file for all t

Re: Saving the query object for later

2010-04-28 Thread Bill Freeman
Presumably the user entered data into a form to perform the search. I'd save the form field values, possibly slightly pre-processed. Remember to include stuff that you're pulling out of, for example, request.user. Then you can change the details of your search function, your database schema, and a

Re: django tinymce/filebrowser issue

2010-04-28 Thread fuxter
> Any > idea what could be causing that? > last time i had exact same problem. existing button but filebrowser not appearing. it was thist one: if you check the url you'd get an clear error about reverse url fault. actually i had to fix tinymce python source: fb_url = "%s://%s%s" % (request.is

background-image

2010-04-28 Thread luca72
Hello i have a problem when i render with django a background image with css: simple css: div#main {position: absolute; top: 20%; left: 20%; bottom: 0; right: 0; overflow:scroll; background-color: black; color:red; font- size:medium; font-family: TimesNR, serif; font-weight: bold;background- image

Re: django tinymce/filebrowser issue

2010-04-28 Thread Bill Freeman
It means that something is calling reverse, or a template is using the url tag, with a bad argument. The argument could be bad in it's own right (if it's your own code doing it, or if something like filebrowser or tinymce is using an improperly set configuration variable from settings.py), or that

Re: statistics, reporting, charts for django

2010-04-28 Thread Georg Holzmann
Hallo ! Yes, thanks, I already looked into google-chartwrapper and they work quite nice ! However, I think I will integrate the interactive charts (google visualization) - there are no template tags for it so far, but a python interface exists: http://code.google.com/p/google-visualization-python/

Re: background-image

2010-04-28 Thread Brett Parker
On 28 Apr 07:51, luca72 wrote: > Hello i have a problem when i render with django a background image > with css: > simple css: > > div#main {position: absolute; top: 20%; left: 20%; bottom: 0; right: > 0; overflow:scroll; background-color: black; color:red; font- > size:medium; font-family: TimesN

Re: background-image

2010-04-28 Thread Bill Freeman
url() must be given a url, not a file path. You need to put the image somewhere that is being served by apache, or by the development server (usually a subdirectory of 'media/' or similar) and then use the corresponding url. For example, when running the devolopment server in /home/me/djprojects/

Re: forms question in django 1.1

2010-04-28 Thread Bill Freeman
I do notice that you have 'player_option' in the fields tuple, while there is no such model field, but instead a field named 'player_options' (plural). If that's actually in the source, I'd fix it before looking any harder. On Wed, Apr 28, 2010 at 10:32 AM, knight wrote: > I have the following f

Re: Static media in development server

2010-04-28 Thread Jonathan Hayward
I found the problem; I was trying to serve static (non-admin) media from a 'media/', and that was apparently being overridden by admin media use of the same URL. On Tue, Apr 27, 2010 at 7:53 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > Thank you; right now I am using the d

unit test for form with recaptcha field

2010-04-28 Thread cerberos
I want to write a form submission unit test for a form that has a recaptcha field, how do I fake a pass? Is there any way to tell in the form code that execution is being done by a test? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: background-image

2010-04-28 Thread luca72
Hello and thanks for your reply i have this: MEDIA_ROOT = '/home/lucak904/Scrivania/Luca/Webframework/Jacopo/sito/ sito_jacopo/media_sito/' MEDIA_URL = '/media_sito/' i have make u subfolder called images under media_sito, but the page is loaded but the image is not show, in the shell of the ser

Re: Saving the query object for later

2010-04-28 Thread Mark Jones
I was thinking I could pickle/unpickle the request then run it thru with an extra flag of (send email) thru the same code that wsgi uses. If I jsonify the data, how would I get that back into a python object? Is it really as simple as str=json.dumps(request) and request = json.loads(str) I don't

Re: Many2Many / Generic Relation filter, doesn't behave like expected, how is the right way to do it?

2010-04-28 Thread HWM-Rocker
On Apr 28, 4:21 am, Tom Evans wrote: > On Wed, Apr 28, 2010 at 1:00 AM, HWM-Rocker wrote: > > I have a TaggedObject that has a GenericRelation to Foo with the name > > tags. When I am searching something like that > > > TaggedObject.objects.filter(Q(tags__tag=1)&Q(tags__tag=4)) > > > I get no O

Re: background-image

2010-04-28 Thread Bill Freeman
Are you using the development server, or are you running behind apache or similar? If the former, have you configured the development server to serve static media? See: http://docs.djangoproject.com/en/1.1/howto/static-files/ If the latter, have you configured the front end server to serve t

Re: Saving the query object for later

2010-04-28 Thread Bill Freeman
The request may have references to objects that will no longer exist, or may be inappropriate when rerun later. I can't promise that it won't work, but I believe that pickling the request is at best a fragile solution. To save just the required parameters won't take much code, especially if you r

Re: Many2Many / Generic Relation filter, doesn't behave like expected, how is the right way to do it?

2010-04-28 Thread Tom Evans
On Wed, Apr 28, 2010 at 5:12 PM, HWM-Rocker wrote: > > > On Apr 28, 4:21 am, Tom Evans wrote: >> On Wed, Apr 28, 2010 at 1:00 AM, HWM-Rocker wrote: >> > I have a TaggedObject that has a GenericRelation to Foo with the name >> > tags. When I am searching something like that >> >> > TaggedObject.o

grabbing request while overriding save or in a signal

2010-04-28 Thread Nick Serra
Hey everyone. I'm trying to access the request object while overriding the save or tapping into the post_save on a model. I need request info when someone posts a comment. But I don't just want to handle this in my view, I would like it to be cleaner than that, so that functionality would remain ev

Re: Admin Inline empty extra - how to access parent form model ID?

2010-04-28 Thread mixit
Ah, ok, this isgetting interesting; the formset, eh? I'm guessing I get to the formset from the parentForm somehow... Right, I shall start poking around and see if I can find the link. Many thanksfor the pointer! Regards, si On Apr 28, 1:55 pm, Daniel Roseman wrote: > On Apr 28, 10:48 am, mixit

Master Slave django applications

2010-04-28 Thread Kashif Ali
Hi, I am working on an applications that is divided into two parts i.e. master, slave. Master application will be used for handling the slave applications and will be installed on a single server while slave will be installed on more than one servers. Actually i have a django based application (s

Transaction commit with cursor.execute

2010-04-28 Thread idle sign
I think I spotted something weird. May be someone could explain that? 1. In Django 1.2 define two DBs (let it be sqlite), one of which name 'test'. 2. Define DB router for 'testapp' so that it always uses 'test' DB. 3. Use 'commit_manually' decorator for 'test' view. 4. In 'test' view define 'curs

Question regarding formset initial number of forms

2010-04-28 Thread Sonal Breed
Hi all, I have a model formset as RowFormSet = modelformset_factory(Row, extra=7) I want to initially display 7 rows. And give user a link to add another row one at a time. Hence I used extra = 7 and omitted max_num parameter. So while saving what happens is that, it adds another 7 rows to the

Re: Oracle cursor.execute problem

2010-04-28 Thread Ian
On Apr 27, 2:36 pm, Tim Sawyer wrote: > Hmm, nearly.  That gets around the error, but the return value isn't > populated. > >  >>> import cx_Oracle >  >>> from django.db import connection >  >>> cursor = connection.cursor() >  >>> lOutput = cursor.var(cx_Oracle.STRING) >  >>> cursor.execute("BEGIN

Models as remote API: High-level questions

2010-04-28 Thread Thomas Allen
Hi everyone, I am building an application where many of the models reside on another server, being served by a PHP application (we needed to do that because many clients can only host PHP). What facilities does Django provide for this sort of interaction, and how might you consider implementing i

Re: Saving the query object for later

2010-04-28 Thread Peter Landry
+1 to this. I had similar requirements, and initially went down the road of pickling a queryset. It became clear quickly that (at least in my case) a better solution was to have a function that translates a Form instance into a Queryset. Then serialize the form (or form data) and regenerate the Que

Re: Models as remote API: High-level questions

2010-04-28 Thread Tom Evans
On Wed, Apr 28, 2010 at 6:37 PM, Thomas Allen wrote: > Hi everyone, > > I am building an application where many of the models reside on > another server, being served by a PHP application (we needed to do > that because many clients can only host PHP). > > What facilities does Django provide for t

Re: Models as remote API: High-level questions

2010-04-28 Thread Thomas Allen
That looks excellent, thank you. I like that it integrates with the admin, which means I can test the interaction with the remote app very easily. Of course I'm still interested in any other opinions :^) Thomas On Apr 28, 2:08 pm, Tom Evans wrote: > On Wed, Apr 28, 2010 at 6:37 PM, Thomas Allen

Template composition: Rendering based on permissions

2010-04-28 Thread Thomas Allen
Hi everyone, I have two questions about rendering specific design elements, and the second ties in somewhat with the first. How do you make a variable available in multiple views (multiple templates)? For instance, maybe I want the active user object to be available on each page so that I can ren

Re: Template composition: Rendering based on permissions

2010-04-28 Thread Thomas Allen
I think that template context processors are the answer to my first question. As for my second question, I could certainly check for permission membership in the provided PermWrapper, but I'm very interested in a way to check this based on the view permission requirement (implicitly). Thomas --

Inconsistency between DB Query Results Between Threads

2010-04-28 Thread Jared Smith
Using Django DB API I have two threads one that increments a counter getting stored to the database and then another thread that is reading this counter. T1(Thread 1) increments T2(Thread 2) reads I have found that if I increment and store the counter value in T1 and then if I fetch it in the sa

following reverse relationship of an extended model

2010-04-28 Thread Nick Serra
Hey, quick query question. I know there has to be an answer for this one, just don't know the syntax. I need to follow the reverse relationship for an extended model. class Account(models.Model): name = CharField class Entry(models.Model): account = ForeignKey(Account) class Page(Entry):

Re: following reverse relationship of an extended model

2010-04-28 Thread zinckiwi
> class Account(models.Model): >     name = CharField > > class Entry(models.Model): >     account = ForeignKey(Account) > > class Page(Entry): >     name = CharField > > There's my simple example. I want to get all pages that belong to > Account. account.page_set.all() does not relate, and I can d

Re: following reverse relationship of an extended model

2010-04-28 Thread Nick Serra
Yeah, that is going to be my fallback, I was just curious on an actual reverse relationship solution to the situation. Thanks for the input! On Apr 28, 4:12 pm, zinckiwi wrote: > > class Account(models.Model): > >     name = CharField > > > class Entry(models.Model): > >     account = ForeignKey(

Re: odering User in a form

2010-04-28 Thread zinckiwi
> class Pubblicazioni(models.Model): >     anno = models.DateField(blank=True, null=True,default=datetime.date.today) >     autori = models.CharField(max_length=500) >     titolo = models.CharField(max_length=500) >     autori_daf = models.ManyToManyField(User) > > I need to ordering  (by the User.

Template lookup order not behaving as expected

2010-04-28 Thread Thomas Allen
Hi everyone, In my "pages" app, I have the following view function which renders index.html: @login_required def index(req): return render_to_response( 'index.html', context_instance=RequestContext(req) ) What really has me stuck here is that it doesn't render pages/ template

Re: Template lookup order not behaving as expected

2010-04-28 Thread Thomas Allen
I have noticed that the first app in my INSTALLED_APPS tuple overrides all of the others for an ambiguous template name. "accounts" does not have one, but "dashboard" does, which is why I am seeing what I am seeing (if I place "ads" above "dashboard", the "ads" template precedes all others). I thou

QuerySet.Create Driving Me Mad

2010-04-28 Thread MauroCam
Enough! I have battled with this for the past few hours, but to no avail. I basically cannot get a QuerySet.Create or a model Save() to save some non mandatory URLField values. Below is the code cleaned up and commented, hoping I haven't cleaned up too much. Any help / explanation of what is wr

manage.py runserver --adminmedia

2010-04-28 Thread Thomas Neumeier
Hi, I'm trying to install django-grappelli. the admin media is perfectly found, if I run the development server: "python manage.py runserver --adminmedia=/path/to/grappelli/media". i would like to make a change to settings.py so i can leave out the --adminmedia flag, when calling manage.py runs

"No module named admin.site.root" on r13043

2010-04-28 Thread sli
I've been trying to fix this issue for about half an hour, now. Current code: from django.contrib import admin admin.autodiscover() ... # Uncomment the next line to enable the admin: (r'^admin/(.*)', include('admin.site.root')), I've also tried the version that is used in a newly created project

manage.py runserver --adminmedia

2010-04-28 Thread Thomas Neumeier
Hi, im trying to setup django grappelli. i'm using django 1.1.1, and grappelli 3 the setup works fine, as long as I specify the --adminmedia flag. but when i run the manage.py test command i get exactly the same tests failing as if i would run the test command on a clean django install. i thougt, i

django-admin tab completion not working

2010-04-28 Thread Martin Lundberg
Hello, I've source the django_bash_completion script but when I try to use it by hitting TAB I get this: $ django-admin.py heType 'django-admin.py help' for usage. I hit tab after 'he' but it is not working and I get the above message instead. Any idea what I'm doing wrong? Thanks, -Martin -

Re: "No module named admin.site.root" on r13043

2010-04-28 Thread Ramiro Morales
On Wed, Apr 28, 2010 at 6:02 PM, sli wrote: > I've been trying to fix this issue for about half an hour, now. > Current code: > > from django.contrib import admin > admin.autodiscover() > ... > # Uncomment the next line to enable the admin: > (r'^admin/(.*)', include('admin.site.root')), > > I've

Re: Models as remote API: High-level questions

2010-04-28 Thread Thomas Allen
I'm sorry, I should've specified that I am using Django 1.1 (Django- ROA is compatible with 1.2 only according to its documentation). Thomas -- 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...@googl

Re: Template composition: Rendering based on permissions

2010-04-28 Thread Nick
The bible for user authentication is found here http://docs.djangoproject.com/en/1.1/topics/auth/ The quick answer to number 2 is to check for authentication in a template tag: {% if user.is_authenticated %} Welcome back you rotten jerk {% else %} Log in, you rotten jerk {% endif %} On Apr 28, 2

Re: Inconsistency between DB Query Results Between Threads

2010-04-28 Thread Tomasz Zieliński
On 28 Kwi, 22:04, Jared Smith wrote: > Using Django DB API I have two threads one that increments a counter getting > stored to the database and then another thread that is reading this counter. > > T1(Thread 1) increments > T2(Thread 2) reads > > I have found that if I increment and store the c

QuerySet.distinct and aggregates

2010-04-28 Thread Wedg
I guess I'm writing this to confirm a behaviour and see if there might be a work around. It appears that qs.aggregate(Sum('field')) ignores qs.distinct(). If I have something like this: qs = Model.objects.filter(reverserelation__field=id).distinct() ... then len(qs) will return the correct numb

Re: Template lookup order not behaving as expected

2010-04-28 Thread creecode
Hello Thomas, On Apr 28, 2:33 pm, Thomas Allen wrote: > I have noticed that the first app in my INSTALLED_APPS tuple overrides > all of the others for an ambiguous template name. "accounts" does not > have one, but "dashboard" does, which is why I am seeing what I am > seeing (if I place "ads" ab

fixtures for test fail to load

2010-04-28 Thread eka (Esteban)
Hi all, Did a dumpdata of my project, then added that to my test and I get: DoesNotExist: XXX matching query does not exist. The strange thing is that manually loading it using loaddata works perfectly. Any clue? Note: Using django.test.TestCase -- You received this message because you are subs

Re: fixtures for test fail to load

2010-04-28 Thread eka (Esteban)
Found that loaddata also doesn't work when the DB has no records. Same error. On Apr 28, 7:47 pm, "eka (Esteban)" wrote: > Hi all, > > Did a dumpdata of my project, then added that to my test and I get: > DoesNotExist: XXX matching query does not exist. > The strange thing is that manually loadi

Deleting parent object when many related objects exist is to slow

2010-04-28 Thread dzida
Hi all, I came here with following problem: I was pretty happy user of Django ORM delete method until I found that it takes a lot of time when you want to delete object that has A LOT of objects connected to it via FK. Assume we have 3 models defined: class A(models.Model): pass class

Everyblock deployment structure configuration

2010-04-28 Thread Joshua Partogi
Hi All, This might be a little bit off-topic. I would like to learn about django deployment structure in Everyblock. Would anyone by chance know how does Everyblock deploy it's django app? I can see that every city maps into a subdomain. Does Everyblock deploy one app per subdomain, or is it only

Re: Error with django-registration

2010-04-28 Thread andy saksena
Thanks Its been resolved On Apr 28, 5:10 pm, James Bennett wrote: > On Wed, Apr 28, 2010 at 2:46 AM, andy saksena wrote: > > (111, 'Connection refused') > > As a Google search would have told you, this is the error Python's > smtplib module will raise when you tell it to connect to a mail server

Re: Deleting parent object when many related objects exist is to slow

2010-04-28 Thread Christophe Pettus
On Apr 28, 2010, at 4:36 PM, dzida wrote: "When Django deletes an object, it emulates the behavior of the SQL constraint ON DELETE CASCADE -- in other words, any objects which had foreign keys pointing at the object to be deleted will be deleted along with it. ", which is something I really want

Re: Template lookup order not behaving as expected

2010-04-28 Thread Thomas Allen
On Apr 28, 6:41 pm, creecode wrote: > You could add a "pages" directory to your templates directory. > Something like... > > ./pages > ./pages/templates > ./pages/templates/pages > > And then you would do... > > return render_to_response( 'pages/index.html'... Thanks! It looks like that is also h

Moving django.contrib.auth to its own database

2010-04-28 Thread Brandon Belew
Hello, I am attempting to use a database router to move django.contrib.auth off to its own database. Reasoning behind this - I want to share just a few tables ( Auth and a custom app called AdminAccess ) across multiple sites which might be on multiple servers not sharing a single codebase.

Re: Moving django.contrib.auth to its own database

2010-04-28 Thread Russell Keith-Magee
On Thu, Apr 29, 2010 at 8:32 AM, Brandon Belew wrote: > Hello, > > I am attempting to use a database router to move django.contrib.auth > off to its own database.   Reasoning behind this - I want to share > just a few tables ( Auth and a custom app called AdminAccess )  across > multiple sites whi

Re: Transaction commit with cursor.execute

2010-04-28 Thread Russell Keith-Magee
On Thu, Apr 29, 2010 at 12:59 AM, idle sign wrote: > I think I spotted something weird. May be someone could explain that? > > 1. In Django 1.2 define two DBs (let it be sqlite), one of which name > 'test'. > 2. Define DB router for 'testapp' so that it always uses 'test' DB. > 3. Use 'commit_manu

Re: Transaction commit with cursor.execute

2010-04-28 Thread idle sign
I thought so, have tried so, but got "This code isn't under transaction management", and opened this thread :) Environment: Request Method: GET Request URL: http://localhost:8000/ Django Version: 1.2 beta 1 Python Version: 2.6.4 Installed Applications: ['testapp'] Installed Middleware: ('django.m

Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-28 Thread Continuation
I'm using MySQL with Django. MySQL uses clustered index. I have a class AuctionBid for which the "natural" PK is (user_id, auction_id). I'd like to set (user_id, aucton_id) as the PK so that it'll be the clustered index. I understand that Django doesn't support composite PK. But what if after syn

Re: Transaction commit with cursor.execute

2010-04-28 Thread Russell Keith-Magee
On Thu, Apr 29, 2010 at 11:04 AM, idle sign wrote: > I thought so, have tried so, but got "This code isn't under > transaction management", and opened this thread :) I get that error if I *omit* the using= argument to commit (which is what I'd expect to see). What version of trunk are you using?

Re: Inconsistency between DB Query Results Between Threads

2010-04-28 Thread Jared Smith
Thanks for the advice it appears that the issue was related to the old transaction sticking around. I put: @transaction.commit_on_success On top of the method and it looks like I'm no longer getting stale data; guess I'll have to go do this around all data retrieval methods. I was assuming I nee

Re: Transaction commit with cursor.execute

2010-04-28 Thread idle sign
I'm using the latest trunk from http://github.com/django/django. A complete test project you can grab at http://idlesign.narod.ru/django/django-tests.tar.gz There is a little bootstrap.sh to run to create DBs. Thank you, Russ. On 29 апр, 10:16, Russell Keith-Magee wrote: > On Thu, Apr 29, 2010

manyToManyField custom column names

2010-04-28 Thread DimebagBorgir
Hi, I'm porting an old database from an inhouse system to django and I'm just wondering if there is anything like what is defined at this URL in django 1.1.1 or upcoming versions: http://undefined.org.ua/blog/2008/02/29/manytomanywithcustomfield/?lang=en I could easily rename the fields to conform

using django-registration

2010-04-28 Thread andy saksena
Hi all, I m using django-registration app from bitbucket for a form in my project and stuck in understanding where is the model of the form. my database for he project has a table named registration profile woth the uniqhe id..but whatever fields i have in the database are getting populated in some

"dynamically" setting ModelAdmin properties?

2010-04-28 Thread akonsu
hello, in my custom admin class that inherits ModelAdmin i need to set ModelAdmin.exclude, ModelAdmin.list_display, etc based on whether the logged in user is a superuser or not. is this possible? thanks konstantin -- You received this message because you are subscribed to the Google Groups "

Re: forms question in django 1.1

2010-04-28 Thread knight
Thanks a lot. That's the problem. As always, my stupid mistake. On Apr 28, 6:12 pm, Bill Freeman wrote: > I do notice that you have 'player_option' in the fields tuple, while > there is no such model field, but instead a field named 'player_options' > (plural).  If that's actually in the source,

Re: Transaction commit with cursor.execute

2010-04-28 Thread Russell Keith-Magee
On Thu, Apr 29, 2010 at 12:20 PM, idle sign wrote: > I'm using the latest trunk from http://github.com/django/django. > A complete test project you can grab at > http://idlesign.narod.ru/django/django-tests.tar.gz > There is a little bootstrap.sh to run to create DBs. > > Thank you, Russ. Ok - u

Saving Child Records via ForeignKeyField

2010-04-28 Thread Robinson B. Heath
I believe I have done my due diligence, but point me in the right direction if I am missing something. I am working on a generic importing engine to import various file formats(csv, fixed length, etc) into django models based on json formatted file definitions. It needs to do something like th

Re: Saving Child Records via ForeignKeyField

2010-04-28 Thread akonsu
hello, it would be easier to help if you provided your modes. are you missing this: http://docs.djangoproject.com/en/dev/ref/models/relations/#ref-models-relations for example: >>> b = Blog.objects.get(id=1) >>> e = b.entry_set.create( ... headline='Hello', ... body_text='Hi', ... p

Re: Transaction commit with cursor.execute

2010-04-28 Thread idle sign
> When line 7 is uncommented, transaction management is > enabled, and the view works as I would expect. So it is, my bad, Russ, thank you againg. You see, it seemed a little weird, that first (with the decorator) we force transaction to commit manually to 'test' all that would happen in our view