Re: SQL Server 2008 and django

2010-03-11 Thread David
As the stackoverflow link states, pyodbc is the most advanced sql server library for python. Quite a few libraries use it like sqlalchemy. If you are using Django on Linux, your only options are django-pyodbc or use sqlalchemy outside of the Django ORM. If your environment is on Windows, you can al

Re: How execute erlang code ?

2010-03-11 Thread Dylan Evans
I would suggest running your erlang on another webserver and either using an iframe or use django as a proxy (connect to erlang in your django view). On Fri, Mar 12, 2010 at 1:02 PM, nameless wrote: > Hi at all. > I need to create a blogging system with Django+Apache+Postgresql and a > twitter-l

Re: SQL Server 2008 and django

2010-03-11 Thread Sam Lai
http://stackoverflow.com/questions/842831/using-sql-server-with-django-in-production Might help. No personal experience though. On 12 March 2010 12:16, Nick wrote: > I am working on a new project that has a Microsoft SQL Server 2008 for > storing data. Can I bind Python and Django with this DB?

Re: How execute erlang code ?

2010-03-11 Thread Andy McKay
On 2010-03-11, at 7:02 PM, nameless wrote: > How can I execute erlang code through django views ? A django view is just python, so ask yourself how you would execute erlang from python and the answer is you probably won't but you could be doing something like (first hit in Google for erland and

Re: Strange difference between runserver and shell

2010-03-11 Thread Andy McKay
> def writer_stories(request, writer): ># Look up the writer (and raise a 404 if it can't be found). >written=get_object_or_404(Writer, slug__iexact=writer) >return list_detail.object_list( >request, >queryset=Entry.live.filter(writer=written), >template_name='ne

How execute erlang code ?

2010-03-11 Thread nameless
Hi at all. I need to create a blogging system with Django+Apache+Postgresql and a twitter-like app with Erlang+Yaws+Mnesia. How can I execute erlang code through django views ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: How to cache the output of Django 1.2 RSS class based views?

2010-03-11 Thread Russell Keith-Magee
On Thu, Mar 11, 2010 at 10:01 PM, Brian Neal wrote: > On Mar 7, 10:48 pm, Brian Neal wrote: >> Before the Django 1.2 beta and the class-based Feed views, I was doing >> this to cache my RSS feeds: >> >> urls.py: >> from django.contrib.syndication.views import feed as syndication_feed >> from djan

SQL Server 2008 and django

2010-03-11 Thread Nick
I am working on a new project that has a Microsoft SQL Server 2008 for storing data. Can I bind Python and Django with this DB? Are there any performance issues involved? What sort of server configuration needs to be done? This is for a job and so I can't really use something that's not been teste

View on site

2010-03-11 Thread Robert
There is a "View on site" link when you edit a user in admin. The link calls the url user/user_name but you have to make the url- view configuration yourself apparently. I wonder if there is a "built-in" way to do this. I looked up an other thread from 2006 that deals with the same question relat

django admin instance needs to have a primary key value before a many-to-many relationship can be used

