Beginner: how to display the list of records with subrecords?

2011-11-20 Thread Petr Přikryl
Hi, I have a table with the following columns: code, location, description. The code uniquely identifies the goods. The description is related to the location. You can think about a state as the location. I like the view produced via admin -- like this: CodeLocation Description [ ]

Re: os.listdir() not returning unicode

2011-11-20 Thread Petr Přikryl
I disagree. I think this (here) is a good place to ask. I am a beginner in Django, but I am advanced in Python. The truth is that os.listdir() with unicode argument should return unicode strings (and it really does when executed at console -- which is also the case of running local server throug

Re: Beginner: how to display the list of records with subrecords?

2011-11-21 Thread Petr Přikryl
Hi Javier, > Od: "Javier Guerra Giraldez" >>PP wrote... >> I tried the tutorial, and I like it, but it is too much of new things >> for me. > >but all these new things are needed to solve your problem. > >for us (or anybody) to help you, we'd need first a common language, or >else we would waste

Re: Beginner: how to display the list of records with subrecords? (solved)

2011-11-22 Thread Petr Přikryl
My appology, Javier, > Javier Guerra Giraldez write >>Petr Přikryl wrote: >> I tried the tutorial, and I like it, but it is too much of new things >> for me. > >but all these new things are needed to solve your problem. I did study the tutorial, but I had picked on

How to enforce this rule for the admin mode?

2011-11-25 Thread Petr Přikryl
Hi, I am beginner in Django. I need to enforce the rule when creating or modifying the record related to other records from another table in the admin mode. I have the following model: class Location(models.Model): location = models.CharField('Location code', max_length=3, primary_key=True

Re: Bulk import of data

2011-11-26 Thread Petr Přikryl
>>> import csv >>> data = csv.reader(open('/path/to/csv', 'r'), delimiter=';') >>> for row in data: >>> category = Category.objects.get_or_create(name=row[0]) >>> sub_category = SubCategory.objects.get_or_create(name=row[1], >>> defaults={'parent_category': category}) >>> product = Product.objects

Is it possible to use MS SQL 2008 as the Django database engine?

2011-12-03 Thread Petr Přikryl
Hi, Do you have any experience with using Microsort SQL Server 2008 as the Django database engine? I understand that it is not supported directly. However, is it possible to add some kind of module that implements the Django database interface for the MS SQL? Thanks for your time and exper

Re: Is it possible to use MS SQL 2008 as the Django database engine?

2011-12-08 Thread Petr Přikryl
Thanks, David, for the information. Have a good time, Petr __ > Od: "David Fischer" > Komu: > Datum: 03.12.2011 22:23 > Předmět: Re: Is it possible to use MS SQL 2008 as the Django database engine? > >It is possible. The two major p

Django a Turnkey Linux -- I need your experience.

2011-12-14 Thread Petr Přikryl
Hi,  Being quite new to Django, I need to move the semi-ready application to the publicly available server (for a company users) and test it there.   It happened that the Django Turnkey Linux virtual machine was installed for the purpose by someone else. I have succeeded to SCP the files there. I

Re: Django a Turnkey Linux -- I need your experience.

2011-12-15 Thread Petr Přikryl
Thanks, Brett,   "Brett Epps" wrote... You'll need to do some research to find out how Turnkey Linux deploys your Django app.  There are multiple methods, but> the one recommended in the Django docs is to use Apache + mod_wsgi.> If Turnkey Linux uses this method, Apache should be configured with>

Re: Django a Turnkey Linux -- I need your experience.

2011-12-15 Thread Petr Přikryl
Thanks Nick,   By the 'application' I mean another part of the Django installation/project that does some specific function. Thanks for telling me that the wsgi_handler.py is the ".wsgi" file that I was searching for ;)   Do you have any experience with updating the version of Django?   Petr --

Re: Django a Turnkey Linux -- I need your experience.

2011-12-15 Thread Petr Přikryl
Thanks Brett for the info.   > I prefer Ubuntu Server, but your choice of distro isn't that important > as long as it is new-ish.     If I understand it well, then TurnKey Linux 11.3 is actually based on Ubuntu 10.04... plus the selected neccessary packages for the chosen purpose. > You'll want t

Re: Why can't erase this model object? "AssertionError: Question object can't be deleted because its id attribute is set to None."

2012-01-23 Thread Petr Přikryl
I am a Django novice, so only a wild guess based on my Python knowledge...   > In the Django shell I do > > quests = Question.objects.all() > quests[579].delete() > > Why does the objects.all() invocation add this id=None crud > to quests list?   Are you sure that you have 580 items in the conta

Re: django docs __unicode__ return u'%s %s

2012-01-25 Thread Petr Přikryl
> "coded kid" wrote: >If I may say, 'u' makes it easy to return variable with any hassle. >And %s rep each string in your script. I think there should be other >ways to go about this. Hope you get my point? This is wrong. The prefix 'u' means that the following string is a Unicode string, nothin

Re: django docs __unicode__ return u'%s %s

2012-01-25 Thread Petr Přikryl
"Krondaj wrote: >I'm using python 2.7.2 >for another model i'm forming i have: > >def __unicode__(self): >return (self.project_and_task, self.project_number, > self.date_created, self.requested_by) > >to understand (i think the new method makes a little more sense?) the >format sho

Re: GET and POST in forms. Please help me understand the logic!

2013-11-28 Thread Petr Přikryl
Have a look at the book RESTful Web Services, page 5 (Chapter 1) and on. http://it-ebooks.info/book/391/   You can read it on-line http://it-ebooks.info/read/391/ -- physical page 26/440, section "HTTP: Documents in Envelopes".   Have a nice day,    P. _