Re: Django, RDF & XUL

2006-11-09 Thread David Larlet
2006/11/9, James Bennett <[EMAIL PROTECTED]>: > > On 11/8/06, benj <[EMAIL PROTECTED]> wrote: > > Does anyone have experience translating django models into RDF graphs? > > My ideal views would look something like this: > > Off the top of my head I don't know of anyone who's done this, but it >

Re: how are you handling i18n and m10l content?

2006-11-09 Thread Aidas Bendoraitis
+1 for this type of solution. Just there is no need for the intermediate table between the table with untranslatable fields and the table with translatable ones, because the relationship between these two tables is one to many. So the table with translatable fields could just have a FK to the

Re: how are you handling i18n and m10l content?

2006-11-09 Thread Gacha
I developed an e-shop web and I implemented unlimited language support for all content. Every model realy holded only integer values and values, that should't be translated. Fields like "title" and "description" was virtual, they didn't exist in the table, but I was able to call them like

Re: how are you handling i18n and m10l content?

2006-11-09 Thread Gacha
Aidas Bendoraitis wrote: > MyModel.objects.by_language("EN").all() > MyModel.objects.by_language("EN").order_by('title') I think this would be greate. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: how are you handling i18n and m10l content?

2006-11-09 Thread Aidas Bendoraitis
Gacha, In your suggestion there is no way to sort objects by language-specific fields, except in the programming language level, is there? And the other disadvantage is that value field is always of the TEXT type whereas sometime it could be VARCHAR or CHAR, so you are kind of wasting resources.

Re: how are you handling i18n and m10l content?

2006-11-09 Thread Kenneth Gonsalves
On 09-Nov-06, at 3:03 PM, Gacha wrote: > Aidas Bendoraitis wrote: >> MyModel.objects.by_language("EN").all() >> MyModel.objects.by_language("EN").order_by('title') > > I think this would be greate. sensational is the word ;-) -- regards kg http://lawgon.livejournal.com

Re: how are you handling i18n and m10l content?

2006-11-09 Thread Gacha
I agree to you about my version of this, but it was the best I could figure out :) I readed your suggestion and I think it's very good and I think it's very easy to implement in django system. --~--~-~--~~~---~--~~ You received this message because you are

Re: how are you handling i18n and m10l content?

2006-11-09 Thread fdb
Kenneth Gonsalves wrote: > i took a look at this - it seems to imply that there is only one > translateable field in the model (I may be wrong). But for me a > typical page model would have several Char fields and more than one > text field. How does one handle that? I was thinking having

Re: how are you handling i18n and m10l content?

2006-11-09 Thread Carlos Yoder
> > Aidas Bendoraitis wrote: > >> MyModel.objects.by_language("EN").all() > >> MyModel.objects.by_language("EN").order_by('title') > > > > I think this would be greate. > > sensational is the word ;-) > Now we just need to get one of the Django-savvy developers to implement it, since I'm sure

Bug?

2006-11-09 Thread Tom Smith
I get this on a page called, funnily enough, "amp" Is it a bug? TemplateSyntaxError: Caught an exception while rendering: Original Traceback (most recent call last): File "/users/home/tomsmith/domains/burningahole.co.uk/django/ django/template/__init__.py", line 706, in render_node

Re: how are you handling i18n and m10l content?

2006-11-09 Thread Kenneth Gonsalves
On 09-Nov-06, at 4:03 PM, Carlos Yoder wrote: > And now I read what I wrote. Enough time *and* skills? That could > be tricky ;-) i have been meaning to hack on django for nearly a year and a half now - maybe it's time to get my feet wet ;-) -- regards kg http://lawgon.livejournal.com

Re: edit_inline behavior

2006-11-09 Thread Phil Davis
On 8/13/06, John <[EMAIL PROTECTED]> wrote: > edit_inline seems to be doing something funky when I use it through > update_object generic view. I've got a model that looks something like > this: [...] > At first glance it appears to be working -- the update_oject view for > StationEvent lists

Child Category Views

2006-11-09 Thread Jamie Pittock
Hi folks, I've just started transporting an existing site to Django as a learning exercise and some quick help would be appreciated. I'm using some code from the cookbook to allow parent/child categories: http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic That's all dandy.

Re: Child Category Views

