Re: Exercise: How would you design these models

2006-10-20 Thread Jeremy Dunck
On 10/20/06, Clint Ecker <[EMAIL PROTECTED]> wrote: > > So then I changed how I did it to this model, to try and enforce the > "a profile can have many images and a picture can only have 1 > UserProfile" restraint above: > I think I'd leave it as you had it in the first case, then override save,

Re: Exercise: How would you design these models

2006-10-20 Thread IT.Telecom
Get freelance or telecom-job here!! http://freelance.telecom.googlepages.com On Oct 21, 4:37 am, "Clint Ecker" <[EMAIL PROTECTED]> wrote: > Hey guys, I'm developing some models for a project and I'm running > into some issues and I'm wondering if perhaps I'm way off base with > how I'm approachin

Re: unique_together

2006-10-20 Thread RajeshD
On Oct 20, 9:01 pm, "seemant" <[EMAIL PROTECTED]> wrote: > Hi Rajesh, > > Absolutely. my definition of BIBLE_BOOKS is as follows: > Thanks. > > The version of sqlite I have here is 3.3.8 > That looks good. > > PS I have no idea how this SQL INSERT business works at all. At the SQLite3 shel

Re: unique_together

2006-10-20 Thread seemant
Hi Rajesh, Absolutely. my definition of BIBLE_BOOKS is as follows: BIBLE_BOOKS = ( ('1', 'Genesis'), ('2', 'Exodus'), ('3', 'Leviticus'), ('4', 'Numbers'), ('5', 'Deuteronomy'), ('6', 'Joshua'), ('7', 'Judges'), ('8', 'Ruth

Re: django says psycopg can't find libpq.so.4

2006-10-20 Thread [EMAIL PROTECTED]
> You would need to add /usr/local/pgsql/lib/ to /etc/ld.so.conf (you > don't mention it, but it sounds like you are on a Linux or similar sort > of system) so that the dynamic loader knows how to find the library. If the OP could access postgresql from the command line it probably had something

Re: ForeignKey in other models.py

2006-10-20 Thread Vittorino Parenti
Michael Radziej wrote: >Vittorino Parenti schrieb: > > >>Hi, >>i found this in django documentation: >> >>"Note, however, that you can only use strings to refer to models in the >>same models.py file -- you cannot use a string to reference a model in a >>different application, or to reference

Re: (Third Attempt To Post)Complex Application Security Model

2006-10-20 Thread Jay Parlar
On 10/20/06, Ramdas S <[EMAIL PROTECTED]> wrote: > How do I integrate the per-object-permissions trunk to my regular django > trunk which powers the web site. > > I checked the per-object-permissions trunk it works properly at least as far > as my simple cms apps are concerned. > You'll have to d

Re: Re: AbstractSearching and django.core.extensions?

2006-10-20 Thread Matthew Flanagan
On 21/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > sure here is is: > - > conception.concept.models: > - > from django.db import models > > LEVEL_CHOICES = ( > ('A', 'Level A'), > ('B', 'Level B'), > ('C', 'Level C'), > ) > > class Con

Re: Question about select_related and query caching

2006-10-20 Thread DavidA
DavidA wrote: > I have some models that look like this > > class Analyst(models.Model): > name = models.CharField(maxlength=20, unique=True) > > class Strategy(models.Model): > name = models.CharField(maxlength=20) > description = models.CharField(maxlength=80) > > class Inst(models.M

Re: Alternate colors - when returing a list.

2006-10-20 Thread DavidA
[EMAIL PROTECTED] wrote: > It's really a fine point, and I probably will use cycle next time > something like this rolls around, but I don't like it putting an > unnecessary class in there. > > If I could {% cycle even, "" %} or something, I'd probably be > completely sold. I recently migrated a

Re: some problems that make my work hard or force me to use AntiPatterns

2006-10-20 Thread orestis
I have created a middleware for dealing with inactivity in sessions. See the related documentation page. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dja

Exercise: How would you design these models

2006-10-20 Thread Clint Ecker
Hey guys, I'm developing some models for a project and I'm running into some issues and I'm wondering if perhaps I'm way off base with how I'm approaching the design. Here's how things should work, in words: A UserProfile can have many ImageObjects associated to it A UserProfile can have many Vi

Re: Compiling mod_python 3.2.x on Ubuntu

2006-10-20 Thread [EMAIL PROTECTED]
Karen Tracey wrote: > So I don't think you need to build mod_python to run on Ubuntu. At any > rate I didn't, I just installed the latest available from the default > repositories, and it's been running fine for a month or so (alibeit on > a very low-traffic site). Just what I needed to hear. Th

Re: Diamanda Wiki support and some django tutorials :)

2006-10-20 Thread Marcus Mendes
Congrats! I'll allways be there. Marcus On 10/20/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > there may be some problems with not fully redirected DNS. Should be ok > after few hours. > > > > > -- Marcus Mendes "A coragem é a forma de todas as virtudes em ponto de prova" C.S.Lewis ___

Re: Alternate colors - when returing a list.

2006-10-20 Thread [EMAIL PROTECTED]
It's really a fine point, and I probably will use cycle next time something like this rolls around, but I don't like it putting an unnecessary class in there. If I could {% cycle even, "" %} or something, I'd probably be completely sold. --~--~-~--~~~---~--~~ You

Re: Diamanda Wiki support and some django tutorials :)

2006-10-20 Thread [EMAIL PROTECTED]
there may be some problems with not fully redirected DNS. Should be ok after few hours. --~--~-~--~~~---~--~~ 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@googleg

Re: Django color picker -- ColorField?

2006-10-20 Thread zenx
It would be cool if the javascript widget also displayed the hexadecimal color (like #FF) calculating it real time from the RGB selected color. It will be also interesting if people could get the RGB, hex, etc. color by different methods (not only rgb). --~--~-~--~~~-

Question about select_related and query caching

2006-10-20 Thread DavidA
I have some models that look like this class Analyst(models.Model): name = models.CharField(maxlength=20, unique=True) class Strategy(models.Model): name = models.CharField(maxlength=20) description = models.CharField(maxlength=80) class Inst(models.Model): strategy = models.For

Re: (Third Attempt To Post)Complex Application Security Model

2006-10-20 Thread Ramdas S
How do I integrate the per-object-permissions trunk to my regular django trunk which powers the web site.I checked the per-object-permissions trunk it works properly at least as far as my simple cms apps are concerned. Ramdas On 10/20/06, Jay Parlar <[EMAIL PROTECTED]> wrote: Since I saw my name (i

Re: Compiling mod_python 3.2.x on Ubuntu

2006-10-20 Thread Karen Tracey
[EMAIL PROTECTED] wrote: > I'm trying to compile version 3.2 of mod_python (required by django) on > an Ubuntu Linux box. (Ubuntu offers mod_python 2.4) Assuming you're on a dapper Ubuntu box, I believe the "2.4" in the mod_python package name is referring to the Python level, not the mod_python

Re: Diamanda Wiki support and some django tutorials :)

2006-10-20 Thread [EMAIL PROTECTED]
Not seeing anything. --~--~-~--~~~---~--~~ 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 [EMAIL PROT

Re: Compiling mod_python 3.2.x on Ubuntu

2006-10-20 Thread bfordham
> I have installed apache2-threaded-dev, which I understand installs the > appropriate apxs files, but I can't seem to determine the path I should > use instead of /usr/local/apache/bin/apxs (I've cross-posted this to > the Ubunutu forums.) according to the list of files in that package: http:/

Re: Compiling mod_python 3.2.x on Ubuntu

2006-10-20 Thread doug
just finished setting up djanog-sandbox with ubuntu/ it is here: http://oviparo.us Doug On Oct 20, 1:08 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm trying to compile version 3.2 of mod_python (required by django) on > an Ubuntu Linux box. (Ubuntu offers mod_python 2.4) > > The co

Compiling mod_python 3.2.x on Ubuntu

2006-10-20 Thread [EMAIL PROTECTED]
I'm trying to compile version 3.2 of mod_python (required by django) on an Ubuntu Linux box. (Ubuntu offers mod_python 2.4) The command ./configure --with-apxs=/usr/local/apache/bin/apxs doesn't work because that's not where the apxs files are. I have installed apache2-threaded-dev, which I und

Re: unique_together

2006-10-20 Thread RajeshD
I just tried this through the Admin and I do get this nice error message: Scripture with this book already exists for the given chapter, from verse and to verse. If I try it through the Django shell, I get an Integrity Error from SQLite as expected. A few things: - If you attempt to do a strai

Re: FastCgi / PostgreSQL: FATAL: Ident authentication failed for user "user_name"

2006-10-20 Thread doug
looks like same issure here: http://groups-beta.google.com/group/django-users/browse_thread/thread/19ed1f82b5c80233/897f968eba507165?lnk=gst&q=authentication+failed+for+user&rnum=2#897f968eba507165 Doug On Oct 19, 8:49 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2006-10-18 at 02

Re: unique_together

2006-10-20 Thread seemant
Hi Rajesh, I do see that: sqlite> .schema sermons_scripture CREATE TABLE "sermons_scripture" ( "id" integer NOT NULL PRIMARY KEY, "book" varchar(2) NOT NULL, "chapter" integer NOT NULL, "from_verse" integer NOT NULL, "to_verse" integer NULL, "passage" varchar(50) NOT NULL,

Re: Django color picker -- ColorField?

2006-10-20 Thread ogghead
I would definitely use a Django "ColorField" type with a JavaScript editor. I currently do something similar in wxPython apps, using my own ColourGridCellEditor/Renderer classes. We store colors in the database as CHAR(11) RGB strings: "204,153,102". Perhaps you could subclass Django's CommaSep

Re: Re: getting max and min

2006-10-20 Thread James Bennett
On 10/20/06, DavidA <[EMAIL PROTECTED]> wrote: > I'm curious how you would solve this problem using SQLAlchemy. I have > _many_ needs for aggregation, subselects, and other things that are not > easy or possible to do in Django's ORM, but I've never seen an ORM that > does this (without just provi

Re: getting max and min

2006-10-20 Thread DavidA
Frankie Robertson wrote: > Yes, dropping down is a good thing. You'll never be able to do > everything with django's simple ORM. Raw SQL is a 'good thing', > honest. Once we get SQLAlchemy we can drop to that some of the time > but until then SQL is the way forward. Slightly OT, but... I'm curi

Re: ANN: Chesspark - A django based online chess community.

2006-10-20 Thread rp
nice! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more

Re: TagsField app and m2m bug

2006-10-20 Thread Ivan Sagalaev
Norbert wrote: > This is the culprit: > > tags/fields.py > 48: ids = [id for id in data if type(id) == int] > 49: strs = [id for id in data if type(id) != int] > 50: initial_tags = list(self.model.objects.filter(id__in=ids)) > > If ids is blank, the sql is 'IN ()' which is illegal in MySQL (5.0.

TagsField app and m2m bug

2006-10-20 Thread Norbert Wojtowicz
Hello, I tried out Ivan's tags app (http://softwaremaniacs.org/soft/tags/en/) and got the following error at different fairly unrelated tasks (edit object, render object in {{form.tags}}, etc). Error: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL s

Re: some problems that make my work hard or force me to use AntiPatterns

2006-10-20 Thread David Larlet
2006/10/20, Chad Simmons <[EMAIL PROTECTED]>: > > > RonnyPfannschmidt wrote: > > > 7. there is no framework to roll own admin applications, and the > > build-in admin is just for basic data management > > Ehm.. Django is the "framework to roll your own admin applications". > It's the same framewor

Re: Migrating from ASP.NET to Django?

2006-10-20 Thread Julio Nobrega
Sure there is hope. I haven't found any website that couldn't be made with Django. After all, it's about HTTP communication. There are even two websites that deal with price comparison in the wiki (http://code.djangoproject.com/wiki/DjangoPoweredSites): http://www.gutata.com/ and http://ni

Re: AbstractSearching and django.core.extensions?

2006-10-20 Thread [EMAIL PROTECTED]
sure here is is: - conception.concept.models: - from django.db import models LEVEL_CHOICES = ( ('A', 'Level A'), ('B', 'Level B'), ('C', 'Level C'), ) class Concept(models.Model): client = models.CharField(maxlength=50) campaign = model

Re: ManyToMany versus creating two one-to-many relationships.

2006-10-20 Thread Aidas Bendoraitis
You have to define table B as a model and to set it a class Admin. It is impossible to edit the intermediate table, created from standard ManyToManyField, as a separate model in Django.To sum up, you must have all tables A, B, and C, defined as different models. Good luck!Aidas Bendoraitis [aka Arc

Re: Combining Unique Columns

2006-10-20 Thread Chad Simmons
MerMer wrote: > I am aware that Unique=True can be used to ensure that a value is > unqiue within a particular column. See "unique together" http://www.djangoproject.com/documentation/model_api/#unique-together -- Chad Simmons --~--~-~--~~~---~--~~ You received

Re: some problems that make my work hard or force me to use AntiPatterns

2006-10-20 Thread [EMAIL PROTECTED]
RonnyPfannschmidt schrieb: > while developing with django i encountered some ugly problems make my > work very hard > > > 1. sessions lack a direct relation to user, as well as a last-view > attribute > > this makes extensions like inactivity-logout, and statistics of online > members and guests

Re: Combining Unique Columns

2006-10-20 Thread Ramiro Morales
On 10/20/06, MerMer <[EMAIL PROTECTED]> wrote: > > I am aware that Unique=True can be used to ensure that a value is > unqiue within a particular column. > > Is there any means to ensure that a combination of values from two > columns within a table are unique See http://www.djangoproject.com/do

Re: unique_together

2006-10-20 Thread RajeshD
Hi Seemant, > So, ideally, something like "Genesis 1:1-2" should be allowed exactly > once in the table. However, that doesn't seem to be the case. The > directive works with two (like book and chapter or from and to), but > not with more. Am I using it in a wrong way? No. You are using it co

Re: Django Hosting

2006-10-20 Thread Fredrik Lundh
Ian Holsman wrote: > what's anonymous about it ? relying on a twisting little maze of DNS records to figure out who you might be doing business with? I guess we have different standards... --~--~-~--~~~---~--~~ You received this message because you are sub

Re: getting max and min

2006-10-20 Thread zenx
thank you all! I will do it with raw SQL . thanks for the code. I hope SQLAlchemy will be implemented soon in django. thank you! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Combining Unique Columns

2006-10-20 Thread MerMer
I am aware that Unique=True can be used to ensure that a value is unqiue within a particular column. Is there any means to ensure that a combination of values from two columns within a table are unique If not, I presume that I would have to write a custom def and then run that via a Signal via

Re: ManyToMany versus creating two one-to-many relationships.

2006-10-20 Thread MerMer
Many thanks Aidas, I'm having a play around to see. As a follow-on do you know how I can make table B appear in the Admin - if I use a many-to-many reference directly from A to C instead. If I do this, I understand that Django will automatically create the join table, but how do I get it to d

Re: some problems that make my work hard or force me to use AntiPatterns

2006-10-20 Thread Chad Simmons
RonnyPfannschmidt wrote: > while developing with django i encountered some ugly problems make my > work very hard > > > 1. sessions lack a direct relation to user, as well as a last-view > attribute What would be a "good solution"? Having it be part of the standard session middleware? Ok. Go ahe

Re: Django Hosting

2006-10-20 Thread zenx
It's not UK based but I have hosted some projects in hub-hub.com and I am satisfied with them. It's not super cheap but I think it's ok. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Integration of globalization data in Django/TurboGears

2006-10-20 Thread GinTon
The project web is activated http://webda.python-hosting.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 f

some problems that make my work hard or force me to use AntiPatterns

2006-10-20 Thread RonnyPfannschmidt
while developing with django i encountered some ugly problems make my work very hard 1. sessions lack a direct relation to user, as well as a last-view attribute this makes extensions like inactivity-logout, and statistics of online members and guests unnecessary hard creating a extra table +

Re: (Third Attempt To Post)Complex Application Security Model

2006-10-20 Thread Jay Parlar
Since I saw my name (incorrectly spelled) show up in this thread, I'll throw my 2 cents in (That's CDN, now almost worth 2 cents US!) I'm using Chris Long's branch on a production site right now. It's nothing major, a volunteer organization with minimal needs, but for my limited uses, it is worki

Re: ManyToMany versus creating two one-to-many relationships.

2006-10-20 Thread Aidas Bendoraitis
Yes, you can.There are no problems except the fact, that B has to be created and edited as a separate model in the contributed administration and you won't be able to set C's for A, from within A with those select widgets. Although you can still set the administration so that you could edit B as in

ManyToMany versus creating two one-to-many relationships.

2006-10-20 Thread MerMer
Since a many-to-many relationship is effectively a join table of two 1-many relationships can you implement a many-to-many relationship like this in django like this? Any problems associated with this approach? class A class B foreignkey(A) foreignKey(C) class C MerMer --~--~---

Migrating from ASP.NET to Django?

2006-10-20 Thread Carlos Yoder
Hello folks, I have this idea in my head going for a lng time now. Since I already deployed my first Django app and everybody's happy (especially me), I'm getting excited about migrating my main project to Django. First of all, it's a not a small site, so planning is of the absolute essence

Re: Django Hosting

2006-10-20 Thread Ian Holsman
On 20/10/2006, at 7:49 PM, Fredrik Lundh wrote: > > "Guest007" wrote: > >> http://www.djangodomain.com/ > > ah, the warm and fuzzy feeling of a faceless web provider hiding > behind an anonymous > web contact form, and with a "terms of service" page copied word by > word from other > similar

Re: getting max and min

2006-10-20 Thread Frankie Robertson
On 20/10/06, DavidA <[EMAIL PROTECTED]> wrote: > > > Russell Keith-Magee wrote: > > On 10/19/06, zenx <[EMAIL PROTECTED]> wrote: > > > > > > I want to get the maximum and the minimum values of various numbers. Is > > > the following method the best way to do it? > > > > The most efficient way woul

Re: Django Hosting

2006-10-20 Thread Fredrik Lundh
"Guest007" wrote: > http://www.djangodomain.com/ ah, the warm and fuzzy feeling of a faceless web provider hiding behind an anonymous web contact form, and with a "terms of service" page copied word by word from other similar sites... --~--~-~--~~~---~--~

Re: Django color picker -- ColorField?

2006-10-20 Thread Frankie Robertson
On 15/10/06, inquis <[EMAIL PROTECTED]> wrote: > > Is there any interest in a Django field type that will accept and > validate a set of RGB color values? It could be represented in the > Django admin using a Javascript color picker. I'm interested in it as it might be something I'd use in a pla

Re: Template tags

2006-10-20 Thread Tool69
Thanks Zak, that solved the problem. --~--~-~--~~~---~--~~ 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 emai

Re: Diamanda Wiki support and some django tutorials :)

2006-10-20 Thread MerMer
Looks very interesting. Good to see some more information about deployment with other options. MerMer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

list_display_links

2006-10-20 Thread patrickk
while it´s fine to use __str__ within list_display, I get an error when using __str__ in list_display_links. list_display = ('contenttype', '__str__', 'position',) list_display_links = ('__str__',) list_filter = ('contenttype',) error is: "admin.list_filter" refers to '__str__', which isn't a

Re: Order of request - sessions processing ?

2006-10-20 Thread orestis
Ah, I tried to call the session middleware directly, but now I see that the render_to_response actually calls the tag processing code. So here is what I did: def save_session(request): session_key = request.session.session_key or Session.objects.get_new_session_key() Session.objects.save(

Re: Custom administration interfaces

2006-10-20 Thread orestis
I'm not sure about that, but I remember reading that to display checkboxes in the admin interface lists you have to do some hacking, this is not provided out of the box. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: Django Hosting

2006-10-20 Thread Guest007
÷ ÓÏÏÂÝÅÎÉÉ ÏÔ 19 ÏËÔÑÂÒÑ 2006 17:07 DuncanM ÎÁÐÉÓÁÌ(a): > I've looked through the hosting recommendations on the django site and > can't find any uk based django providers, could anyone suggest any? > > I'm also looking for reliable cheap django hosting (based anywhere) if > anyone has some sugge