double logging in unittest

2008-12-18 Thread knight
Hi, I have unittests in my django applications and I have a strange behavior: When I run the tests, I am getting each print-out to log from my application twice. I am using the standard python logging libraries. Does anyone know this issue? Thanks, Arshavski Alexander. --~--~-~--~~--

Re: Templates dir exception

2009-01-04 Thread knight
I think you can try accessing books/publisher_list.html instead of just publisher_list.html This should solve the problem, if I understand it correctly. Regards, Alex A. On Jan 4, 11:11 am, HB wrote: > Hey, > My Django project has the  following structure: > +++ > djcode >        # Django files

Re: Filtering parents by child attributes

2009-01-04 Thread knight
Try something like: students = Student.objects.all() absences = Absences.objects.all() for absence in absences: students.remove(absence.fk) Maybe I'm wrong somewhere in the syntax, but the idea should be clear. Regards, Alex A. On Jan 2, 6:57 pm, Mathieu Steele wrote: > Here is an example

ManyToMany problem

2009-01-04 Thread knight
Hi, I have the following problem: I have models.py with the following class: class Section(Feed): parent = models.ManyToManyField('self', blank=True, null=True) depth = models.IntegerField(editable=False) def save(self): self.depth = 1 if self.parent: self

Re: ManyToMany problem

2009-01-09 Thread knight
Thanks, Meir. On Jan 7, 11:24 am, mksoft wrote: > Hi Alex, > > On Jan 4, 12:27 pm, knight wrote: > > > > > Hi, > > > I have the following problem: > > I have models.py with the following class: > > > class Section(Feed): > >     parent

Re: admin sorting in ManyToMany fields

2009-01-28 Thread knight
Hi, You can do it by adding: class Meta: ordering = ['name'] to you Name class. Regards, Alex A. On Dec 24 2008, 9:17 am, "Aaron Lee" wrote: > Hi I have a ManyToMany field names in my class and I would like to show the > names in sorted order (according to 'name') in the admin interfa

Changing default app url in development server

2009-02-03 Thread knight
Hi, My question is: Is there a way to change my default app url in development server from http://localhost:8000 to http://localhost:8000/peergw. If it's a problem, maybe someone have a good reference for configuring apache server on MAC. Regards, Arshavski Alexander. --~--~-~--~~-

Overriding admin template: index.html

2009-02-03 Thread knight
Hi, I want to override admin template: index.html. I have found the template but not the view that renders it. Maybe someone know how django rendering index.html template and where I can find the view? Thanks, Arshavski Alexander. --~--~-~--~~~---~--~~ You receive

Re: Overriding admin template: index.html

2009-02-04 Thread knight
Hi, Thanks for the fast reply. I read this but I still cannot find the view that renders index.html. Regards, Arshavski Alexander On Feb 4, 9:52 am, Kenneth Gonsalves wrote: > On Wednesday 04 Feb 2009 1:18:53 pm knight wrote: > > > I want to override admin template: index.html

Re: Changing default app url in development server

2009-02-04 Thread knight
you trying to do? If your development appserver is conflicting with > a locally installed apache then why not just use a different port? > > python manage.py runserver 8001 > > 2009/2/4 knight > > > > > Hi, > > > My question is: > > > Is there a way

Re: Overriding admin template: index.html

2009-02-04 Thread knight
My problem is that I want to pass additional variables to index.html. So I thought I can do it if I add these variables to view that renders index.html. Regards, Alex A. On Feb 4, 10:55 am, Kenneth Gonsalves wrote: > On Wednesday 04 Feb 2009 2:05:37 pm knight wrote: > > > Thanks

Re: Changing default app url in development server

2009-02-04 Thread knight
d be used > > > >> only for dev server, not for apache. > > > > > What about simply using the django.root PythonOption when running under > > > > Apache: > > > > >http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#basi... > &

default value for foreign key and CharField

