On Tue, Jan 5, 2010 at 5:24 AM, hakova <[email protected]> wrote:
> Hi all,
>
> I am a 'very' inexperienced django user with no programming
> background, so please be gentle with me :).
>
> I just typed the following models.py file under my project_name/
> app_name:
>
> # -*- coding: utf-8 -*-
> from django.db import models
>
> # Create your models here.
> class Couple(models.Model):
> coupleid = models.AutoField('Couple ID', primary_key=True)
> entry_date = models.DateField('Date Entered')
> home_address1 = models.CharField(max_length=200)
> home_address2 = models.CharField(max_length=200)
> home_phone = models.CharField(max_length=20)
>
> class Woman(models.Model):
> couple = models.ForeignKey(Couple)
> lastname = models.CharField(max_length=100)
> firstname = models.CharField(max_length=100)
> middle_initial = models.CharField = models.CharField(max_length=1)
> ssn = models.PositiveIntegerField('SSN')
> dob = models.DateField('Date of Birth')
> cell_phone = models.CharField(max_length=20)
> email = models.EmailField()
> picture = models.ImageField(upload_to="photos/")
> work_address1 = models.CharField(max_length=200)
> work_address2 = models.CharField(max_length=200)
> work_phone = models.CharField(max_length=20)
> fax = models.CharField(max_length=20)
>
> class Man(models.Model):
> couple = models.ForeignKey(Couple)
> lastname = models.CharField(max_length=100)
> firstname = models.CharField(max_length=100)
> middle_initial = models.CharField = models.CharField(max_length=1)
> ssn = models.PositiveIntegerField('SSN')
> dob = models.DateField('Date of Birth')
> cell_phone = models.CharField(max_length=20)
> email = models.EmailField()
> picture = models.ImageField(upload_to="photos/")
> work_address1 = models.CharField(max_length=200)
> work_address2 = models.CharField(max_length=200)
> work_phone = models.CharField(max_length=20)
> fax = models.CharField(max_length=20)
>
> Then I ran the command as described in tutorial 1:
> python manage.py sql app_name
>
> However, it gives me the error message listed on the subject line.
> Entire message is posted below:
>
> Traceback (most recent call last):
> File "manage.py", line 11, in <module>
> execute_manager(settings)
> File "/usr/lib/python2.6/site-packages/django/core/management/
> __init__.py", line 362, in execute_manager
> utility.execute()
> File "/usr/lib/python2.6/site-packages/django/core/management/
> __init__.py", line 303, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
> File "/usr/lib/python2.6/site-packages/django/core/management/
> base.py", line 195, in run_from_argv
> self.execute(*args, **options.__dict__)
> File "/usr/lib/python2.6/site-packages/django/core/management/
> base.py", line 221, in execute
> self.validate()
> File "/usr/lib/python2.6/site-packages/django/core/management/
> base.py", line 249, in validate
> num_errors = get_validation_errors(s, app)
> File "/usr/lib/python2.6/site-packages/django/core/management/
> validation.py", line 28, in get_validation_errors
> for (app_name, error) in get_app_errors().items():
> File "/usr/lib/python2.6/site-packages/django/db/models/loading.py",
> line 131, in get_app_errors
> self._populate()
> File "/usr/lib/python2.6/site-packages/django/db/models/loading.py",
> line 58, in _populate
> self.load_app(app_name, True)
> File "/usr/lib/python2.6/site-packages/django/db/models/loading.py",
> line 74, in load_app
> models = import_module('.models', app_name)
> File "/usr/lib/python2.6/site-packages/django/utils/importlib.py",
> line 35, in import_module
> __import__(name)
> File "/home/~/../project_name/app_name/models.py", line 12, in
> <module>
> class Woman(models.Model):
> File "/home/~/../project_name/app_name/models.py", line 19, in Woman
> cell_phone = models.CharField(max_length=20)
> TypeError: 'CharField' object is not callable
>
> Any ideas, pointers will be very much appreciated.
>
>
take a look at middle_initial of woman class ;)
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-users%[email protected]>
> .
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.