Re: Tutorial confusion: flat project layout with django 1.3.1

2011-10-16 Thread Ramiro Morales
On Sun, Oct 16, 2011 at 11:27 PM, garyrob  wrote:
> [...]
> But Part 1 of the django tutorial
> (https://docs.djangoproject.com/en/dev/intro/tutorial01/) shows a directory
> [...]
> But the tutorial is for version 1.3
> 'final', 0).

I'd ike to ask you what visual part of that online tutorial page makes you
think you are reading the documentation for the 1.3 release and
not the in-development code one.

We've implemented a couple of different strategies so the visitor really
knows what docs she/he is actually reading , the last one
being the light green selector in the lower right corner of all
the documentation pages that shows and controls what version
you are reading.

Maybe we can try to make it even more visible but I'm afraid
we are running out of ideas for this persistent problem some
users keep running into.

Regards,

-- 
Ramiro Morales

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Tutorial confusion: flat project layout with django 1.3.1

2011-10-16 Thread Kirill Spitsin
On Sun, Oct 16, 2011 at 07:27:42PM -0700, garyrob wrote:
> I'm having a strange problem.
> 
> When I run
> 
>   django-admin startproject mysite
> 
> I get a directory structure that is flat in the sense that there is no inner 
> mysite directory -- the manage.py and urls.py files are at the same level.
> 
> But Part 1 of the django tutorial 
> (https://docs.djangoproject.com/en/dev/intro/tutorial01/) shows a directory 
> structure with an inner mysite, such that manage.py is at the top layer and 
> urls.py is in the inner mysite. And it also says:
...

You are reading tutorial for development version of Django, and
startproject default layout was recently changed [1].  Tutorial for
1.3 is here: https://docs.djangoproject.com/en/1.3/intro/tutorial01/

[1] https://code.djangoproject.com/changeset/16964

-- 
Kirill Spitsin

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Tutorial confusion: flat project layout with django 1.3.1

2011-10-16 Thread garyrob
I'm having a strange problem.

When I run

  django-admin startproject mysite

I get a directory structure that is flat in the sense that there is no inner 
mysite directory -- the manage.py and urls.py files are at the same level.

But Part 1 of the django tutorial 
(https://docs.djangoproject.com/en/dev/intro/tutorial01/) shows a directory 
structure with an inner mysite, such that manage.py is at the top layer and 
urls.py is in the inner mysite. And it also says:

Doesn't match what you see?
The default project layout recently changed. If you're seeing a "flat" 
layout (with no inner mysite/ directory), you're probably using a version of 
Django that doesn't match this tutorial version. You'll want to either 
switch to the older tutorial or the newer Django version.


But the tutorial is for version 1.3, and my django.VERSION is (1, 3, 1, 
'final', 0).

So that is inconsistent. I'm wondering if, somehow, my virtualenv 
installation isn't causing the correct django-admin.py to be used. If I do

  which django-admin.py

it shows the version that's in the bin directory for the virtualenv for 
which I get the django.VERSION mentioned above, so I don't see how the 
virtualenv could be a problem.

Anyone have any ideas?

 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Wh_zaRROn6sJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



models.Model

2011-10-16 Thread youpsla
Hello,
I'm new to Django and I've only a medium background in funtionnal
programming in Python.

I'm currently reading and working on the Django tutorial. I've few
questions on a example of code because things are not so clear for me.

Here is the code example

1 from django.db import models
2
3 class Person(models.Model):
4 first_name = models.CharField(max_length=30)
5 last_name = models.CharField(max_length=30)

Can you say me if I'm wrong or not on the followings:

- line 1 : Import of the" models" method from the "django.db"
module ?

- line 3 : Définition of the "Person" classs wich heritates from the
"models.Model class ? If true, and assuming that "models" is a method,
a class can be nested in a method ?

- ligne 4 : Creation of variable "first_name" by calling the method
CharField with one argument. But how "CharFiled" is written, isn't it
a class ? ANd here we use only "models", then why on line 3 we use
"models.Model" ?

I hope it's not to much confusing  :-)

Help would be REALLY appreciated !!!

Regards

Alain

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to solve the instancemethod TypeError

2011-10-16 Thread Calvin Spealman
On Sun, Oct 16, 2011 at 6:07 AM, Tsung-Hsien  wrote:
> I have a photo page needed connecting each photo to different URL.
>
> --
> The URL as below:
> url(r'^gallery/(?P\d+)/(?P\d+)/$', zoom_photo)
>
> The view as below:
> def zoom_photo(request, item_id, photo_id):
>        item = Item.objects.get(id=item_id)
>        photo = item.photo_set.all[photo_id]

You forgot the call the all() method here.

photo = item.photo_set.all()[photo_id]

Be aware this will only be reliable if you have a stable order_by
defined, so the index is
always across the same sorting of the photos.

>        t = loader.get_template("zoom_photo.html")
>        c = Context({'photo':photo})
>        return HttpResponse(t.render(c))
>
> 
> When I enter the URL such as http://127.0.0.1:8000/blog/gallery/1/1/
> it shows a error
> Exception Type: TypeError
> Exception Value:
> 'instancemethod' object is not subscriptable
> Exception Location:     C:\Python27\Lib\site-packages\django\bin\mysite\..
> \mysite\blog\views.py in zoom_photo, line 27
>
> ---
> In the first, I think change the photo_id to int(photo_id), but the
> error is the same as above. I have no idea how to solve.
>
> --
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Automaticall list all fields of generic model in template

2011-10-16 Thread Mario Gudelj
I think you need this
https://docs.djangoproject.com/en/dev/topics/forms/modelforms/

On 16 October 2011 18:24, bovender  wrote:

> Hi all,
>
> new to Django and loving it.
>
> Is there a way to automatically generate HTML output for the fields of a
> model instance?
>
> I'm looking for something similar to form.as_table, just without the form
> widgets.
>
> Currently I find myself manually repeating all the typing work for the
> detail view templates that I already did for the model definitions.
>
> Thanks
>
> bovender
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/iGP654BL2HMJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: syncdb for mysql using engine=NDBCLUSTER

2011-10-16 Thread Phang Mulianto
Hi Florian,

Thanks for the pointer.. nice and works like a charm..

i will prefer add the options in the settings.py as the table will growing
and work for all application table including admin table.

and the next target is figure out about the database router for load
balancing the sql query..

is it better to load balance by within the django or handle it using other
Layer 4 load balancer ?

thanks

On Mon, Oct 17, 2011 at 12:24 AM, Florian Apolloner
wrote:

> Oh and if you don't want to create all tables in the cluster, just create
> with the default engine and then switch as needed.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/YqWTj0_-_tYJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Pango causing mod_wsgi to crash - Segmentation fault (11)

2011-10-16 Thread pbzRPA
Hi Florian,

I have been working on the problem the whole weekend and after trying
all the mog_wsgi debugging method I still do not have a solution. I do
know that the error does not lie in my django code or my apache
configuration as I did the exact setup on a ubuntu machine and it
works 100%. It seems to be a problem with GTK2 on debian.

What version numbers do you need?

~$ dpkg -l | grep "apache"
ii  apache22.2.16-6+squeeze4
Apache HTTP Server metapackage
ii  apache2-mpm-worker 2.2.16-6+squeeze4
Apache HTTP Server - high speed threaded model
ii  apache2-prefork-dev2.2.16-6+squeeze4
Apache development headers - non-threaded MPM
ii  apache2-utils  2.2.16-6+squeeze4
utility programs for webservers
ii  apache2.2-bin  2.2.16-6+squeeze4
Apache HTTP Server common binary files
ii  apache2.2-common   2.2.16-6+squeeze4
Apache HTTP Server common files
ii  libapache2-mod-fcgid   1:2.3.6-1an
alternative module compat with mod_fastcgi
ii  libapache2-mod-wsgi3.3-2
Python WSGI adapter module for Apache

|~$(127) dpkg -l | grep "gtk"
ii  libgtk2.0-02.20.1-2
The GTK+ graphical user interface library
ii  libgtk2.0-bin  2.20.1-2
The programs for the GTK+ graphical user interface library
ii  libgtk2.0-common   2.20.1-2
Common files for the GTK+ graphical user interface library
rc  libwxgtk2.8-0  2.8.10.1-3+b1
wxWidgets Cross-platform C++ GUI toolkit (GTK+ runtime)
ii  python-gtk22.17.0-4
Python bindings for the GTK+ widget set

~$ dpkg -l | grep "python"
ii  ipython0.10-2
enhanced interactive Python shell
ii  libgv-python   2.26.3-5
Python bindings for graphviz
ii  libpython2.6   2.6.6-8+b1
Shared Python runtime library (version 2.6)
ii  python 2.6.6-3+squeeze6
interactive high-level object-oriented language (default version)
ii  python-cairo   1.8.8-1+b1
Python bindings for the Cairo vector graphics library
ii  python-central 0.6.16+nmu1
register and build utility for Python packages
ii  python-dateutil1.4.1-3
powerful extensions to the standard datetime module
rc  python-django  1.2.3-3+squeeze1
High-level Python web development framework
ii  python-flup1.0.2-1
Implements Python Web Server Gateway Interface (WSGI)
ii  python-genshi  0.6-1
Python XML-based template engine
ii  python-gobject 2.21.4+is.2.21.3-1
Python bindings for the GObject library
ii  python-gtk22.17.0-4
Python bindings for the GTK+ widget set
ii  python-imaging 1.1.7-2
Python Imaging Library
ii  python-magic   5.04-5
File type determination library using "magic" numbers (Python
bindings)
rc  python-matplotlib-data 0.99.3-1
Python based plotting system (data package)
ii  python-minimal 2.6.6-3+squeeze6
minimal subset of the Python language (default version)
ii  python-mysqldb 1.2.2-10+b1  A
Python interface to MySQL
ii  python-numpy   1:1.4.1-5
Numerical Python adds a fast array facility to the Python language
ii  python-openssl 0.10-1
Python wrapper around the OpenSSL library
ii  python-pam 0.4.2-12.2   A
Python interface to the PAM library
ii  python-pexpect 2.3-1
Python module for automating interactive applications
ii  python-pkg-resources   0.6.14-4
Package Discovery and Resource Access using pkg_resources
rc  python-pygments1.3.1+dfsg-1
syntax highlighting package written in Python
ii  python-pygraphviz  1.0-1
Python interface to the Graphviz graph layout and visualization
package
ii  python-serial  2.3-1
pyserial - module encapsulating access for the serial port
ii  python-setuptools  0.6.14-4
Python Distutils Enhancements (setuptools compatibility)
rc  python-subversion  1.6.12dfsg-6
Python bindings for Subversion
ii  python-support 1.0.10
automated rebuilding support for Python modules
ii  python-twisted-bin 10.1.0-3
Event-based framework for internet applications
ii  python-twisted-core10.1.0-3
Event-based framework for internet applications
ii  python-twisted-names   10.1.0-1 A
DNS protocol implementation with client and server
ii  python-twisted-web 10.1.0-1 An
HTTP protocol implementation together with clients and servers
ii  python-webpy   1:0.34-2
Web framework for Python appli

Re: please help can't start a new project

2011-10-16 Thread Wizcas
Have u run the py script by command "python"?
like:
python django-admin-py startprject student

On 10月16日, 上午6时25分, raddy  wrote:
> hello
>
> I'm using Windows7
> Python27 & Django1.3.1
>
> I'm done with the tutorials (1,2,3); have been working on mysite
> project. everything worked perfectly then.
>
> but now i wish to create a new project
>
> i tried by using:
> django-admin.py startproject student
>
> but a notepad (django-admin)opens saying
>
> #!C:\Python27\python.exe
> from django.core import management
>
> if __name__ == "__main__":
> management.execute_from_command_line()
>
> please help...

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Pango causing mod_wsgi to crash - Segmentation fault (11)

2011-10-16 Thread Florian Apolloner
Increase debug level and make sure to read the debugging docs on 
modwsgi.org; then you can hopefully provide more info, so we can actually 
help.

Cheers,
Florian

P.S.: Btw telling us which versions you use exactly would help too

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/TO3mdgUKtNgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: syncdb for mysql using engine=NDBCLUSTER

2011-10-16 Thread Florian Apolloner
Oh and if you don't want to create all tables in the cluster, just create 
with the default engine and then switch as needed.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/YqWTj0_-_tYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: syncdb for mysql using engine=NDBCLUSTER

2011-10-16 Thread Florian Apolloner
Hi,

this can be done as documented like for the innodb backend: 
https://docs.djangoproject.com/en/dev/ref/databases/#creating-your-tables

Cheers,
Florian

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/gjXN-sjpQKwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: please help can't start a new project

2011-10-16 Thread EdgarAllenPoe
Maybe you could try creating a batch file in the directory where you
you are going to keep your projects and call it NewProject.bat put
this inside

:Start Batch
File*
: Below replace c:\python27/lib/site-packages/django/bin/ with the
path tho your django-admin.py file
python c:\python27/lib/site-packages/django/bin/django-admin.py
startproject %1

:Below replace c:/django with the path to the folder where you keep
your projects (no ending forward slash)
SET PYTHONPATH=c:/django

:Below replace c:/django/ with the path to the folder where you keep
your projects (this time with an ending forward slash)
SET DJANGO_SETTINGS_MODULE=c:/django/%1
CD %1
:***End Batch
File*

Run the batch like this from a command line window:
NewProject student

I don't know if this is the best answer, but it is one that worked for
me.

On Oct 16, 7:25 am, raddy  wrote:
> hello
>
> I'm using Windows7
> Python27 & Django1.3.1
>
> I'm done with the tutorials (1,2,3); have been working on mysite
> project. everything worked perfectly then.
>
> but now i wish to create a new project
>
> i tried by using:
> django-admin.py startproject student
>
> but a notepad (django-admin)opens saying
>
> #!C:\Python27\python.exe
> from django.core import management
>
> if __name__ == "__main__":
>     management.execute_from_command_line()
>
> please help...

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django models design question

2011-10-16 Thread omerd
I should also mention that one AttributeValue table for all the
registrations isn't good for my purpose, because it says that the
Value column must have a specific type field. I want that every detail
(Atrribute) will have the option to be from any field type
(CharField,DateTimeField, etc).

On Oct 15, 9:37 pm, omerd  wrote:
> Thank you for the response.
>
> As stuart wrote, i should give more details about the website.
> Currently let's suppose I have 2 interesting tables (I'm not sure that
> the relationship between these 2 tables is well designed):
>
> 1. Details, that contains all the possible information that should be
> provided to register for something.
> For example: first name, last name, phone number, address etc.
>
> I should mention again that every registration needs other set of
> details
>
> 2. Registration, that have the following columns:
> admin (the admin of the registration), registration_name,id , foreign
> key to Details(many to many).
>
> actually, I chose the first model that sturat described. I wan't that
> some users that have the appropriate privileges (super-user) will be
> able to define new registration for something. For example, let's
> suppose that a new user asks me to use the infrastructure of the
> website to create a new registration for his handgun shop because he
> wants to know the amount of arms that have to be taken from the
> factory.
> So, I, as the site admin, adding 2 new record to the Details table
> (caliber and shell capacity), and a new record to the registration
> table. This is very simple and can be done from the admin site.
>
> The problem is that I need to change the code (models.py) and add a
> new model called "Handgun"- a model for the registration that has
> those columns:
> Foreign key to Registration table, Shell capacity, Caliber Capacity.
>
> I don't want to change the code (models.py) whenever I'm adding a new
> registration record. this attitude is bad and not scalable.
>
> I'm need your advice!
>
> On Oct 14, 6:30 pm, Stuart  wrote:
>
>
>
>
>
>
>
> > 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, rather than
> > specifying them yourself beforehand. So if I am a user of your system,
> > I can define a new Registration for handguns, and indicate that I want
> > Details of caliber and shell capacity. Then another user can access
> > the system and register his .38 six-shooter. Is that the kind of thing
> > you have in mind? If so, you are essentially giving the users the
> > ability to define a new table (Registration) with certain columns
> > (Details), and then letting them populate it (and you would store the
> > actual values using another model like 'AttributeValue').
>
> > On the other hand, if you are defining the subjects beforehand as the
> > developer, you will want a different approach altogether. In that case
> > you might consider something like model inheritance (https://
> > docs.djangoproject.com/en/1.3/topics/db/models/#model-inheritance) or
> > some other technique to keep things DRY as you add dozens of
> > registration subjects.
>
> > Hope that helps,
>
> > --Stuart
>
> > On Oct 14, 6:53 am, omerd  wrote:
>
> > > 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 - describes a registration (each record is a different
> > > subject)
> > > Details - describes all the possible details which may be necessary to
> > > register.
>
> > > Now, each Registration instance should contain a list of the necessary
> > > details, so i guess that Registration and Details are Many-To-Many
> > > connected.
>
> > > My question is - how the other model(s) which contains the actual
> > > details and a FK to Registration model should look like? I don't want
> > > to create a new model for each Registration record and place the
> > > necessary details hardcoded in the model fields. What if I have 30
> > > records in Registration table ?!

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Error changed - I am still stuck

2011-10-16 Thread Piotr Hosowicz
I didn't change anything pertaining DB in the model, so it wasn't
necessary, but done that and nothing is better :-(

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Error changed - I am still stuck

2011-10-16 Thread Piotr Hosowicz
And this is from views.py:

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))

Regards,

Piotr Hosowicz

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Error changed - I am still stuck

2011-10-16 Thread Babatunde Akinyanmi
Since you changed your changed your models, you will have to drop your
tables and syncdb all over again.

On 10/16/11, Piotr Hosowicz  wrote:
> Hello,
>
> To remind: this is my models.py excerpt:
>
> class CampPeople(models.Model):
> person = models.ForeignKey(Person)
> camp = models.ForeignKey(Campaign)
> docall = models.BooleanField(default = True)
> called = models.BooleanField(default = False)
>
> class PersonPhones(models.Model):
> person = models.ForeignKey(Person)
> phone = models.ForeignKey(Phone)
> def __unicode__(self):
> return "%s" % (unicode(self.phone) or "")
>
> This is my template:
>
> 
>
> {% for ziutek in phones %}
>   {{ ziutek }}
> {% endfor %}
>
> 
>
> Now I get following error in the browser:
>
> TemplateSyntaxError at /people/campaign/1
>
> Caught DatabaseError while rendering: BŁĄD:  kolumna
> people_phone.person_id nie istnieje
> LINE 1: SELECT "people_phone"."id", "people_phone"."person_id",
> "peo...
>
> It says that column people_phone.person_id doesn't exist and it's
> true, there is only id column, I have the joins defined in
> people_phones table.
>
> Please help me, I am terribly ill and would like to do something
> positive.
>
> Regards,
>
> Piotr Hosowicz
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Sent from my mobile device

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Error changed - I am still stuck

2011-10-16 Thread Piotr Hosowicz
Hello,

To remind: this is my models.py excerpt:

class CampPeople(models.Model):
person = models.ForeignKey(Person)
camp = models.ForeignKey(Campaign)
docall = models.BooleanField(default = True)
called = models.BooleanField(default = False)

class PersonPhones(models.Model):
person = models.ForeignKey(Person)
phone = models.ForeignKey(Phone)
def __unicode__(self):
return "%s" % (unicode(self.phone) or "")

This is my template:



{% for ziutek in phones %}
  {{ ziutek }}
{% endfor %}



Now I get following error in the browser:

TemplateSyntaxError at /people/campaign/1

Caught DatabaseError while rendering: BŁĄD:  kolumna
people_phone.person_id nie istnieje
LINE 1: SELECT "people_phone"."id", "people_phone"."person_id",
"peo...

It says that column people_phone.person_id doesn't exist and it's
true, there is only id column, I have the joins defined in
people_phones table.

Please help me, I am terribly ill and would like to do something
positive.

Regards,

Piotr Hosowicz

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



syncdb for mysql using engine=NDBCLUSTER

2011-10-16 Thread Phang Mulianto
Hi,

i try to run syncdb to create table in mysql cluster db, and need have
engine=NDBCLUSTER in each table which want to create in the cluster.
How to add the engine=NDBCLUSTER from the syncdb command line ?

Thanks for the help.

Mulianto

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Logger parameters not accepted in AdminMailHandler?

2011-10-16 Thread momo2k
Hello,

strange Problem here:

LOGGER = logging.getLogger('somename')
LOGGER.error('Could not do something: %s', err.output, exc_info=True)

In the mail it shows 'Could not do something: %s', but in the logfile
(RotatingFileHandler) %s is correcly substituted by err.output. Am I
missing the paragraph were this behaviour is described in the docs or
is it a bug?

Greets
momo

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



please help can't start a new project

2011-10-16 Thread raddy
hello

I'm using Windows7
Python27 & Django1.3.1

I'm done with the tutorials (1,2,3); have been working on mysite
project. everything worked perfectly then.

but now i wish to create a new project

i tried by using:
django-admin.py startproject student

but a notepad (django-admin)opens saying

#!C:\Python27\python.exe
from django.core import management

if __name__ == "__main__":
management.execute_from_command_line()


please help...

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Automaticall list all fields of generic model in template

2011-10-16 Thread bovender
Hi all,

new to Django and loving it.

Is there a way to automatically generate HTML output for the fields of a 
model instance?

I'm looking for something similar to form.as_table, just without the form 
widgets.

Currently I find myself manually repeating all the typing work for the 
detail view templates that I already did for the model definitions.

Thanks

bovender

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/iGP654BL2HMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to solve the instancemethod TypeError

2011-10-16 Thread Tsung-Hsien
I have a photo page needed connecting each photo to different URL.

--
The URL as below:
url(r'^gallery/(?P\d+)/(?P\d+)/$', zoom_photo)

The view as below:
def zoom_photo(request, item_id, photo_id):
item = Item.objects.get(id=item_id)
photo = item.photo_set.all[photo_id]
t = loader.get_template("zoom_photo.html")
c = Context({'photo':photo})
return HttpResponse(t.render(c))


When I enter the URL such as http://127.0.0.1:8000/blog/gallery/1/1/
it shows a error
Exception Type: TypeError
Exception Value:
'instancemethod' object is not subscriptable
Exception Location: C:\Python27\Lib\site-packages\django\bin\mysite\..
\mysite\blog\views.py in zoom_photo, line 27

---
In the first, I think change the photo_id to int(photo_id), but the
error is the same as above. I have no idea how to solve.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.