2009-02-05 Thread knight
Hi, I have the following classes in my models.py: class Default(models.Model): name = models.CharField(max_length=50, choices = (('rental_period', 'rental_period'), ('currency', 'currency')), unique=True) value = models.CharField(max_length=50) class Media_biz(models.Model): name =

Re: default value for foreign key and CharField

2009-02-05 Thread knight
, Alex A. On Feb 5, 10:59 pm, Rajesh Dhawan wrote: > On Feb 5, 10:59 am, knight wrote: > > > > > Hi, > > > I have the following classes in my models.py: > > > class Default(models.Model): > >     name = models.CharField(max_length=50, choices = > >

Re: default value for foreign key and CharField

2009-02-09 Thread knight
Thanks, My Media_biz is edited inline in another class. So I have: class MetadataInline(admin.StackedInline) and class MetadataAdmin(admin.ModelAdmin) Can you tell what method I should override and in which class in order to set the initial value while editing inline? Regards, Alex Arshavski.

default value for foreign key

2009-02-23 Thread knight
Hi, I have models.py like this: class Media_biz(models.Model): --- default = models.BooleanField("Default", blank=True, null=True) --- def get_default_Media_biz(): if Media_biz.objects.filter(default=True).count() != 0: return Media_biz.objects.filter(default=True)[0]

checking if db is empty

2009-02-25 Thread knight
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) Thanks, Arshavski Alexander. --~--~-~--~~~---~--~~ You received this message because you are subscribed t

admin templates problem

2009-03-01 Thread knight
Hi, I have a django application where I override the main admin page (index.html in template/admin) I use apache, I have a link to admin media folder and I have a following problem: In my admin pages I see the admin templates on all the pages except the one I overrided (index.html). Is anyone kn

import settings problem

2009-03-09 Thread knight
Hi, I am trying to install django application on CentOS 5 and I'm getting this error, when I go to the admin page: ImportError: Could not import settings 'mx30.settings' (Is it on sys.path? Does it have syntax errors?): No module named mx30.settings my httpd.conf looks like this: LoadModule py

Languages problem

2009-03-24 Thread knight
Hi, I have the following class in my models.py: class MainCategory(models.Model): title = models.CharField(max_length=50) value = models.DecimalField(default=0, max_digits=5, decimal_places=3) secid = models.SlugField(max_length=1000, editable=False) def save(self): if no

encoding question

