Re: Django testing strategy

2012-10-04 Thread Evan Brumley
django-dynamic-fixture can also help a lot in this situation: http://paulocheque.github.com/django-dynamic-fixture/ Certainly beats having to futz around with fixtures. On Friday, October 5, 2012 3:49:19 AM UTC+10, Daniele Procida wrote: > > I have started writing my first tests, for a project t

Re: URLField and Web Sockets URLs

2012-10-04 Thread Russell Keith-Magee
On Fri, Oct 5, 2012 at 12:51 AM, Julian Cerruti wrote: > Apparently the current implementation of URLField rejects Web Sockets URLs > such as ws://my.server.com/ > > This seems to be due to the implementation of the underlying URLValidator, > which has a regex to search for ftp or http based URLs

Re: Virtualenvs and editing contrib stuff manually

2012-10-04 Thread Russell Keith-Magee
Hi Chris, Why pick one over the other? Two potential reasons spring to mind: 1) Foreign keys aren't free, so if you're going to be using the extra data field a lot, you can save yourself some database load (and some syntactic cleanliness). BUT 2) If you get in the habit of just putting everyt

Re: Missing manage.py

2012-10-04 Thread Matt Schinckel
An even better solution is to always work in a virtualenv: that way you can easily try out new packages, and not worry about conflicts. Matt. On Thursday, October 4, 2012 10:30:06 PM UTC+9:30, Ramiro Morales wrote: > > I think so. The usual reason for the problem you are experiencing is a > pre

Re: Creating a custom mixin for use with the generic CreateView

2012-10-04 Thread Javier Guerra Giraldez
On Thu, Oct 4, 2012 at 4:55 PM, Guruprasad L wrote: > This is the first time I am using mixins in code. I read mixed opinions > about mixins, a few of them saying that it is bad. If it is bad, is there > some other way to implement this? regardless of any moral issues for or against mixins, this

Re: Creating a custom mixin for use with the generic CreateView

2012-10-04 Thread Guruprasad L
On Friday, October 5, 2012 3:14:22 AM UTC+5:30, Guruprasad L wrote: > > Hi I have created a Mixin that overrides just the get_form method, to be > used with a class that inherits from CreateView. The Mixin inherits from > object. In my view, when I include CreateView and my mixin in that order,

Creating a custom mixin for use with the generic CreateView

2012-10-04 Thread Guruprasad L
Hi I have created a Mixin that overrides just the get_form method, to be used with a class that inherits from CreateView. The Mixin inherits from object. In my view, when I include CreateView and my mixin in that order, the mixin code doesn't get executed. But when I swap the order of inheritin

Re: Django testing strategy

2012-10-04 Thread Thomas Orozco
You can use `fixtures` for this purpose! You can have several of them to have exactly the data you need for a test. Have a look there: https://docs.djangoproject.com/en/dev/topics/testing/#django.test.TestCase.fixtures Cheers, Thomas 2012/10/4 Daniele Procida > I have started writing my firs

Re: URLField and Web Sockets URLs

2012-10-04 Thread Kurtis Mullins
Looks like this is similar and shows that people want other protocols as well: http://stackoverflow.com/questions/8778416/what-are-the-valid-values-for-a-django-url-field You could modify the validator's regex but I imagine the cleanest way to do this would be to make a copy of it in your own code

Re: Why do the fastcgi instructions for Apache include a RewriteCond for file existance?

2012-10-04 Thread Dino Viehland
On Thursday, October 4, 2012 1:41:59 AM UTC-7, Tom Evans wrote: > > The FastCGI 'file' is not a real file, nor is it part of your project > code. Instead, it is a URL location that your requests can be routed > through if they are to be served by the web application specified by > the 'file'.

Re: Virtualenvs and editing contrib stuff manually

2012-10-04 Thread Chris Pagnutti
Hi. Thanks to everyone again for your replies. I've just been wondering, are there any reasons not to subclass the User class to add extra fields to a custom "User", versus the Foreign key method? On Thursday, September 27, 2012 4:13:34 PM UTC-4, Tundebabzy wrote: > > No you won't be smitten.

Re: Django on legacy Postgres database with encoding WIN1252

2012-10-04 Thread Ian Clelland
What is that character supposed to be? According to the Wikipedia page on CP1252, 0x81 is an unused character position. There is a mention that it might map to some ISO-2022 control code with no unicode equivalent. I'm not sure where the error message is coming from, though -- if it was in the py

