Re: Confused ForeignKey ?

2009-09-10 Thread adelaide_mike
Oops - my mistake within admin.py. Sorry to waste bandwidtrh. Mike On Sep 11, 10:36 am, adelaide_mike wrote: > Hi > I am just getting into my second project/app but have run into a > problem I have not seen before.  My models.py has the following: > > class

Re: Snow Leopard Issues?

2009-09-10 Thread Graham Dumpleton
On Sep 11, 9:38 am, Anthony wrote: > Has anyone running Django on their MacBook updgraded to Snow Leopard > successfully?  I've been holding off to avoid any potential hassles, > but with the release of 10.6.1, would like to do it soon. > > - Python 2.5 > - Django 1.0.2

Re: Django ORM - Table Changes

2009-09-10 Thread carlos
ok only comment is you use django_evolution http://code.google.com/p/django-evolution/ "When you run ./manage.py syncdb, Django will look for any new models that have been defined, and add a database table to represent those new models. However, if you make a change to an existing model,

Re: Django Project Management App

2009-09-10 Thread Mike Dewhirst
Greg wrote: > Hi all, > > Since I started with django a year or so ago, I've been gradually > building a very simple project management app for myself - it started > as a project to learn the language but has evolved into a very useful > tool, handling all my timetracking, task management and

RE: Snow Leopard Issues?

2009-09-10 Thread anes hamdoon
> Date: Thu, 10 Sep 2009 18:17:48 -0700 > Subject: Re: Snow Leopard Issues? > From: timster...@gmail.com > To: django-users@googlegroups.com > > > I'm running django on Snow Leopard successfully. > > The only difference I ran into is that Snow Leopard has python 2.6, so > I had to move all

Confused ForeignKey ?

2009-09-10 Thread adelaide_mike
Hi I am just getting into my second project/app but have run into a problem I have not seen before. My models.py has the following: class Cabletype(models.Model): cabletype = models.CharField(max_length=16, blank=False, unique=True) desc = models.TextField() def __unicode__(self):

Re: Snow Leopard Issues?

2009-09-10 Thread Tim
I'm running django on Snow Leopard successfully. The only difference I ran into is that Snow Leopard has python 2.6, so I had to move all my site-packages from /Library/Python/2.5/site- packages to /Library/Python/2.6/site-packages After that it worked flawlessly. Or you could could symlink

Django Project Management App

2009-09-10 Thread Greg
Hi all, Since I started with django a year or so ago, I've been gradually building a very simple project management app for myself - it started as a project to learn the language but has evolved into a very useful tool, handling all my timetracking, task management and invoicing. I'm wondering

Re: Why doesn't Django display template line number of errors?

2009-09-10 Thread Tim
It does show line numbers. Scroll down past the yellow section on the error page, and it will show you the line numbers, the line with the error, and the lines surrounding it. It should also say something like "In template /Users/tim/Sites/ website/templates/base.html, error at line 73"

Re: haml + sass + django

2009-09-10 Thread Itai Tavor
On 09/09/2009, at 12:19 AM, ThinRhino wrote: > > Hello, > > I just came across haml and sass, but looks like it is built for > Ruby on > Rails. > > Any implementation that can work on Django? Personally I don't think haml has any use in django work, but I use sass for most of my css coding.

Re: Include under an "if" statement

2009-09-10 Thread NealWalters
Let me add the reason for my question. The code posted first doesn't work. The "block body" is not being replaced. But the following works fine (remove the ifequal/else/endifequal and the Dijit.html template (which might also have a duplicate "block body". {% include

Why doesn't Django display template line number of errors?

2009-09-10 Thread NealWalters
It's not always a problem, but sometimes it's tricky to find the bad "end" or mismatched Django tag. Why doesn't Django give you the line number where the error is encountered within the template? Is this on the wishlist already? TemplateSyntaxError: Invalid block tag: 'end' In other words, the

Include under an "if" statement

2009-09-10 Thread NealWalters
Do include statements always "include" - or can they be subject to an "if" statement like this: {% ifequal menuStyle "dijit" %} {% include "baseMainIncludeDijit.html" %} {% else %} {% include "baseMainIncludeSimpleHead.html" %} {% include "baseMainIncludeSimpleBody1.html" %}

Snow Leopard Issues?