2009-06-24 Thread knight
Hi, I have html page with inline editing. (I have text, that when I click on it, it changes to edit box, and I can change the text) I do it with some java scripts. (http://www.yvoschaap.com/index.php/ weblog/ajax_inline_instant_update_text_20/) The problem is that I should save the text that I ch

apache write permissions

2009-08-04 Thread knight
Hi, I have a django project with the following apache configuration: LoadModule python_module modules/mod_python.so SetHandler python-program PythonPath "['/home/alex'] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mx30.settings PythonOption django.root

turning login off in admin

2009-09-01 Thread knight
Hi, I want to turn off the login when going to the admin page url. I want to enter to admin pages as anonymous/no user and require login only in 2 specific urls. How can I turn off the login request in the beginning? Thanks, Arshavski Alexander. --~--~-~--~~~---~--~--

Could not import settings

2009-03-31 Thread knight
Hi, I'm trying to install my django application on CentOS 5 and I'm getting the following error: ImportError: Could not import settings 'mx30.settings' (Is it on sys.path? Does it have syntax errors?): No module named mx30.settings My httpd.conf looks as follows: Listen 80 SetHandler python-p

python version

2009-04-05 Thread knight
Hi, I have 2 servers with my django app: The first one has python2.5 as default python and the second don't (It has python2.5 installed together with the older version). I want to run dumpdata from my application and I have the following problem: If I call: "python manage.py dumpdata" the second

apache maximum users config

2009-05-13 Thread knight
Hi, I have a django application running on apache2 with default httpd.conf. Is anybody knows a simple way to configure apache2 (httpd.conf) for the best performance. I mean allow maximum amount of simultaneous users? Thanks, Alex A. --~--~-~--~~~---~--~~ You recei

apache maximum users config

2009-05-13 Thread knight
Hi, I have a django application running on apache2 with default httpd.conf. Is anybody knows a simple way to configure apache2 (httpd.conf) for the best performance. I mean allow maximum amount of simultaneous users? Thanks, Alex A. --~--~-~--~~~---~--~~ You recei

Disable apache directory browsing

2009-09-23 Thread knight
Hi, I have installed django app with wsgi. I see that by default I have directory browsing enabled in my static files and I want to turn it off. My httpd.conf: LoadModule python_module modules/mod-wsgi.so WSGIScriptAlias /peergw /home/alex/mx30/django.wsgi Alias /media/ /var/www/media/ Alias /

extends tag in template

2009-10-20 Thread knight
Hi, I have override 2 admin templates: index.html and base_site.html. The first line of index.html is: {% extends "admin/base_site.html" %} Everything works fine, but if I insert {{ MEDIA_URL }} in base_site.html, I get the following error when going to my admin page: TemplateSyntaxError at /adm

Re: extends tag in template

2009-10-20 Thread knight
Thanks for the reply. It doesn't matter where I put {{ MEDIA_URL }}. I get the error in any case On Oct 20, 11:09 am, bruno desthuilliers wrote: > On 20 oct, 09:56, knight wrote: > > > Hi, > > > I have override 2 admin templates: index.html and base_site.html. > &

wsgi config

2009-11-08 Thread knight
Hi. I have a problem with configuring my django site with mod_wsgi. My httpd.conf is: LoadModule wsgi_module modules/mod-wsgi.so WSGIScriptAlias /peergw C:/mxhw/mx30/django.wsgi Order deny,allow allow from all Alias /media/ "C:\Program Files\Apache Software Foundation \Apache

Re: wsgi config

2009-11-11 Thread knight
ia alias looks like: > > Alias /media/ "C:/Program Files/Apache Software > Foundation/Apache2.2/htdocs/django/media/" > Foundation/Apache2.2/htdocs/django/media/"> > Order allow,deny > Allow from all > > > > > On Sun, Nov 8, 2009 at 11:37 PM, kni

App engine launcher on windows problem

2009-11-29 Thread knight
I'm trying to install app engine with django 1.1 on windows. When launching the app engine I'm getting the following error: http://slexy.org/view/s21oLrbkHh The steps I do are: 1.) Create new app via launcher 2.) Copy my code (Which is empty django project) My main.py code: http://slexy.org/view/

mod_wsgi configure problem

2009-12-01 Thread knight
Hi, I need my django app to listen to port 80 and port . I have 2 servers. One is listening to both ports and one is not listening to . The first one's apache conf is: Listen WSGIRestrictStdout Off WSGIPassAuthorization On LoadModule wsgi_module modules/mod-wsgi.so WSGIScriptAlias /

django running xp problem

2009-12-03 Thread knight
I have OSX machine running django app with appengine launcher and a wirtual machine with windows XP running the same app. The problem is that I have 2 XP machines where I get: "No module named urls". What can be the problem? Maybe some system variables? The code is exactly the same. Regards, Arsha

twitter login button

2010-04-15 Thread knight
HI I have a django application running on app engine and I want to add a twitter login to my application. Do you have a good links how to do that. I already registered my app in twitter. Just don't know how to do login/logout buttons. Thanks, Arshavski Alexander -- You received this message bec

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 =

Re: forms question in django 1.1

2010-04-28 Thread knight
 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 form: > > > class ModuleItemForm2(forms.ModelForm): > >    class Meta: > >

uploading file in 2 steps

2010-05-31 Thread knight
Hi, I want to upload a file in 2 steps. First I want to upload it and show the errors and on the second step I want actually to save the file data in the database. So I made a simple form and my problem is how to pass the same file to the form on the second step. I mean how to insert request.FILES

fabric ssh connect problem

2010-05-31 Thread knight
Hi, I'm trying to deploy a django app with fabric and get the following error: Alexs-MacBook:fabric alex$ fab config:instance=peergw deploy -H - u -p [192.168.2.93] run: cat /etc/issue Traceback (most recent call last): File "build/bdist.macosx-10.6-universal/egg/fabric/main.py", line 419, i

moving to django 1.2.1

2010-07-28 Thread knight
Hi, I have pretty big django app running on django 1.0.2 and I want to move it to django 1.2.1 since I want to use multiple databases. What are the minimal changes that I need to make in order to work with 1.2.1? I mean, what should I do regarding csrf and so on... Is there a good place to read ot

Re: moving to django 1.2.1

2010-07-28 Thread knight
Is anybody knows a good post or blog about these thing including csrf changes? On Jul 28, 4:33 pm, Maksymus007 wrote: > On Wed, Jul 28, 2010 at 3:29 PM, Massimiliano Ravelli > > wrote: > > On Jul 28, 3:13 pm, knight wrote: > >> What are the minimal changes that I need

Re: moving to django 1.2.1

2010-07-28 Thread knight
Does anybody knows a good post or blog about the changes including csrf? On Jul 28, 4:33 pm, Maksymus007 wrote: > On Wed, Jul 28, 2010 at 3:29 PM, Massimiliano Ravelli > > wrote: > > On Jul 28, 3:13 pm, knight wrote: > >> What are the minimal changes that I need to ma

Re: moving to django 1.2.1

2010-07-29 Thread knight
Thank you all for the links and advises. It really helps me. Regards, Alex A. On Jul 29, 10:32 am, Russell Keith-Magee wrote: > On Wed, Jul 28, 2010 at 9:29 PM, Massimiliano Ravelli > > wrote: > > On Jul 28, 3:13 pm, knight wrote: > >> What are the minimal changes that

load auth data with natural keys

2010-08-16 Thread knight
Hi, I am using django 1.2.1. I dumped the auth data with natural keys (-- natural), but when I try to load them I get the following error: Installing xml fixture 'auth' from absolute path. Problem installing fixture 'auth.xml': Traceback (most recent call last): File "/var/peertv/peergw/.env/li

postgres exception

2010-02-01 Thread knight
I have django application and I'm using postgres. I try to execute the bollowing line in one of my tests: print BillingUser.objects.all() and I get the following error: "current transaction is aborted, commands ignored until end of transaction block." My postresql log is here: http://slexy.org/vi

test fixtures

2010-02-01 Thread knight
Hi, I want to use some fixtures in my tests. I have cms_sample app and a fixtures folder inside with cms_sample_data.xml I use the following in my test.py: class Funtionality(TestCase): fixtures = ['cms_sample_data'] But the fixtures are not loaded. What am I missing? Thanks, Arshavski Ale

Re: postgres exception

2010-02-01 Thread knight
Thanks. I solved the problem. I added transaction.rollback() to one of the exceptions. Thanks On Feb 1, 2:27 pm, Shawn Milochik wrote: > Do you have any messages coming from prior to that? The error you're > receiving comes when something else has blown up with your database > transaction, and

Re: test fixtures

2010-02-02 Thread knight
Hi, Thanks for the reply. Checked both things and it's fine. I mean, I can load the fixtures with loaddata and I'm importing from django.test. Any other ideas? On Feb 1, 4:28 pm, Russell Keith-Magee wrote: > On Mon, Feb 1, 2010 at 10:01 PM, knight wrote: > > Hi, >

moving to Django 1.1 problem

2010-02-15 Thread knight
Hi, I'm trying to move from django 1.0.2 to 1.1 and I am getting the following error in one of my templates: Request Method: GET Request URL:http://localhost:8000/conserv/media_assets/vod/ Exception Type: TemplateSyntaxError Exception Value:Caught an exception while rendering: 'NoneTy

Re: moving to Django 1.1 problem

2010-02-15 Thread knight
Thanks, You are great. It also solves my problem. :) On Feb 15, 3:32 pm, bruno desthuilliers wrote: > On Feb 15, 1:30 pm, knight wrote: > > Don't know if it has anything to do with your problem, but there's an > error in your form: > > > > > My form:

anonymous user

2010-02-19 Thread knight
How can I just enable anonymous user in Django? I mean, what is the minimum I should do to be logged in as anonymous first time I go to my site? Regards, Arshavski Alexnder. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

more than 1 foreign key

2010-03-09 Thread knight
I have the following models: http://slexy.org/view/s20T8yOiKZ. When I try to click add button for worlds in admin page it shows me the following error: has more than 1 ForeignKey to . I think it's something to do with inline. What can it be? Regards, Arshavski Alexander. -- You received this me

search and filtering in app engine

2010-04-02 Thread knight
Hi, I'm trying to add filter and search to my site. It's exactly the same code as in another working django project. The difference is that this time I do it with app engine. my views: http://slexy.org/view/s21GMw2sh1 my forms: http://slexy.org/view/s21XX8bquM my search function: http://slexy.org

Re: search and filtering in app engine

2010-04-06 Thread knight
Thanks. On Apr 2, 4:22 pm, Waldemar Kornewald wrote: > On Apr 2, 12:26 pm, knight wrote: > > > 1.) I get error: "'Query' object has no attribute 'all'" on line 59 in > > views. > > As I understand it's something to do with the f

Problem with loading fixture xml to Postgres database

2008-01-14 Thread knight
Hi, I have a large fixture initial_data.xml and I'm trying to syncdb on new Postgres database, & though it says it imported 764 objects, I see none in the db. After a little investigation, I think it is related to dependencies between classes (foreign keys), which aren't handled in the right orde

