Re: a django question about "python manage.py syncdb"

2011-10-14 Thread Chen Xu
thanks every one: @Donald Stufft: Your method eventually solves my problem, I really appreciate it. Thanks very much On Fri, Oct 14, 2011 at 9:34 PM, Donald Stufft wrote: > You need a __init__.py in your models.py. You also need to import all your > models into that __init__.py. > > If I re

Re: a django question about "python manage.py syncdb"

2011-10-14 Thread Donald Stufft
You need a __init__.py in your models.py. You also need to import all your models into that __init__.py. If I recall you'll also want to set class Meta: app_label = "the name of your package" Because the models directory will screw up Django's ability to auto figure it out. On Saturday

Re: a django question about "python manage.py syncdb"

2011-10-14 Thread Chen Xu
I tried to delete models.py, and just have a /model subdirectory, but "pythin manage.py syncdb" doesnt pick up the models in /models directory, Do i need to change some configurations to tell Django to use /models subdirectory. Or do I need __init__.py in my /models subdirectory, I tried both, neit

Subquery most voted object

2011-10-14 Thread wgis
Hi, I currently have this models: class Place(models.Model): () class VoteContext(models.Model): name = models.CharField(max_length = 15, unique = True) class Vote(models.Model): place = models.ForeignKey(Place, related_name='voted_place') context = models.

Re: Test DB Connection

2011-10-14 Thread akshar raaj
>From what i can understand, you want to test whether you can connect to database from your django project or not. If this is your need then try the following: Go to the shell using following command: python manage.py shell On the shell, issue the following statements: from django.db import conn

Re: django free web hosting list

2011-10-14 Thread Shawn Milochik
A more comprehensive and canonical list is already on the wiki: https://code.djangoproject.com/wiki/DjangoFriendlyWebHosts If anything's missing then this site should probably be updated, rather than splintering the list. -- You received this message because you are subscribed to the Google Gro

mongodb with django

2011-10-14 Thread bedros
http://mongoengine.org/ or http://django-mongodb.org/ any ideas when django admin interface will have support for mongodb? Thanks Bedros -- 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@googl

Re: static files in django

2011-10-14 Thread Xavier Ordoquy
Hi, It looks like you don't have the static configured in your urls. Have a look here: https://docs.djangoproject.com/en/1.3/howto/static-files/#basic-usage Regards, Xavier. Le 14 oct. 2011 à 18:54, Pulkit Mehrotra a écrit : > hey i am having problem loading my static files in django 1.3 > >

Re: Suse Linux installation

2011-10-14 Thread Anoop Thomas Mathew
Check the Python Version. Thanks, Anoop atm ___ Life is short, Live it hard. On 14 October 2011 22:24, Andrew Johnson wrote: > I download and untar Django-1.3.1 and try to install and get: > > django/Django-1.3.1> sudo python setup.py install > Traceback (most recent call last): > File "setup

Re: Suse Linux installation

2011-10-14 Thread aledr
You can get it directly from the Python repo[1]. Otherwise you need python-distribute or python-setuptools to build it (you can just install one of them with 'zypper in python-...' or download from the same[1] repo). [1]: http://download.opensuse.org/repositories/devel:/languages:/python/ On Fri,

Suse Linux installation

2011-10-14 Thread Andrew Johnson
I download and untar Django-1.3.1 and try to install and get: django/Django-1.3.1> sudo python setup.py install Traceback (most recent call last): File "setup.py", line 1, in ? from distutils.core import setup ImportError: No module named distutils.core I don't see a file named distutils.co

static files in django

2011-10-14 Thread Pulkit Mehrotra
hey i am having problem loading my static files in django 1.3 Here is my template:http://pastebin.com/nr7Z97SJ here is my static file : http://pastebin.com/mEPYMGFt here is my url file:http://pastebin.com/Dsz5T9zh I have given the right address in staticfiles_dir but still the problem persists a

Re: Django models design question

2011-10-14 Thread Stuart
Hello omerd -- If you give some concrete examples of what you are trying to do, including providing your current models.py code, it will make it easier for us to help you. Since you have Registration and Details models, I am assuming you want the user to be able to create/define these items, rath

django free web hosting list

2011-10-14 Thread profDjango
Updated django free wb hosting list available at http://freedjangohosting.com -- 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 dja

Issue with complex Django join query