Django testing strategy

2012-10-04 Thread Daniele Procida
I have started writing my first tests, for a project that has become pretty large (several thousand lines of source code). What needs the most testing - where most of the bugs or incorrect appear emerge - are the very complex interactions between objects in the system. To me, the intuitive way

Re: Bug with collapse fieldsets?

2012-10-04 Thread Janusz Jaworski
So I expect same functionality like when I give a name for subgroup. I want to hide and unhide group of fieldset and don't give a name for it (use None). W dniu czwartek, 4 października 2012 06:09:45 UTC+2 użytkownik Laxmikant Gurnalkar napisał: > > What do you expect from None? > > > On Thu, O

Django on legacy Postgres database with encoding WIN1252

2012-10-04 Thread Janeskil1525
Hi all I'm new Django user. I have a legacy system based on a Postgres 9.1 database that is using encoding WIN1252. When i try to retrie data from one table I get the following error >>character 0x81 of encoding "WIN1252" has no equivalent in "UTF8"<< , does that mean i cant use Django togeth

URLField and Web Sockets URLs

2012-10-04 Thread Julian Cerruti
Apparently the current implementation of URLField rejects Web Sockets URLs such as ws://my.server.com/ This seems to be due to the implementation of the underlying URLValidator, which has a regex to search for ftp or http based URLs only. Is there any chance the URLValidator regexp can be updat

Re: Am I using static files "wrong"?

2012-10-04 Thread Chris Lawlor
Micah, Here's a summary of how staticfiles works: 1. You place your static files, which are under version control, in app/static folders, or any directory defined in STATICFILES_DIRS. This is configurable, and works very similarly to how templates are placed in a project. The important thing t

Re: Create table and load data

2012-10-04 Thread Jonathan Baker
You're welcome. Personally, I've found it's easiest to get the JSON formatted correctly by creating the model, syncing the DB, inserting some dummy records, running 'dumpdata' against the table, and then

Re: Create table and load data

2012-10-04 Thread Larry Martell
Thanks! I knew there had to be a way! On Thu, Oct 4, 2012 at 10:28 AM, Jonathan Baker wrote: > initial_data sounds like what you're looking for: > https://docs.djangoproject.com/en/dev/howto/initial-data/ > > On Thu, Oct 4, 2012 at 10:26 AM, Larry Martell > wrote: >> >> Is there some way to use

Re: Create table and load data

2012-10-04 Thread Jonathan Baker
initial_data sounds like what you're looking for: https://docs.djangoproject.com/en/dev/howto/initial-data/ On Thu, Oct 4, 2012 at 10:26 AM, Larry Martell wrote: > Is there some way to use manage.py to create a table and load data > into it (where the data is contained in the models.py)? > > I ha

Create table and load data