2009-09-10 Thread Anthony
Has anyone running Django on their MacBook updgraded to Snow Leopard successfully? I've been holding off to avoid any potential hassles, but with the release of 10.6.1, would like to do it soon. - Python 2.5 - Django 1.0.2 (although I may upgrade to 1.1 as well) - SQLite3 thanks

Re: Is there an example of html template usage?

2009-09-10 Thread alex
http://www.satchmoproject.com/ good luck On Sep 10, 9:07 pm, aftalavera wrote: > Hi there, > > Where can I found sample about real apps usgin html templates with > Django templates? --~--~-~--~~~---~--~~ You received this message

Re: meta or QuerySet - I don't know

2009-09-10 Thread Timbadu
Thanks Tim, I wrapped it in a div and daisy-chained some filters so as to allow the js file find the class tags. {% for genre in genre_list %} {{ genre.genre_type }} {% for credit in genre.credit_set.all %} {{ credit.title }} {% endfor %}

Re: Is Auth really dependent on Sites?

2009-09-10 Thread Joshua Russo
On Thu, Sep 10, 2009 at 8:15 PM, Andrew Gwozdziewycz wrote: > > On Sep 10, 3:05 pm, Joshua Russo wrote: > > I wanted to remove the Sites app because it's not needed at the moment, > but > > when I ran the unit tests for the project the Auth unit tests

Re: Is Auth really dependent on Sites?

2009-09-10 Thread Andrew Gwozdziewycz
On Sep 10, 3:05 pm, Joshua Russo wrote: > I wanted to remove the Sites app because it's not needed at the moment, but > when I ran the unit tests for the project the Auth unit tests use Sites > functionality. If I'm using Auth should I leave sites? I really just wanted >

Re: Proper way of importing projects modules

2009-09-10 Thread Andrew Gwozdziewycz
This whole discussion is pretty much what virtualenv solves http://pypi.python.org/pypi/virtualenv Basically, for each package that you wanna reuse, install it into the virtualenv for the project your working on. It works great. On Sep 10, 2:00 pm, Brian Jones wrote: > Well,

Re: Django ORM - Table Changes

2009-09-10 Thread Thomas
Thanks for the advice. I just wanted to ensure I wasn't missing something overtly obvious. A bit strange, but I both like, and dislike the ORM at the same time. SQL is relatively clean, and straightforward... I'd rather abstract more complicated things. I do like the idea about adding a

Re: Django ORM - Table Changes

2009-09-10 Thread Randy Barlow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thomas declared: > I've been teaching myself Django over the past couple of days. Thus > far, everything has been going smoothly, as I typically do a lot of > non-web based Python coding, so am familiar with the language. > However, Django's DB API

Re: Django ORM - Table Changes

2009-09-10 Thread Chris Czub
That is a short-coming of the Django ORM, unfortunately solving the problem of iterative schema changes is pretty difficult. There are some projects around that attempt to fix this issue, in varying stages of completion: http://south.aeracode.org/wiki/Alternatives is a decent list. As for your

Is there an example of html template usage?

2009-09-10 Thread aftalavera
Hi there, Where can I found sample about real apps usgin html templates with Django templates? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Django ORM - Table Changes

2009-09-10 Thread Thomas
I've been teaching myself Django over the past couple of days. Thus far, everything has been going smoothly, as I typically do a lot of non-web based Python coding, so am familiar with the language. However, Django's DB API is my first look into ORM and how it works. I understand the basics;

Having model troubles

2009-09-10 Thread dave
Hey everyone, I've been using Django for awhile now, but not using any models. I finally found a great opportunity to use them, but I've found a number of seeming bugs (which I assume everyone would be dealing with and therefore fixing, so I must be doing something wrong). Basically, I will be

Re: Permissions per model instance

2009-09-10 Thread eka
Christian: Thanks... I also found this: http://packages.python.org/django-authority/ On Sep 10, 4:20 pm, Christian Schilling wrote: > I wrote an app for this some time ago, i use it in production without > problem >

Modelform edit on Production server throws : ValueError, The 'img' attribute has no file associated with it.

2009-09-10 Thread coolis_willis
Hey fellow Django users, I'm hoping someone has an answer to this problem that came up when moving my files to production. I have a form that has an ImageField for the usual profile image for members. The rest of the form updates, but the error is thrown when you try to change the image. A

Re: Permissions per model instance

2009-09-10 Thread Christian Schilling
I wrote an app for this some time ago, i use it in production without problem since: http://github.com/initcrash/django-object-permissions/tree/master its quite easy to use (look at the testcases): when you add it to your project every model gets an additional "edit all" permission that allows