2011-10-14 Thread Fabrizio Buratta
I can't find a valid way with Django OMR in order to get : ( a raw query is also fine ) the Sites.sitename which made the Analysis where (Analysi_Items.name='somename' and Analysis_Items.value='somevalue') and (Analysi_items_name='somename' and Analysis_Items.value='somevalue') and (Analysis_items

Re: Something wrong in the model ot template - my Christmas wishes list

2011-10-14 Thread Piotr Hosowicz
SOLVED I think. I should have had : def campaign(request, campaign_id): ctx = {'phones': PersonPhones.objects.all(), "camppeople": CampPeople.objects.all() } return render_to_response("campaign.html", ctx, context_instance=RequestContext(request)) in views.py. -- You received this mes

Something wrong in the model ot template - my Christmas wishes list

2011-10-14 Thread Piotr Hosowicz
Hello, In the model I have : def campaign(request, campaign_id): ctx = {'camppeople': PersonPhones.objects.all() } return render_to_response("campaign.html", ctx, context_instance=RequestContext(request)) I also have a place where I store the info whether I want to call that person: cla

Re: a django question about "python manage.py syncdb"

2011-10-14 Thread Andre Terra
models should be lowercase, because that's the standard for every single python package. Cheers, AT On Fri, Oct 14, 2011 at 6:23 AM, Chen Xu wrote: > Hi, > I am new to Django. > I have installed Django and go t everything set up correctly, just started > some easy tutorials. > > So when I do >

Re: Foreign key problem

2011-10-14 Thread Guy Nesher
nm, solved On Oct 14, 1:54 pm, Guy Nesher wrote: > Hi DR, > > Thanks, I've just started developing in Python/Django so I do > apologize for the bad naming convention (I'll fix this once everything > works, don't want to add additional errors before I sort this). > > Having said that I assumed tha

Re: django 1.3: how to use get_abolute_url in class based generic views

2011-10-14 Thread Andriyko
Thank you for reply, but I still get the errror Template error In template .../weblog/templates/blog/article_archive.html, error at line 6 Caught ViewDoesNotExist while rendering: Tried archive_day in module django.views.generic.dates. Error was: 'module' object has no attribute 'archive_day' 1

Re: Foreign key problem

2011-10-14 Thread Guy Nesher
Hi DR, Thanks, I've just started developing in Python/Django so I do apologize for the bad naming convention (I'll fix this once everything works, don't want to add additional errors before I sort this). Having said that I assumed that if I define the foreignkey manually and specifically select a

Re: django 1.3: how to use get_abolute_url in class based generic views

2011-10-14 Thread Andriyko
Thank you for reply, but I still get the errror Template error In template /home/pinglin/DjangoProjects/weblog/templates/blog/ article_archive.html, error at line 6 Caught ViewDoesNotExist while rendering: Tried archive_day in module django.views.generic.dates. Error was: 'module' object has no a

Re: Ajax replacement in django

2011-10-14 Thread Phang Mulianto
ajax use usualy load a div part of html with new content fetch from the server when user do something,like click a submit button. and django process the request as a simple usual request. i have using prototype+scriptocolous for the simple syntax to make an ajax form. i see the jquery version also

Re: Foreign key problem

2011-10-14 Thread Daniel Roseman
On Friday, 14 October 2011 12:44:45 UTC+1, Guy Nesher wrote: > > > Hi, > > I'm trying to populate a table with 2 foreign keys using a csv file > and keep getting the following error : > Cannot assign "238": "PrizetoRestaurant.RestauranttId" must be a > "Restaurant" instance. > > I tried to man

Re: a django question about "python manage.py syncdb"

2011-10-14 Thread Mike Dewhirst
On 14/10/2011, at 8:23 PM, Chen Xu wrote: > Hi, > I am new to Django. > I have installed Django and go t everything set up correctly, just started > some easy tutorials. > > So when I do > Django-admin.py startapp blog > > > it creates a /blog directory that looks like thsi > /blog > -

Django models design question

2011-10-14 Thread omerd
Hello everybody, I am writing my first web application with Django. I want to create a web of registration for many subjects. However, each subject require different set of details to be supplied so I don't know which models should I have in the database. Currently I have two models: Registration

Foreign key problem