2010-03-11 Thread JeffH
Hello, I'm a relative newcomer to Django and love it. I'm having a problem with a m:m relationship in the admin. Stripped down, I have two models, Fact and FactSet class Fact(models.Model): Name = models.CharField(max_length=64, unique=False, blank=False, db_index=True) class FactSet(models.

Re: Adding Fields To Querysets

2010-03-11 Thread Shawn Milochik
Maybe I'm missing something in your requirements, but I think the example in the Manager docs does exactly that: http://docs.djangoproject.com/en/1.1/topics/db/managers/#adding-extra-manager-methods It demonstrates adding an extra field (calculated from the data in the database row) to the r

Adding Fields To Querysets

2010-03-11 Thread wubble u
Hi All, I've been passing querysets to templates for looping through rows to create tables / lists on the page... nice and easy... but I need to perform calculations on these rows and pass them with the queryset so I can loop through and display them along with the data from each row. I can't see

Re: Order model objects by foreign key "set" count

2010-03-11 Thread JHeasly
This post was exactly was I was looking for! Just a reminder, don't forget to from db.models import Count On Jan 11, 8:51 pm, Margie Roginski wrote: > Ah - yes, that is so awesome!  For anyone interested, here's the magic > incantation: > > Book.objects.annotate(Count('reader')).order_by('reader

Re: Strange difference between runserver and shell

2010-03-11 Thread GJCGJC
I think I may have a similar problem. Once I've imported my models into the shell the following does exactly what I want it to: In [10]: from django.shortcuts import get_object_or_404 In [11]: written=get_object_or_404(Writer, slug__iexact='joe-bloggs') In [12]: queryset=Entry.live.filter(writer

Re: Strange difference between runserver and shell

2010-03-11 Thread Andy McKay
> Does anybody have any clue what the problem might be? Thanks for your help! There should be no difference really between the two. What might help us if you show us the code that the runs from the shell and the code in the view. -- Andy McKay, @clearwind -- You received this message because

Re: getting request.user from a signal

2010-03-11 Thread Andy McKay
> Yes, this is essentially the same topic that was discussed here: > http://groups.google.com/group/django-users/browse_thread/thread/44ced967d9da3500 > However, there has not yet been an answer, and I think this particular (and > probably common) use-case renders the "write a function that accep

Re: Django marketplace?

2010-03-11 Thread Andy McKay
On 2010-03-11, at 8:50 AM, Tom Evans wrote: > djangogigs.com djangozen.com/jobs as well (and it's free) -- Andy McKay, @clearwind -- 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.

Re: Install Django in a Production server!

2010-03-11 Thread Suno Ano
Tiago> I want to keep my dedicated server for my company, where can i Tiago> find a tutorial, the best choices for OS. A combo of Debian/Ubuntu, Cherokee and uWSGI is what I use http://yml-blog.blogspot.com/2009/11/how-to-set-up-cherokee-and-uwsgi.html http://www.cherokee-project.com/doc/cookb

Re: def reload(model): model.__dict__ = model.__class__.objects.get(pk=model.pk).__dict__ ; return model

2010-03-11 Thread Phlip
pjrhar...@gmail.com wrote: > The call it as: > > instance = reload(instance) I was saving that step. If I can't (meaning _shouldn't_) monkey patch a instance.reload(), then I should at least get the luxury of using a destructive method that's not really a method(). Seriously - reload(instance)

Re: Install Django in a Production server!

2010-03-11 Thread Massimiliano Bertinetti
Eventually, as said by the doc: " The mod_python module for Apachecan be used to deploy Django to a production server, although it has been mostly superseded by the simpler *mod_wsgi deployment option*

Re: Passing (validated) form content to the next view.

2010-03-11 Thread fchow
The form wizard allows one to pass validated form data onto another view/form. Check it out and see if it's suitable for you: http://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/ On Mar 9, 11:29 am, Joakim Hove wrote: > Sorry; > > my attempts at interlacing ASCII art in the

Re: Install Django in a Production server!

2010-03-11 Thread Anton Bessonov
Using Django on Apache with mod_python in production - it's a bad idea! wsgi or fcgi is better start point. http://docs.djangoproject.com/en/dev/howto/deployment/ Massimiliano Bertinetti schrieb: If I understand, you want information about installing python/django in a production enviroment (e

Re: Install Django in a Production server!

2010-03-11 Thread Massimiliano Bertinetti
If I understand, you want information about installing python/django in a production enviroment (ex-novo). I recently do this on a Linode Virtual Ubuntu Server and I think you can do the same. Here a tutorial: http://library.linode.com/web-frameworks/django I'm not a Linode man! What you find on

Install Django in a Production server!

2010-03-11 Thread Tiago
I want to keep my dedicated server for my company, where can i find a tutorial, the best choices for OS. Thanks -- 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 f

Re: Exception Value: No module named urls

2010-03-11 Thread nerdydork
/home/inzolo/webapps/budgetsite/lib/python2.5 contains "django". That is the only folder there. This is hosted on Webfaction. On Mar 11, 9:35 am, Xavier Ordoquy wrote: > Hello, > > > /home/inzolo/webapps/budgetsite/lib/python2.5 > > You probably want /home/inzolo/webapps/budgetsite/lib/python2.5/

Re: preventing template from converting html entities

2010-03-11 Thread Federico Capoano
Hey sorry guys, i couldn't find this post anymore! Thanks for the answers but i've found the resolution to my problem in the documentation, i just forgot in the beginning where it says about {% autoescape off %} This is the tag to use to prevent the template system from converting " in " Exa

Re: About extending User model

2010-03-11 Thread Tom Evans
On Thu, Mar 11, 2010 at 4:54 PM, russianbandit wrote: > I'm using UserProfile to add one field to my users. However, I know > that I must explicitly create UserProfile for each new user that > registers. So, I make a UserProfile upon registration. Is UserProfile > still the best way to extend the

About extending User model

2010-03-11 Thread russianbandit
I'm using UserProfile to add one field to my users. However, I know that I must explicitly create UserProfile for each new user that registers. So, I make a UserProfile upon registration. Is UserProfile still the best way to extend the user model? What about the admin user, or users that the admin

Re: Django marketplace?

2010-03-11 Thread Tom Evans
On Thu, Mar 11, 2010 at 4:42 PM, Niels wrote: > Hello, > > Sometimes I need some specific Django development where I don't have > time for, or someone else could do better. > I am looking for a marketplace where I can look  for a Django/Python > developer for a small but specific code snippet  dev

Django marketplace?

2010-03-11 Thread Niels
Hello, Sometimes I need some specific Django development where I don't have time for, or someone else could do better. I am looking for a marketplace where I can look for a Django/Python developer for a small but specific code snippet developer. Does someone has a suggestion? Thanks, Niels --

Re: need help in multi db

2010-03-11 Thread lakshmi silaja
no i want to use mysql and postgres parallel. On Thu, Mar 11, 2010 at 10:04 PM, Harsha Reddy wrote: > And the database that you are using is? > By chance is it SQLite? > > I recently encountered such a requirement.. I am using django checked > out from the svn repo. > I solved it by doing someth

Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread Bill Freeman
Assuming that you're talking about runserver, then use the python that you want when you invoke manage: /home/me/bin/my_special_python manage.py runserver You could also edit the first line of manage.py to specify the path to that python, make sure that manage.py has it's execute bit(s) set (*

Re: Exception Value: No module named urls

2010-03-11 Thread Xavier Ordoquy
Hello, > /home/inzolo/webapps/budgetsite/lib/python2.5 You probably want /home/inzolo/webapps/budgetsite/lib/python2.5/site-packages instead if it's a virtual env. Xavier. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

getting request.user from a signal

2010-03-11 Thread Shawn Milochik
Yes, this is essentially the same topic that was discussed here: http://groups.google.com/group/django-users/browse_thread/thread/44ced967d9da3500 However, there has not yet been an answer, and I think this particular (and probably common) use-case renders the "write a function that accepts a

Re: need help in multi db

2010-03-11 Thread Harsha Reddy
And the database that you are using is? By chance is it SQLite? I recently encountered such a requirement.. I am using django checked out from the svn repo. I solved it by doing something like this... def result(request): DATABASES['default']['NAME']='./data/db/scenario1.db' ... b

Re: Exception Value: No module named urls

2010-03-11 Thread nerdydork
I have that folder in my python path. Here is my wsgi file === import os import sys sys.path = ['/home/inzolo/webapps/budgetsite', '/home/inzolo/webapps/budgetsite/budgetsite', '/home/inzolo/webapps/budgetsite/budgetsite/budget', '/home/inzolo/webapps/budgetsite/lib/python2.5'] + sys.p

Re: ifequal issue

2010-03-11 Thread Bill Freeman
It's time to go back to figuring out just what these things are. Put back your code that shows you the variable values, except instead of {{ item.id }} and {{ berufe_id }} use --{{ item.id|stringformat:"%r" }}-- and --{{ berufe_id|stringformat:"%r%" }}-- The %r version will inclu

Re: local application source files checksum

2010-03-11 Thread Jirka Vejrazka
> The thing is: the application will get approved from an organization, > and after that I have to avoid any kind of source edit, > until another approval.. Hi, one option would be using proper permission for editing the source code and Tripwire/AIDE for reporting on any unauthorized changes...

buildout djangorecipe

2010-03-11 Thread John Griessen
bx2 wrote: The best option is to use buildout (there is no need for creating virtualenv - much more simple and much more flexible solution). Also it will be easier to further deploy your projects. I see this buildout.cfg example from http://pypi.python.org/pypi/djangorecipe and have questions b

local application source files checksum

2010-03-11 Thread gaddoz
Hi all for a very specific application I'm going to develop, I'm considering to use Django framework. Everything fits fine with that, except a strange requisite I have and I don't know how to manage here (well.. it'll be not easy also somewhere else I think) The thing is: the application will get

Re: Row Level Permissions?

2010-03-11 Thread Massimiliano della Rovere
Row Level Permissions work perfectly: http://code.djangoproject.com/wiki/RowLevelPermissions On Thu, Mar 11, 2010 at 14:21, Rodrigo Cea wrote: > What's the current state of the art for Row Level Permissions? > > I need to set permissions for users on a MPTT-based page tree, where > each user wi

Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread bx2
The best option is to use buildout (there is no need for creating virtualenv - much more simple and much more flexible solution). Also it will be easier to further deploy your projects. The second option is to modify your manage.py script by adding custom path to it ie. import sys sys.path[0:0] =

Re: Exception Value: No module named urls

2010-03-11 Thread felix
its an ImportError which means that it couldn't find your main urls.py or possibly a sub urls that you are including. check your python paths you need to include the folder ABOVE the module you are addressing eg. folder app urls.py models.py folder needs to be on the python

Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread felix
also checkout buildout which does a similar thing to virtualenv but also allows you to specify the exact interpreter and all dependencies / eggs / apps and installs those. it makes development very portable since you can quickly set up the exact same environment (including a specific python inter

Re: How to cache the output of Django 1.2 RSS class based views?

2010-03-11 Thread Brian Neal
On Mar 7, 10:48 pm, Brian Neal wrote: > Before the Django 1.2 beta and the class-based Feed views, I was doing > this to cache my RSS feeds: > > urls.py: > from django.contrib.syndication.views import feed as syndication_feed > from django.views.decorators.cache import cache_page > > urlpatterns =

Re: charField null=false not enforced for table creation in oracle

2010-03-11 Thread Wayne
Hi Karen, Many thanks for your reply. Now our business requirements do not allow either empty string or null value for this particular charField column (name = models.CharField(max_length=512, null=False, blank=False)). How do you suggest we should configure this field so that we can enforce not n

Re: character , HTML textfield, sqlite3

2010-03-11 Thread Daniel Roseman
On Mar 11, 1:19 pm, gintare wrote: > Hello, > > How to save special characters: å , ö, ä... > > I tried to write them in browsers input field in several ways: > å , ö, ä... > \xc3\xa5 ,   \xc3\xa4,  \xc3\xb6 > > I am using sqlite syntax for saving > from HTML tetxtarea > to the sqlite3 database te

Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread Jeremy Sandell
On Mar 10, 11:41 pm, Abhinov wrote: > Hi All, > > How to make my django use a different python interpreter located at > some random location ? > Any help will be of great help. > > Regards, > Abhinov I'll second Bjunix's recommendation of checking out virtualenv. It will probably do what you need

Re: unique slug creation and check

2010-03-11 Thread adamalton
It should just be blank=True (null=False). Here's a better paste of the code without Google wapping all the lines. http://pastebin.com/N5RvfDrD -- 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...@go

Re: Validating a specific model field

2010-03-11 Thread leveille
On Mar 11, 12:56 am, Julien Phalip wrote: > Is there a way to achieve the same type of specific validation like > with forms? This is new in Django dev (not sure what version of Django you are running), but you might find the following of value: http://docs.djangoproject.com/en/dev/ref/validator

Row Level Permissions?

2010-03-11 Thread Rodrigo Cea
What's the current state of the art for Row Level Permissions? I need to set permissions for users on a MPTT-based page tree, where each user will be allowed to edit only a specific branch, using the admin. I found this: http://www.djangosnippets.org/snippets/1054/, which might work, but wonder i

character , HTML textfield, sqlite3

2010-03-11 Thread gintare
Hello, How to save special characters: å , ö, ä... I tried to write them in browsers input field in several ways: å , ö, ä... \xc3\xa5 , \xc3\xa4, \xc3\xb6 I am using sqlite syntax for saving from HTML tetxtarea to the sqlite3 database textfield: models.CharField(max_length=500, blank=True

Exception Value: No module named urls

2010-03-11 Thread nerdydork
I hired someone to help me write an API using piston. One of the pages is returning this error: === Traceback: File "/home/inzolo/webapps/budgetsite/lib/python2.5/django/core/ handlers/base.py" in get_response 83. request.path_info) File "/home/inzolo/webapps/budgetsite/lib/py

Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread Bjunix
You may want to take a look at virtualenv[1]. [1] http://pypi.python.org/pypi/virtualenv On Mar 11, 5:41 am, Abhinov wrote: > Hi All, > > How to make my django use a different python interpreter located at > some random location ? > Any help will be of great help. > > Regards, > Abhinov -- You

Re: Validating a specific model field

2010-03-11 Thread Bjunix
After looking at django's code it does not look like you can just add a clean_ method to your model like you can do with forms. I guess a 'clean' method is the way to go here. But try to raise the ValidationError with a error dictionary like: ValidationError({'': ''}) So in your case that would b

Re: django-test-coverage gcc error

2010-03-11 Thread Karen Tracey
On Thu, Mar 11, 2010 at 6:50 AM, filias wrote: > Thanks Karen, I am using ubuntu karmic. I will search for the package > that I need. > > On Ubuntu it's python-dev that you need. Karen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: django-test-coverage gcc error

2010-03-11 Thread filias
ok. I installed python2.6-dev and it works now :) thanks again. On Mar 11, 11:50 am, filias wrote: > Thanks Karen, I am using ubuntu karmic. I will search for the package > that I need. > > On Mar 10, 4:34 pm, Karen Tracey wrote: > > > On Wed, Mar 10, 2010 at 11:13 AM, filias wrote: > > > I am

Re: django-test-coverage gcc error

2010-03-11 Thread filias
Thanks Karen, I am using ubuntu karmic. I will search for the package that I need. On Mar 10, 4:34 pm, Karen Tracey wrote: > On Wed, Mar 10, 2010 at 11:13 AM, filias wrote: > > I am trying to use a test coverage tool for django. > > > I triedhttp://pypi.python.org/pypi/django-test-coverage/0.1.

Strange difference between runserver and shell

2010-03-11 Thread python
Dear all, I have the following model: 1 class MyOrderItem(models.Model): 2 orderitem = models.ForeignKey(OrderItem, null=True, blank=True) 3 # other fields 4 5 def save(self, *args, **kwargs): 6 if self.orderitem and self.orderitem.order:

Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread Graham Dumpleton
On Mar 11, 3:41 pm, Abhinov wrote: > Hi All, > > How to make my django use a different python interpreter located at > some random location ? > Any help will be of great help. How are you hosting it? Are you talking about Django runserver or some other hosting mechanism such as mod_python, mod

Re: def reload(model): model.__dict__ = model.__class__.objects.get(pk=model.pk).__dict__ ; return model

2010-03-11 Thread pjrhar...@gmail.com
Why bother? Cant you just do: def reload(model): return model.__class__.objects.get(pk=model.pk) The call it as: instance = reload(instance) Peter -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: ModelAdmin

2010-03-11 Thread Daniel Roseman
On Mar 11, 6:27 am, Praveen wrote: > On Mar 11, 3:03 am, Beres Botond wrote:> You cannot > directly register a form with admin, you should be > > registering models > > I know i can not directly register a form but i do not have any model > for Email. i just have plain form *forms.Form* > is the

Re: ModelAdmin

2010-03-11 Thread pjrhar...@gmail.com
On Mar 11, 6:27 am, Praveen wrote: > I know i can not directly register a form but i do not have any model > for Email. i just have plain form *forms.Form* > is there any other way to register Form with admin. > Thanks What would you expect it to do if you could? The admin interface is for adding

Re: AttributeError: 'QuerySet' object has no attribute 'remove'

2010-03-11 Thread Daniel Roseman
On Mar 11, 4:46 am, Hugh Zhang wrote: > Hi there, i have occured an error bellow with django 1.1: > *Traceback (most recent call last): >   File "", line 1, in > AttributeError: 'QuerySet' object has no attribute 'remove'* > The whole code about this error is: > > *>>> b = Blog.objects.get(id=1)