Hello my dear django users,

I started to write and application in django and I encountered a
problem with which i'm dealing for about 2days (i'm quite
frustrated ;) )

I have constructed my models, as follows:
# Company Models

from django.db import models

class CompanyType(models.Model):
    name = models.CharField(max_length=1024, null=True, blank=True,
unique=True)

    class Meta:
        ordering = ('name',)

    def __unicode__(self):
        return self.name


class CompanySubType(models.Model):
    name = models.CharField(max_length=1024, unique=True)

    class Meta:
        ordering = ('name',)

    def __unicode__(self):
        return self.name


class LegalStatus(models.Model):
    name = models.CharField('Legal Status', max_length=1024)

    class Meta:
        ordering = ('name',)

    def __unicode__(self):
        return self.name


class Company(models.Model):
    name = models.CharField(max_length=2048, null=True)
    parentCompany = models.ForeignKey("self", null=True, blank=True)
    legalStatus = models.ForeignKey(LegalStatus, null=True,
blank=True)
    type = models.ForeignKey(CompanyType)
    subtype = models.ManyToManyField(CompanySubType)

    # Dane dodatkowe
    krs = models.IntegerField('KRS', null=True, blank=True)

    class Meta:
        ordering = ('name',)

    def __unicode__(self):
        return self.name


class CompanyAddress(models.Model):
    company = models.ForeignKey(Company)
    label = models.CharField(max_length=1024)
    address = models.CharField(max_length=1024, null=True, blank=True)
    postalCode = models.CharField(max_length=14, null=True,
blank=True)
    city = models.CharField('City/Town', max_length=256, null=True,
blank=True)
    country = models.ForeignKey("helper.Country", null=True,
blank=True)

    class Meta:
        ordering = ('label',)

    def __unicode__(self):
        return self.label

my admin.py looks like this:
# Company Admin

from biotechdb.company.models import CompanyType, CompanySubType,
LegalStatus, Company, CompanyAddress
from biotechdb.helper.models import *
from django.contrib import admin

# Legal status
admin.site.register(LegalStatus)

# Company type
class CompanyTypeAdmin(admin.ModelAdmin):
    list_display = ('name',)
    list_per_page = 20

admin.site.register(CompanyType, CompanyTypeAdmin)

# Company sub type
class CompanySubTypeAdmin(admin.ModelAdmin):
    list_display = ('name',)
    list_per_page = 20

admin.site.register(CompanySubType, CompanySubTypeAdmin)

# Company Address
class PhoneInline(admin.TabularInline):
    model = Phone
    extra = 1

class WWWInline(admin.TabularInline):
    model = WWW
    extra = 1

class EmailInline(admin.TabularInline):
    model = Email
    extra = 1

class CompanyAddressAdmin(admin.ModelAdmin):
    fiedlsets = [
                 (None, {'fields': [('address', 'postalCode'),
('city', 'country')]})
                 ]
    inlines = [PhoneInline, WWWInline, EmailInline]

admin.site.register(CompanyAddress, CompanyAddressAdmin)

# Company
class CompanyAddressInline(admin.TabularInline):
    model = CompanyAddress
    extra = 1

class ChildComapnyInline(admin.TabularInline):
    model = Company
    extra = 0
    fields = ("name", "type")
    classes = ("collapse")

class CompanyAdmin(admin.ModelAdmin):
    fieldsets = [
                 (None,         {'fields': [('name', 'legalStatus',
'parentCompany'), ('type', 'subtype', 'krs')]}),
    ]
    inlines = [CompanyAddressInline, ChildComapnyInline]
    list_filter = ['type', 'subtype']
    list_display = ('name', 'parentCompany', 'type')
    list_per_page = 20
    search_fields = ['name']

admin.site.register(Company, CompanyAdmin)


When i was constructing the admin view first i added Companty,
CompanyType and CompanySubType. I deployed this app to a host
(megiteam.pl). Everything was working fine. After I check if
everything is working correct i added other modules as:
CompanyAddress, LegalStatus.

I restarted my local server (python manage.py runserver localhost:80) -
> changes were committed and the admin page showed all the modules
i've added. After that updated the changes via svn to my host on
(megiteam.pl). I logged in to my account via ssh on megiteam.pl and
downloaded the latest svn revision (svn up - in the project
catalogue). I have restarted the process but i didn't see any changes
in the admin site.

Could someone help me locating the problem?

BTW: technical info:
localhost: python 2.6, django 1.1
megiteam.pl: python 2.6.1, django 1.1
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to