Re: meta or QuerySet - I don't know

2009-09-10 Thread Tim
If you have this in your view... genre_list = Genre.objects.all() Then you can do this in your template. Basically for each genre, you are outputting the name, then looping through the list of credits where genre = the current genre. {% for genre in genre_list %} {{ genre.genre_type }}

Is Auth really dependent on Sites?

2009-09-10 Thread Joshua Russo
I wanted to remove the Sites app because it's not needed at the moment, but when I ran the unit tests for the project the Auth unit tests use Sites functionality. If I'm using Auth should I leave sites? I really just wanted to clean up the Admin index page.

meta or QuerySet - I don't know

2009-09-10 Thread Timbadu
Hi folks, (New to databasing) I'm looking for a solution for presenting MySQL. I want to display my data grouped by a colmn value in the MySQL table. So my model is: from django.db import models class Genre(models.Model): genre_type = models.CharField(max_length=40) def

Removing line breaks in a template

2009-09-10 Thread EricR86
Hello, I was wondering if it was at all possible to remove line breaks from a text passed in from a template variable. Ideally I'd like to do something like: {{ text|cut:"\r\n" }} , but that doesn't seem to work. I've tried googling and searching on the mailing list with no results. Thanks for

Re: Proper way of importing projects modules

2009-09-10 Thread Brian Jones
Well, it's not a solution you'd use in a larger team environment, because it causes confusion, but if you're just trying to put off the renaming issue (which really isn't that hard - what's wrong with that solution?), you can just create a symbolic link to the directory on your PYTHONPATH instead

Re: Django & mod_wsgi, multipart/form-data forms, and hell

2009-09-10 Thread Mike Ramirez
On Thursday 10 September 2009 10:45:01 Benjamin Kreeger wrote: > Okay, I just made myself think, which is dangerous. When I removed the > @login_required decorator from the view that handles the POST data, it > worked. > > But I'd really like the form to require the user to be logged in (as > part

Re: Django & mod_wsgi, multipart/form-data forms, and hell

2009-09-10 Thread Benjamin Kreeger
Okay, I just made myself think, which is dangerous. When I removed the @login_required decorator from the view that handles the POST data, it worked. But I'd really like the form to require the user to be logged in (as part of the form brings up information about the user from request.user). On

Re: Django & mod_wsgi, multipart/form-data forms, and hell

2009-09-10 Thread Benjamin Kreeger
And for what it's worth, the view asks for authentication using a @login_required decorator (and django.contrib.auth), and that's all hunky-dory, too. Haven't had any problems with that part of it before. --~--~-~--~~~---~--~~ You received this message because you

Django & mod_wsgi, multipart/form-data forms, and hell

2009-09-10 Thread Ben Kreeger
I've got a model that has an ImageField, and a ModelForm that uses this model. I've got my template set up using the form fields, and my form tag is set up with enctype="multipart/form-data" so the picture upload works. When I use the included Django development server (runserver command), I can

Re: Editors of choice

2009-09-10 Thread Nikolay Panov
Emacs + ropemacs. Have a nice day, Nikolay. --~--~-~--~~~---~--~~ 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

Re: Editors of choice

2009-09-10 Thread Filip Gruszczyński
Geany: http://geany.org/ It's very small, very fast, very easy to learn, and yet provides some cool features (autocompletion, tips, detecting symbols). Developers are very responsive and already made a few features just for me ;-) -- Filip Gruszczyński

Re: Proper way of importing projects modules

2009-09-10 Thread Filip Gruszczyński
> Your choice. I prefer the first method. Changing the imports isn't > terribly difficult (global find and replace) for the few times the > project folder gets renamed. Unless of course, you are using distributed source control and want to have seperate repo for every larger feature. Then it

Re: TemplateSyntaxError at /admin/ Caught an exception while rendering: (1146, "Table 'winzees.django_admin_log' doesn't exist")

2009-09-10 Thread s.molinari
Yes you were right, silly me! Thanks eheh On 28 Aug, 14:12, Karen Tracey wrote: > On Aug 28, 7:57 am, "s.molinari" wrote: > > > Hiya! > > I tried to access the django admin page and I got that error. How do i > > fix it? I am stuck... > > I am

Re: Editors of choice