2011-10-14 Thread Guy Nesher
Hi, I'm trying to populate a table with 2 foreign keys using a csv file and keep getting the following error : Cannot assign "238": "PrizetoRestaurant.RestauranttId" must be a "Restaurant" instance. I tried to manually define the primary keys in those tables, and I'm making sure I int() the data

Re: Ajax replacement in django

2011-10-14 Thread Babatunde Akinyanmi
>From what Iankesh said initially, I think he is having problems using ajax to load part of a page not ajax as a whole. Iankesh, it is possible to load only a portion of a page with ajax. On 10/13/11, Sells, Fred wrote: >> On Wed, Oct 12, 2011 at 9:17 AM, lankesh87 wrote: >> >  I am developing a

Re: a django question about "python manage.py syncdb"

2011-10-14 Thread Phang Mulianto
maybe you can try remove the models.py coz by default syncdb look for models.py or anything beneath models folder...but cannot do both of them... On Oct 14, 2011 5:49 PM, "Chen Xu" wrote: > and when i tried "python manage.py sqlall " it gives empty. > I think is it because I am not importing p

Why does Django not pass on error messages with the default 404 view?

2011-10-14 Thread yakiimo
The docs (https://docs.djangoproject.com/en/dev/topics/http/views/ #customizing-error-views) state, "The page_not_found view should suffice for 99% of Web applications, but if you want to override it, you can specify handler404 in your URLconf". The page_not_found view only passes on the requested

Re: Test DB Connection

2011-10-14 Thread Cal Leeming [Simplicity Media Ltd]
Ja - just catch OperationalError exception and check if the code was 1044. Here are a list of all the error codes, so you can choose which ones you want to handle individually: http://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html http://dev.mysql.com/doc/refman/5.5/en/error-messages

Test DB Connection

2011-10-14 Thread Julian Hodgson
I've go some python modules which automatically connect to the database then they are loaded beacuse they have an __init__.py with from django.core.management import setup_environ import passion.settings def loadSettings(): s = setup_environ(passion.settings) print s # this should only

Re: django 1.3: how to use get_abolute_url in class based generic views

2011-10-14 Thread Fabrizio Mancini
On 13 October 2011 23:57, Andriyko wrote: > urlpatterns = patterns('django.views.generic.dates', > (r'^(?P\d{4})/v/(?P\d{2})/(?P[-\w]+)/ > $', DateDetailView.as_view(template_name='blog/article_detail.html', > **entry_info_dict)), > ) > Hi, You are using (?P\w{3}) but in get_absolute_url you are

Re: a django question about "python manage.py syncdb"

2011-10-14 Thread Chen Xu
and when i tried "python manage.py sqlall " it gives empty. I think is it because I am not importing properly or something else is going wrong. Thanks On Fri, Oct 14, 2011 at 2:46 AM, Chen Xu wrote: > I know that will work, but what I can do to just make "python manage.py > syncdb" work

Re: a django question about "python manage.py syncdb"

2011-10-14 Thread Chen Xu
I know that will work, but what I can do to just make "python manage.py syncdb" work? Thanks very much On Fri, Oct 14, 2011 at 2:37 AM, nicolas HERSOG wrote: > You can also type python manage.py sqlall and copy paste sql > instructions in your bd > > On Fri, Oct 14, 2011 at 11:23 AM, Chen Xu

Re: a django question about "python manage.py syncdb"

2011-10-14 Thread nicolas HERSOG
You can also type python manage.py sqlall and copy paste sql instructions in your bd On Fri, Oct 14, 2011 at 11:23 AM, Chen Xu wrote: > Hi, > I am new to Django. > I have installed Django and go t everything set up correctly, just started > some easy tutorials. > > So when I do > Django-admin.p

a django question about "python manage.py syncdb"

2011-10-14 Thread Chen Xu
Hi, I am new to Django. I have installed Django and go t everything set up correctly, just started some easy tutorials. So when I do Django-admin.py startapp blog it creates a /blog directory that looks like thsi /blog - __init__.py - tests.py - models.py - views.py I know in D

Re: Storing regex raw string literal in Django model?

2011-10-14 Thread Daniel Roseman
On Thursday, 13 October 2011 23:58:00 UTC+1, Victor Hooi wrote: > > Hi, > > I have Django model and in one of the fields I need to store a regex string > that I can later use. > > class Foo(models.Model): > name = models.CharField(max_length=30, unique=True) > regex_string = models.TextFie