2006-11-09 Thread Jamie Pittock
Sorry to reply to myself so quickly. After a bit of refactoring my two views look like this: def entries_by_category(request, slug): category = get_object_or_404(Category, slug=slug) entry_list_by_category = category.entry_set.order_by('-pub_date', 'title') return

model question

2006-11-09 Thread Rob Slotboom
I'm trying to get a very simple relationship to work but I can't figure ou how to do this in Django. This is what I want. Poll ---<< question Poll ---<< vote A user can vote a poll just once. I check this using a function which gets the remote ip. This is the models.py snippet class

Re: how are you handling i18n and m10l content?

2006-11-09 Thread David Blewett
On Nov 9, 4:28 am, "Aidas Bendoraitis" <[EMAIL PROTECTED]> wrote: > Actually this could be integrated into the core. > When you create a model, you could add translatable=True to fields > that have to be in the language-specific table. > When you make selections, you would need to set the

Re: Bug?

2006-11-09 Thread Russell Keith-Magee
On 11/9/06, Tom Smith <[EMAIL PROTECTED]> wrote: > > I get this on a page called, funnily enough, "amp" > > Is it a bug? Well... unless a MemoryError is the expected result... yes :-) > return html.replace('&', '').replace('<', '').replace > ('>', '').replace('"', '').replace("'", '')

Re: Re: edit_inline behavior

2006-11-09 Thread Russell Keith-Magee
On 11/9/06, Phil Davis <[EMAIL PROTECTED]> wrote: > > On 8/13/06, John <[EMAIL PROTECTED]> wrote: > > edit_inline seems to be doing something funky when I use it through > > update_object generic view. I've got a model that looks something like > > this: > [...] > > At first glance it appears to

Re: Child Category Views

2006-11-09 Thread Jeremy Dunck
On 11/9/06, Jamie Pittock <[EMAIL PROTECTED]> wrote: > (r'^category/(?P[-\w]+)/(?P[-\w]+)', > 'entries_by_child_category'), How about: (r'^category/(?P[-\w]+)(/(?P[-\w]+))?/$', 'entries_by_category'), def entries_by_category(request, slug, childslug=None): ... ?

Re: Child Category Views

2006-11-09 Thread ToddG
I think you can just use: def entries_by_category(request, slug, childslug=None) with your first urlpattern and then switch on childslug, i.e. if it's set or not. Also you're prob already looking at this but http://www.djangoproject.com/documentation/url_dispatch/#named-groups should help if

Re: Re: Child Category Views

2006-11-09 Thread Russell Keith-Magee
On 11/9/06, Jamie Pittock <[EMAIL PROTECTED]> wrote: > > I'm sure there must be a way of doing this with just the one view > though. There are multiple ways, depending on the exact result you want. One way is to define a view with a default argument: def entries_by_category(request, slug,

Re: Child Category Views

2006-11-09 Thread Jamie Pittock
great. I'm sure it's not perfect yet but I ended up with this: def entries_by_category(request, slug, childslug=None): if childslug is not None: slug = childslug category = get_object_or_404(Category, slug=slug) entry_list_by_category =

Re: Child Category Views

2006-11-09 Thread Jamie Pittock
Sorry, I missed those last two replies as I was replying myself. I'll take a look now and check I'm doing things right. Many thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Re: edit_inline behavior

2006-11-09 Thread Phil Davis
On 11/9/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 11/9/06, Phil Davis <[EMAIL PROTECTED]> wrote: [...] > > I have just tried a 'by-the-docs' generic view with simple 2 model > > master/detail update form and get exactly the same problem or > > duplicated detail rows after each

Paginator question

2006-11-09 Thread Pythoni
As far as I know paginator works with a list that is created from an object with get_count() and get_list() methods. If I already have a list, is it possible to use paginator with that list somehow too? Thank you for replies La. --~--~-~--~~~---~--~~ You

Re: how are you handling i18n and m10l content?

2006-11-09 Thread Carlos Yoder
> David Bleweet said: >> Actually this could be integrated into the core. >> When you create a model, you could add translatable=True to fields >> that have to be in the language-specific table. >> When you make selections, you would need to set the language name in >> the following or a similar

Re: how are you handling i18n and m10l content?

2006-11-09 Thread Aidas Bendoraitis
Only after implementation :) Keep in mind, that not only the database API of Django has to be modified, but also the administration interface, if we stuck at this solution. By the way, I forgot to set language in the WHERE clause of my example, but that makes no big difference for imagining what