2009-09-10 Thread Lp
Ed. Sent from my iPod On 10-Sep-2009, at 19:20, Sam Walters wrote: > > Vim in conjunction with Git - most powerful + extensible editor out > there in my humble opinion. > > On Thu, Sep 10, 2009 at 7:46 PM, boyombo > wrote: >> >> Vim +

Re: how to use form_class with generic views?

2009-09-10 Thread dan_mpi_cbg
did anyone come up with a solution on this? I'd be happy to see it... On Aug 25, 4:14 pm, BobZ wrote: > Does anyone else have an idea of what could possibly cause this type > of error? > > No found > matching the query > > I'm not looking for a spoonfed solution, just

how to use timezone of my computer

2009-09-10 Thread stanleyxu2005
Hi All, I ran into a problem: If I do not configure TIME_ZONE in settings.py, it will use "America/Chicago" by default. However I just want to use the same setting as it in my linux system (openSUSE11). Is it possible Otherwise I have to configure the timezone setting for all my linux machines.

Re: What is the correct database format for storing a 2-dimensional table?

2009-09-10 Thread W.P. McNeill
1. The database schema you suggest is something I tried. I wasn't sure how to enforce my uniqueness requirements within it, but you may have answered that. 2. The uniqueness criteria is that the feature-phoneme pair is present only once. So using your schema I could have a FeaturePhoneme table

Re: Proper way of importing projects modules

2009-09-10 Thread Tim
Well there are really two options I think. The first option is how you were doing it: from project_folder.app_name.models import SomeModel You also found out the problem with this method. If you rename project_folder, you have to change all the imports in your project. The other option is to

Proper way of importing projects modules