Problem with loading fixture xml to Postgres database

2008-01-14 Thread knight
Hi, I have a large fixture initial_data.xml and I'm trying to syncdb on new Postgres database, & though it says it imported 764 objects, I see none in the db. After a little investigation, I think it is related to dependencies between classes (foreign keys), which aren't handled in the right orde

Re: Problem with loading fixture xml to Postgres database

2008-01-14 Thread knight
If I put the objects in my fixture in the right order, I can see them in the database after they are loaded. Do you have any other suggestions? Regards, Alex. On Jan 15, 12:40 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Jan 14, 2008 11:46 PM, knight <[E

Re: Problem with loading fixture xml to Postgres database

2008-01-16 Thread knight
Arshavski. On Jan 15, 9:09 am, knight <[EMAIL PROTECTED]> wrote: > If I put the objects in my fixture in the right order, I can see them > in the database after they are loaded. > Do you have any other suggestions? > > Regards, > Alex. > > On Jan 15, 12:40 am, "Rus

Re: Problem with loading fixture xml to Postgres database

2008-01-16 Thread knight
Arshavski. On Jan 15, 9:09 am, knight <[EMAIL PROTECTED]> wrote: > If I put the objects in my fixture in the right order, I can see them > in the database after they are loaded. > Do you have any other suggestions? > > Regards, > Alex. > > On Jan 15, 12:40 am, "Rus

Re: Problem with loading fixture xml to Postgres database

2008-01-17 Thread knight
I used the same fixtures data. I'm sorry, but I don't have Python 2.3.5 environment anymore, so I can not check it. Regards, Alex Arshavski. On Jan 17, 12:42 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Jan 16, 2008 10:47 PM, knight <[EMAIL PROTE

Re: Help with manage.py syncdb

2009-11-17 Thread Adam Knight
something to make it more complicated! Woo! More: http://stackoverflow.com/questions/1380281/set-snow-leopard-to-use-python-2-5-rather-than-2-6 Adam Knight codepoetry - http://www.codepoetry.net/products/ On Nov 16, 2009, at 11:40 PM, jd_python wrote: > What am I possibly doing wrong?

Re: How to use subqueries in django

2009-11-17 Thread Adam Knight
pics/db/queries/#complex-lookups-with-q-objects Adam Knight codepoetry - http://www.codepoetry.net/products/ -- 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 unsub

Drupal migration

2009-11-17 Thread Adam Knight
mands/convertdrupal.py) Adam Knight codepoetry - http://www.codepoetry.net/products/ -- 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 t

Re: Redirect problems

2009-11-18 Thread Adam Knight
, {'url': '/admin/wkw1/lawyer/'}), > ) > > but this too results in a server error. > > Any suggestions? > > Thanks. Order matters. urlpatterns = patterns('', (r'^wkw1/$', 'sw1.wkw1.views.index'), ) urlp