Re: Django, RDF & XUL

2006-11-09 Thread Perica Zivkovic
whoa this sounds really as a cool idea On 11/9/06, David Larlet <[EMAIL PROTECTED]> wrote: > > 2006/11/9, James Bennett <[EMAIL PROTECTED]>: > > > > On 11/8/06, benj <[EMAIL PROTECTED]> wrote: > > > Does anyone have experience translating django models into RDF graphs? > > > My ideal views

Re: how are you handling i18n and m10l content?

2006-11-09 Thread coulix
i like this ! :) very pythonic. --~--~-~--~~~---~--~~ 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

Re: Django, RDF & XUL

2006-11-09 Thread orestis
Hey, can you give some more info on the stack of this application ? Is it client-server, standalone ? What advantages does it have over the normal HTML approach ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: model question

2006-11-09 Thread Rob Hudson
I'd kind of think that in Vote you don't need the poll FK, just the choice since the choice then maps to a particular poll. Though the Django admin won't do inline editing of FK relationships more than 2 deep. Otherwise I think the effect your seeing makes sense. There is nothing in these

Re: model question

2006-11-09 Thread Rob Slotboom
Rob Hudson schreef: > I'd kind of think that in Vote you don't need the poll FK, just the > choice since the choice then maps to a particular poll. But how do I prevent a voter to vote more than once on a poll? --~--~-~--~~~---~--~~ You received this message

Admin issues

2006-11-09 Thread Picio
Hello, I have this model: class operazione(models.Model): descrizione = models.TextField() data = models.DateField('giorno') ore_uomo = models.FloatField(max_digits=2, decimal_places=1) progetto = models.ForeignKey(progetto) tipologia =

Re: Apache 2.0.58 will not OBEY on OS X 10.4.8

2006-11-09 Thread kmr
I've changed the httpd.conf to read: DocumentRoot /Users/kimvandenbroek/Sites/mysite SetHandler mod_python PythonHandler django.core.handlers.modpython PythonPath sys.path+['/Users/kimvandenbroek/Sites'] SetEnv

Paginator question

2006-11-09 Thread Pythoni
As far as I know paginator works with a list that is created from an object with get_count() and get_list() methods. If I already have a list, is it possible to use paginator with that list somehow too? Thank you for replies La. --~--~-~--~~~---~--~~ You

Workflow engine for python?

2006-11-09 Thread mamcxyz
Exist a workflow engine for python as http://wf.netfx3.com/? I don't need a User GUI because is for plug it into a web service I'm working on django. The workflow is pretty simple and work similare to: Start -- Get File -- Run Process1 In parallel: - Run Task1 - Run Task2

Model validation errors ...

2006-11-09 Thread ZebZiggle
Hi there, I've decided to drop my old 0.91 database and rebuild, rather than try to upgrade it. So, in my dev environment I've dropped the database, but now when I try to 'syncdb' I get the following validation error. Error: Couldn't install apps, because there were errors in one or more

Re: Apache 2.0.58 will not OBEY on OS X 10.4.8

2006-11-09 Thread sorrison
Hi again, Firstly i would turn PythonDebug On, Here is a sample of what i use in a production enviroment maybe this might help. Cheers, Sam SetHandler mod_python PythonHandler django.core.handlers.modpython PythonPath "['/path/to/python/code'] + sys.path"

Re: Model validation errors ...

2006-11-09 Thread ZebZiggle
More on this: If I change Accusation to: class Accusation(models.Model): game = models.ForeignKey(Game) player = models.ForeignKey(Player, related_name='related_player') accusedPlayer = models.ForeignKey(Player, related_name='related_accusedPlayer') isCommitted =

Re: Re: Model validation errors ...

2006-11-09 Thread James Bennett
On 11/9/06, ZebZiggle <[EMAIL PROTECTED]> wrote: > My question is ... why is Accusation any different tan Message, > ReadMessage or any of the other tables that relate back to Player? The problem was that Accusation has *two* fields which relate to Player. When 'related_name' isn't set, that

Re: Paginator question

2006-11-09 Thread SmileyChris
On Nov 10, 2:59 am, "Pythoni" <[EMAIL PROTECTED]> wrote: > As far as I know paginator works with a list that is created from an > object with > get_count() and get_list() methods. > If I already have a list, is it possible to use paginator with that > list somehow too? > > Thank you for