2009-09-10 Thread Filip Gruszczyński
I would like to ask, what is the blessed way of importing different modules inside django project. Until this moment I have used something like this: from ..models import SomeModel However, this is no good for me. When I changed name of the directory holding the project (I have created branch

Re: how to use the generic_inline_formset_factory?

2009-09-10 Thread V
I've got it (I think): http://docs.djangoproject.com/en/dev/topics/forms/formsets/#using-more-than-one-formset-in-a-view On szept. 9, 18:49, Viktor wrote: > hi, > > how can I create a page similar to the admin pages in the sense of > having a ModelForm and a formset

proper place to put startup code

2009-09-10 Thread Andrew Gwozdziewycz
Hello, What's the recommended place to put code that should be run once upon application initialization? I'm currently doing something along the lines of: 1. Create a new signal post_init 2. Connecting handlers to post_init in a file startup.py 3. Sending the signal at the top of a

Re: Editors of choice

2009-09-10 Thread Sam Walters
Vim in conjunction with Git - most powerful + extensible editor out there in my humble opinion. On Thu, Sep 10, 2009 at 7:46 PM, boyombo wrote: > > Vim + pydiction + django.vim > > On Sep 10, 1:31 pm, eka wrote: >> Vim + RopeVim +

Re: Editors of choice

2009-09-10 Thread boyombo
Vim + pydiction + django.vim On Sep 10, 1:31 pm, eka wrote: > Vim + RopeVim + Omincompletion + taglist + tasklist + python_fn > > On Sep 10, 8:30 am, slafs wrote: > > > Vim > > with omnicompletion (CTRL+X, CTRL+O), filetype=htmldjango, TList and > >

Re: Editors of choice

2009-09-10 Thread eka
Vim + RopeVim + Omincompletion + taglist + tasklist + python_fn On Sep 10, 8:30 am, slafs wrote: > Vim > with omnicompletion (CTRL+X, CTRL+O), filetype=htmldjango, TList and > NERDTree > > Regards > > On Sep 9, 9:31 am, Benjamin Buch wrote: > > > I second

Re: Editors of choice

2009-09-10 Thread slafs
Vim with omnicompletion (CTRL+X, CTRL+O), filetype=htmldjango, TList and NERDTree Regards On Sep 9, 9:31 am, Benjamin Buch wrote: > I second that. > > > > > Vim > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Permissions per model instance

2009-09-10 Thread eka
Yes... the important thing in my case is that Images has no owner, they are imported from an external system. So I would want a way to give users access to certain Images. On 10 sep, 07:18, Sean Kemplay wrote: > Maybe not exactly what you are after, however I

override gettext file loader

2009-09-10 Thread k88
Is there an easy (non monkeypatching) way to override which gettext file gets loaded on every request ? if not any idea what should i patch ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: problem with signals

2009-09-10 Thread Robin
Sorry, I just google for comparations between simple method (or override old ones) and signals and I found that signals are more generic but less "controled" and you can just loose the normal execution of the signal. What I don't understand is why I am just not getting executed any of my signals,

problem with signals

2009-09-10 Thread Robert
Hello !! I have a very strange problem with signals, just happens that sometimes are not registered, as well the modification to the source is not reloaded by the local developmente server. Anyone has experimented this problem or any similar one with signals and anyone knows how to solve it ? I

Re: User profile creation forms

2009-09-10 Thread V
On szept. 10, 06:51, Rodney Topor wrote: > Suppose one wants to store additional information about a user in a > separate profile class as described in the documentation.  When a user > registers, the form displayed should show (all) fields from class User > and (some) fields

Re: Permissions per model instance

2009-09-10 Thread Sean Kemplay
Maybe not exactly what you are after, however I have a user profile that links to an account model. Everything model that instances need to be owned by a user has a foreign key to the account model. When I want to retrieve anything that is owned by an account I get the account from the user

Re: problem with spaces in my urls

2009-09-10 Thread rufus
Thanks a lot kenneth.. that \s did it thank yoou On Sep 10, 2:47 pm, Kenneth Gonsalves wrote: > On Thursday 10 Sep 2009 3:12:39 pm rufus nayagam wrote: > > > We frame this city state slug url in our get_absolute_url function. > > How should we eliminaaatte this error

Re: problem with spaces in my urls

2009-09-10 Thread Ajit jena
Rufus, If you replace the space by "-" , then it eill fix your issue. Ex: "garden city" as "garden-city" Thanks, Ajit On Thu, Sep 10, 2009 at 3:12 PM, rufus nayagam wrote: > > I have a url in the following format > > /city/state/slughowever sometimes we get city

Re: IndexError when creating a formset

2009-09-10 Thread chewynougat
My Mistake. If anyone else is interested, I have been handling all my code for this app through jquery and ajax calls. I didn't realise that each form in the formset had a hidden field with its id. As I was creating a new object for these formsets to relate to, all ids in the formset needed to

Re: problem with spaces in my urls

2009-09-10 Thread Kenneth Gonsalves
On Thursday 10 Sep 2009 3:12:39 pm rufus nayagam wrote: > We frame this city state slug url in our get_absolute_url function. > How should we eliminaaatte this error please advice we tried different > way to sollv it. regex should have a \s in it -- regards kg http://lawgon.livejournal.com

problem with spaces in my urls

2009-09-10 Thread rufus nayagam
I have a url in the following format /city/state/slughowever sometimes we get city names which has more than one word. eg. 'garden city' As a result on it the url that we form becomes as follows. /garden city/KS/abc-xyz here you can see a space in between words of the city name. when

Re: retrieving models without importing

2009-09-10 Thread Daniel Roseman
On Sep 10, 7:16 am, nbv4 wrote: > I remember reading about away to use django models without importing, > but google fails me. I want to create a ForeignKey relation to another > model, but I can't import it because that will call an endless loop of > imports. > > I know about

Re: What is the correct database format for storing a 2-dimensional table?

2009-09-10 Thread V
On Sep 10, 12:18 am, "W.P. McNeill" wrote: > I am writing a Django app to store and manipulate a 2-dimensional > table of data.  I don't think I'm trying to do anything particularly > difficult, but I'm new to both Django and relational databases, so I'm > getting confused by

Re: Incorrect {{root_path}} in classes derived from AdminSite

2009-09-10 Thread Vlastimil Zima
That was the problem, thanks a lot. On Sep 10, 1:14 am, Ramiro Morales wrote: > On Wed, Sep 9, 2009 at 1:16 PM, Vlastimil Zima > wrote: > > > Neither name nor app_label fixed situation. > > AdminSite instance django.contrib.admin.site is constructed

Displaying data in the admin edit form

2009-09-10 Thread Marco
Hello, I saw in Django's tutorial that it was possible to display some data coming from a method of your model (for example 'was_published_today'). You just have to use list_display and call your method. But what if I want to display this in the edit form? Is there a way to do that? Thanks,

retrieving models without importing

2009-09-10 Thread nbv4
I remember reading about away to use django models without importing, but google fails me. I want to create a ForeignKey relation to another model, but I can't import it because that will call an endless loop of imports. I know about doing: field = models.ForeignKey("app.Model") but theres a