2012-10-04 Thread Larry Martell
Is there some way to use manage.py to create a table and load data into it (where the data is contained in the models.py)? I have a client that wants to have some data contained in the code (so it's part of the code repository), and when they do the initial syncdb, have that data loaded into one o

Re: Missing manage.py

2012-10-04 Thread Laxmikant Gurnalkar
you can update, instead of reinstalling. cheers Laxmikant On Thu, Oct 4, 2012 at 6:29 PM, Ramiro Morales wrote: > I think so. The usual reason for the problem you are experiencing is a > previous installation of Django on top of which the one you are trying > to use was installed without unintal

Passing template variables within static template

2012-10-04 Thread Zoran Hranj
Hi guys, basicly I want to do the following: But the "{{ item.url }}" part does not get evaluated. I understand why it is not evaualted, but I want to know if there is a filter or something to make it work like I want to (quick glance on the filter list didnt give me any ideas). -- You rec

Am I using static files "wrong"?

2012-10-04 Thread Micah Carrick
Regarding Django 1.4... I recently came across a post that suggests that the way I'm managing static files is "wrong". I wanted to make sure I'm clear on things. In development, static files are in the "static" folders both within apps at the project level. STATIC_URL = '/static/' When I deploy

Re: Missing manage.py

2012-10-04 Thread Ramiro Morales
I think so. The usual reason for the problem you are experiencing is a previous installation of Django on top of which the one you are trying to use was installed without unintalling the older one first *. So, the recommended action in such cases is to ensure you start with a clean slate buy remov

Listbox even when using a "through" class?

2012-10-04 Thread Carsten Agger
I'm maintaining a product in which we have a many-to-many relationship which needs to have attributes in /some/ installations. That means we'll define a tabular inline class and display in the admin. But in /other /installations, these attributes are not needed, and we'd like to just display

Re: Missing manage.py

2012-10-04 Thread Django_Newbie
Hi.. I am using Django 1.4.1 on Windows 7 and face similar problem. I dont see manage.py All I have is: __init__.py settings.py urls.py wsgi.py Is reinstalling Django only option? On Monday, 16 April 2012 16:56:32 UTC+5:30, Faeez wrote: > > Hi, > > I have a problem whenever I create a new pr

Re: Django performance (cpython vs pypy)

2012-10-04 Thread Moonlight
I don't know what is memory usage... but per 'Isolated Benchmark' section some web frameworks (see those marked with asterisk) experience memory issues... aka memory leaks... It is interesting to see web2py failed pypy test, the only one. The benchmark selected for template engine is known as b

Re: Array sharing across frame carries stale copy - How to fix it?

2012-10-04 Thread anirM
Hi Daniel you guys are phenomenal! I did not expect you would be willing to help looking in to the code. I will soon update this post with some stripped down code. But, I do not know about session and may be I should try that first. In any case, I will return soon. Thank you anirM On Thurs

Re: Newbie question: first project can't connect to MySQL

2012-10-04 Thread Afshin Mehrabani
Hey Kevin, Thanks for your correct reply, I had this problem also but after changing host from "localhost" to "127.0.0.1" problem solved, But why? what's the different between 'localhost' and '127.0.0.1'? On Wednesday, February 4, 2009 9:15:32 PM UTC+3:30, Kevin Audleman wrote: > > I found the

Re: Django performance (cpython vs pypy)

2012-10-04 Thread Avraham Serour
impressive gain when using pypy, still django seems to have the slowest template engine it would be interesting to see memory usage also, not only speed btw does anyone uses pypy in production yet? care to share some thoughts? On Thu, Oct 4, 2012 at 10:02 AM, Moonlight wrote: > It is interesting

Re: Array sharing across frame carries stale copy - How to fix it?

2012-10-04 Thread Daniel Roseman
On Thursday, 4 October 2012 11:12:42 UTC+1, anirM wrote: > Hi: > > Thanks for your help. I am new here. > > I have two iframes and a common data model. On one frame I perform query > on the data and create a list/array which is then pushed via an URL and > view on to the other iframe for proces

Django performance (cpython vs pypy)

2012-10-04 Thread Moonlight
It is interesting to see how django performance is improved by Pypy 1.9 (vs CPython 2.7) in web framework and template engine benchmarks. -- You received t

Best practice of subclassing default/3rd part apps?

2012-10-04 Thread Xun Yang
Quite often I have to make small changes to the original code when I'm using default/3rd part apps. Take an example of setting constrains for password, the default SetPasswordForm in django.contrib.auth.forms and RegistrationForm in django-registration don't have any. So I have to subclass them

Array sharing across frame carries stale copy - How to fix it?

2012-10-04 Thread anirM
Hi: Thanks for your help. I am new here. I have two iframes and a common data model. On one frame I perform query on the data and create a list/array which is then pushed via an URL and view on to the other iframe for processing and display. Because they are in different frames, I am using di

Disabling CSRF is not working.

2012-10-04 Thread Laxmikant Gurnalkar
Hi, Guys Disabling CSRF is not working. These are my midlewares., Removed {% csrf_token %} all templates. MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', # 'django.middleware.csrf.CsrfViewMiddleware', 'djan

Re: Migrating a Django project to new platform

2012-10-04 Thread Elliot
Hi all, Thank you once again for your insight and feedback. I had gathered that Python2.4 is pretty old, but I guess I expected it on the CentOS5 box. This is the 'latest' as far as the CentOS official repos are concerned. Additionally, according to the Django v0.97 'INSTALL' readme, it's comp

Re: Why do the fastcgi instructions for Apache include a RewriteCond for file existance?

2012-10-04 Thread Tom Evans
On Thu, Oct 4, 2012 at 1:17 AM, Dino Viehland wrote: > Looking at the instructions for how to use Django w/ shared hosting via > FastCGI at > https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache > it includes this line: > > Rewrite