Re: Helsinki area djangonauts: Let's meet up

2009-11-07 Thread Marek Pietrucha

Hey Friends!

I would love to attend :) I just don't know if I can make it to
Kaisla. I'm and exchange student in Turku University of Applied
Sciences. Is the place of the meetup certain? Could you guys consider
moving it to the oldest city of great Finland - Turku ?

Best Regards!
MP

On Nov 6, 3:01 pm, Jusso  wrote:
> On Nov 6, 12:18 pm, Jukka Välimaa  wrote:
>
> > How does this sound?
>
> Sounds great. I currently have some plans for the date you picked, but
> I'll definitely try to attend.
>
>  - Juuso.
--~--~-~--~~~---~--~~
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: ORM

2009-10-08 Thread Marek Pietrucha

I see that all of you guy's know what your talking about. I was
thinking way won't you share some knowledge to this topic:
http://groups.google.com/group/django-users/browse_thread/thread/1517053b51a1d7c8/

Please read and give some response.

best regards.

On Oct 7, 7:05 pm, Christophe Pettus  wrote:
> On Oct 7, 2009, at 2:30 AM, Geobase Isoscale wrote:
>
> >  I intend to write ORM code that will create views and triggers in  
> > the database? Which parts of the source code should I alter?
>
> Django can work just fine with views and triggers, but the Django ORM  
> layer will not create them for you.  Views tend to be extremely  
> database-specific, and triggers even more so.
>
> In the case of views, you can create them using the database's native  
> view creation mechanism, and then set up a Django model to access  
> them, just as if they were a table (in this case, you would not use  
> syncdb to create the tables).  If you are using PostgreSQL, you can  
> even set them up to be updatable using the rules system.  As long as  
> they can be used just like a table with standard SQL SELECT / INSERT /  
> DELETE, Django should be perfectly happy to access them.
>
> In the case of triggers, there's no reason that a database that Django  
> is accessing cannot use triggers.  The only thing to keep in mind is  
> that if a trigger modifies a database row that also exists in memory  
> as a model object instance, nothing will cause the model object  
> instance to automatically reflect the changes in the database row, so  
> you might have "cache" consistency problems.
>
> So, if what you are asking is, "Can I use the Django ORM to access a  
> database in which I have created views and triggers," the answer is  
> "yes, provided you understand potential interactions."  If the  
> question is, "Can the Django ORM create views and triggers in the  
> database through its API," the answer is no.
> --
> -- Christophe Pettus
>     x...@thebuild.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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



nested inlines

2009-10-05 Thread Marek Pietrucha

Hello,

Has anyone achieved something like nested inlines in the admin pages?
Does anybody know about solutions to this matter? I know there is a
patch for older versions of django but not only there are no new ones
but also they didn't support editing (which makes it unusable).

best regards,
mp

P.S. this is the ticket regarding this matter: 
http://code.djangoproject.com/ticket/9025
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



InlineModelAdmin

2009-09-30 Thread Marek Pietrucha

Hello,

Could someone help me how can i add inlines to a admin.StackedInline?
On the django web page it is written that:

"The InlineModelAdmin class is a subclass of ModelAdmin so it inherits
all the same functionality as well as some of its own: (...)"

But when i add "inlines" to a StackedModel it seems to ignore the
things i wrote:

class Phone(admin.TabularInline):
   (...)

class WWW(admin.TabularInline):
   (...)

class Address(admin.StackedInline):
   inlines = [Phone, WWW]

class Company(admin.ModelAdmin):
   inlines = [Address,]

thank you kindly! :)
--~--~-~--~~~---~--~~
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: admin site doesn't refresh

2009-09-27 Thread Marek Pietrucha

FALS PROBLEM!! No NEED to reply.

sory :)

On Sep 27, 6:00 pm, Marek Pietrucha <mark.pietru...@gmail.com> wrote:
> I added screen shots:
>
> localhost:http://picasaweb.google.com/mark.pietrucha/DjangoAdminSite#5386176920...
> megiteam.pl:http://picasaweb.google.com/mark.pietrucha/DjangoAdminSite#5386176927...
>
> I think it's not a problem with the host because when i add different
> modules from other applications everything works and the admin site
> refreshes and shows them.
>
> It doesn't show only the CompanyAddress and LegalStatus modules.
>
> The problem has to be somewhere in my code :(
>
> thanks for 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: My Django powered website for web based learning

2009-09-27 Thread Marek Pietrucha

I can't get in :(

Is the site up and running?

On Sep 27, 3:16 pm, Parag Shah  wrote:
> Hello,
>
> I have created a Django powered website for open learning which organizes
> various computer science related course videos in the form of structured
> courses.
>
> Many thanks to the excellent Django and Python community for helping me get
> through the issues I faced.
>
> The website is hosted at:http://www.adaptivelearningonline.net
>
> I also plan to open source the code (as soon as I clean it up :-) )
>
> --
> Thanks & Regards
> Parag Shahhttp://blog.adaptivesoftware.biz
--~--~-~--~~~---~--~~
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: admin site doesn't refresh

2009-09-27 Thread Marek Pietrucha

I added screen shots:

localhost: 
http://picasaweb.google.com/mark.pietrucha/DjangoAdminSite#5386176920766947362
megiteam.pl: 
http://picasaweb.google.com/mark.pietrucha/DjangoAdminSite#5386176927362649474

I think it's not a problem with the host because when i add different
modules from other applications everything works and the admin site
refreshes and shows them.

It doesn't show only the CompanyAddress and LegalStatus modules.

The problem has to be somewhere in my code :(

thanks for 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
-~--~~~~--~~--~--~---



admin site doesn't refresh

2009-09-27 Thread Marek Pietrucha

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



Re: inspectdb and postgresql schema

2009-08-12 Thread Marek Pietrucha

Thank you for the anwser :)

It's not comforting but now I don't have to dig the whole google
achieve ;)

In this case, how do I construct django models?

best regards,
Mark
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



inspectdb and postgresql schema

2009-08-11 Thread Marek Pietrucha

Hello,

I have a relational database written in PostgreSQL 8.4. I use
different schemas - not default public schema. I tried to inspectdb my
database but the output was clean. It looked like the inspectdb tool
didn't look in my schemas. I thought it was the matter of the pg
driver, so I changed it from postgresql-psycopg2 to postgresql.
Nothing changed. The output was the same.

Is it possible to generate models from my database?

Am i doing something wrong?

Thanks for help :)

best regards,
mark

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