Re: Admin issues

2006-11-09 Thread Picio
> Do I Have to use a custom manipulator? > > Thanks in advance. > Picio > Sorry I want to say CUSTOM MANAGER :( Picio --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Models as a Package

2006-11-09 Thread Nathan Yergler
Any reason that making models.py into a package seems to make the models invisible to syncdb? For example, with a project foo, I have a directory "models" that contains "bar.py" and "__init__.py" __init__ contains "from bar import *", but syncdb doesn't seem to see the models. Thoughts?

Re: Model validation errors ...

2006-11-09 Thread ZebZiggle
Ah ... of course. Thanks James! Keep up the great work! -Sandy --~--~-~--~~~---~--~~ 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

Re: Models as a Package

2006-11-09 Thread Nathan Yergler
Nevermind, I figured it out... I was forgetting the annoying class MyModel(models.Model): ... class Meta: app_label = 'app_name' Sigh... On Thu, 2006-11-09 at 15:57 -0500, Nathan Yergler wrote: > Any reason that making models.py into a package seems to make the models > invisible

Re: Re: Models as a Package

2006-11-09 Thread James Bennett
On 11/9/06, Nathan Yergler <[EMAIL PROTECTED]> wrote: >class Meta: > app_label = 'app_name' Yeah, that's a huge wart that comes out of the way the metasystem works right now. Anybody got ideas for something better? -- "May the forces of evil become confused on the way to your house."

override list_fiilter behaviour

2006-11-09 Thread Picio
Hello, Is Ita possible to override the list_filter behaviour? Where It resides? Pico --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Hand Count: How many Django users are there in Denver?

2006-11-09 Thread Joe Murphy
I just moved here, and am curious what the local Django scene's like. --~--~-~--~~~---~--~~ 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

Re: Hand Count: How many Django users are there in Denver?

2006-11-09 Thread ogghead
I know there are several Django enthusiasts to your north in Boulder and Longmont--we hosted a sprint last Saturday to try to finish Oracle support for Django's database layer (almost there!). Undoubtedly there are also Django folks in Denver proper. There are many pythoneers up and down the

tabindex HTML attribute: any way to assign to form fields in Generic Views?

2006-11-09 Thread Twitchmedia
Greetings! Does anyone know if it's possible to assign tabindex values to forms in a Generic View within the template? Since the INPUT fields are automatically generated, I'm not sure this is possible without using Javascript to set the tabindex after the forms have been created. Have I

Re: model question

2006-11-09 Thread yun
In the view you would need to check if the voter has already voted in the poll. If the query is empty, then you can allow the person to vote, if the query contains a record for a particular poll and a particular voter, then you need to redirect them to an "You've already voted on this poll" page.

two sites getting mixed up

2006-11-09 Thread Kenneth Gonsalves
hi i have two sites running under apache-modpython: foo.com/web/ bar.foo.com/web/ both live in separate svn repositories, but share a common history in the sense that i exported from the first to create the second. As far as i can see, i have removed all references to the first from the

unable to use Custom Manager

2006-11-09 Thread Picio
Hello, my code is here: http://paste.e-scribe.com/hold/2728/ Can anyone help me find the reason whay I can't make It work? In particular no matter if I set a filter in the custom manager 'SoloCurrentUser' It still show me all the rows in the Admin ! I've really tried everything and the python

Re: Problem with ordering (ORDER_BY)

2006-11-09 Thread Jacob Kaplan-Moss
On 11/8/06 1:59 AM, Pythoni wrote: > words.get_list(order_by=('Word')) In Python, a single element tuple looks like ``("Word",)`` -- note the trailing comma. Without it, you're doing this:: words.get_list(order_by="Word")) And since strings are iterable, Django thinks you want to

Re: User/request.user confusion

2006-11-09 Thread James Bennett
On 11/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm sure I've seen a discussion on this recently, but I can't find it > now... I've got users that are coming to the site and it's seeing them > as already logged in... as other users. One person even had the site > think they were me and

Re: Problem with ordering (ORDER_BY)

2006-11-09 Thread Pythoni
Jacob, Thank you for your help. I used the comma and now it works . La. --~--~-~--~~~---~--~~ 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

Re: Paginator question

2006-11-09 Thread Pythoni
Thank you for your reply Where can I download the patch? I still use 0.91 Django version --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to