Re: Multiple level aggregate

2009-11-18 Thread Adam Knight
hem with the conditions you want and then apply the aggregate operation to that. Adam Knight codepoetry - http://www.codepoetry.net/products/ -- 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...

Re: no attribute 'save_m2m'

2010-01-18 Thread Adam Knight
Ensure it's the save() method on the FORM and not the MODEL. :) On Mon, Jan 18, 2010 at 12:23 PM, GoSantoni wrote: > Hi Nek4life, > > Unfortunately that didn't work. > > TypeError at /blog/new/ > save() got an unexpected keyword argument 'commit' > Request Method: POST > Request URL:    http://lo

Re: Adding new columns to an existing application's Tables

2006-10-10 Thread Sir Knight
Thanks Ramdas --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED]

Re: Curious error with Free Comments

2006-11-16 Thread Sir Knight
No, I neve touched any of those I guess it has to do with the fact that I do not have article.id property. What did I do wrong in models this time around Ramdas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

Management form in Model Formsets

2012-06-30 Thread Knight Samar
Hi, I am using Django 1.2 and developing using Model formsets. Using JavaScript, I am allowing the user to dynamically "Add another" formset on the template, but I can't figure out what exactly I have to modify in the management forms, for all the formsets to be successfully saved. The documen

Re: Management form in Model Formsets

2012-07-01 Thread Knight Samar
check this snippet out: djangosnippets.org/snippets/1389 > */* > Le 1 juil. 2012 06:27, "Knight Samar" a écrit : > >> Hi, >> >> I am using Django 1.2 and developing using Model formsets. Using >> JavaScript, I am allowing the user to dynamically "

Re: invalid literal for int() with base 10

2012-10-22 Thread Nathan Knight
Just so you know, it is bad practice to use "import * " when importing modules in python. With many modules being used, you can run into conflicting definitions. Plus, it increases overhead - potentially an exponential decrease in performance! -- You received this message because you are subs

Getting children of an ABC

2012-01-01 Thread Knight Samar
I am using Django 1.3.1 and I have the following piece of models: class masterData(models.Model): uid = models.CharField(max_length=20,primary_key=True) class Meta: abstract = True; class Type1(masterData): pass; class Type2(masterData): pass; Now, I am trying to get

Django not enforcing blank=False on a model

2013-07-29 Thread Knight Samar
Hi, I have a model > from django.db import models > > class Organization(models.Model): > name = models.CharField(max_length=100, > blank = False, #mandatory > help_text = "Name of your Organization", > verbo

Documentation error?

2011-03-14 Thread Adam Knight
On the description for django.contrib.auth.views.login at http://docs.djangoproject.com/en/1.2/topics/auth/#django.contrib.auth.views.loginthe documentation says: If you are using alternate authentication (see Other authentication sources) > you can pass a custom authentication form to the login v

Re: Will Complex URLs Slow Things Down?

2006-05-26 Thread Cameron Kenneth Knight
3. "(?i)pattern" matches "PATTERN" --~--~-~--~~~---~--~~ 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