Re: Django model -> DOT converter

2006-08-05 Thread limodou

On 8/5/06, Antonio Cavedoni <[EMAIL PROTECTED]> wrote:
>
> On 5 Aug 2006, at 3:40, Jeremy Dunck wrote:
> > On 8/4/06, Antonio Cavedoni <[EMAIL PROTECTED]> wrote:
> >> I have an initial, rather crude implementation of the Django model ->
> >> DOT (the Graphviz file format) converter.
> >
> > Related:
> > http://groups.google.com/group/django-users/browse_frm/thread/
> > bde9e0928973f14a/08d286888aa781f5?tvc=1=en#08d286888aa781f5
>
> Thanks for the pointer, Jeremy, I totally missed this one when it was
> posted. I merged some of Andrew Barilla's ideas in my code (like not
> having to call modelviz for every model, but rather on a per-app
> basis), but I think his own is more complete.
>
> For example, mine doesn't yet generate arrows that start from a model
> property and get to the related model box. I'm just connecting the
> two boxes blindly.
>
> Still, the way I see it, this should be more of a job for a batch
> script (maybe manage.py?) than for a Django app. That way the only
> thing that Django has to take care of is to generate the .dot files,
> then it's somebody else's job to take them and render them by
> importing in a desktop app like OmniGraffle o Graphviz itself and
> Django itself doesn't have the dependency of the graphviz codebase
> just for this nifty trick.
>
> > ...And I'm very close to having a graph generator for template
> > inheritance and load source.
>
> Cool, would be very nice to see it!
>
> Cheers.

A very cool tool. And a question:

It seems that it can not display OneToOne relationship.

-- 
I like python!
My Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: List all categories, list all objects within these categories

2006-08-05 Thread [EMAIL PROTECTED]

Oww... Todd, thank you too! At least both of you came up with an
identical solution :)

Cello


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



indirect ManyToMany relations between models

2006-08-05 Thread dummy

Hi all,

I have the following 3 Models:

class Company(models.Model):
name = models.CharField(maxlength=40)

class InfoType(models.Model):
type = models.CharField(maxlength=40)

class MetaObject(models.Model):
company = models.ManyToManyField(Company, null=True, blank=True)
type= models.ManyToManyField(InfoType)
title   = models.CharField(maxlength=60)

I want to select now all objects of InfoType for Company belonging indirectly 
together by MetaObject.

I have implemented this into Company:

class Company(models.Model):
...
def infotypes(self):
metaobjects = self.metaobject_set
if metaobjects.count() > 0:
return 
InfoType.objects.filter(metaobject__in=metaobjects.all()).distinct()


This solution will output the following SQL:

{'time': '0.042', 'sql': 'SELECT DISTINCT 
`core_infotype`.`id`,`core_infotype`.`type` FROM `core_infotype` LEFT OUTER 
JOIN `core_metaobject_type` AS `m2m_core_infotype__metaobject` ON 
`core_infotype`.`id` = `m2m_core_infotype__metaobject`.`infotype_id` WHERE 
(`m2m_core_infotype__metaobject`.`metaobject_id` IN 
(1,32,63,94,125,156,187,218,249,280,311,342,373,404,435,466,497,528,559,590,621,652,683,714,745,776,807,838,869,900,931,962,993,1024,
1055,1086,1117,1148,1179,1210,1241,1272,1303,1334,1365,1396,1427,1458,1489,1520,1551,1582,1613,1644,1675,1706,1737,1768,1799,1830,
1861,1892,1923,1954,1985,2016,2047,2078,2109,2140,2171,2202,2233,2264,2295,2326,2357,2388,2419,2450,2481,2512,2543,2574,2605,2636,
2667,2698,2729,2760,2791,2822,2853,2884,2915,2946,2977,3008,3039,3070,3101,3132,3163,3194,3225,3256,3287,3318,3349,3380,3411,3442,
3473,3504,3535,3566,3597,3628,3659,3690,3721,3752,3783,3814,3845,3876,3907,3938,3969,4000,4031,4062,4093,4124,4155,4186,4217,4248,
4279,4310,4341,4372,4403,4434,4465,4496,4527,4558,4589,4620,4651,4682,4713,4744,4775,4806,4837,4868,4899,4930,4961,4992,5023,5054,
5085,5116,5147,5178,5209,5240,5271,5302,5333,5364,5395,5426,5457,5488,5519,5550,5581,5612,5643,5674,5705,5736,5767,5798,5829,5860,
5891,5922,5953,5984,6015,6046,6077,6108,6139,6170,6201,6232,6263,6294,6325,6356,6387,6418,6449,6480,6511,6542,6573,6604,6635,,
6697,6728,6759,6790,6821,6852,6883,6914,6945,6976,7007,7038,7069,7100,7131,7162,7193,7224,7255,7286,7317,7348,7379,7410,7441,7472,
7503,7534,7565,7596,7627,7658,7689,7720,7751,7782,7813,7844,7875,7906,7937,7968,7999,8030,8061,8092,8123,8154,8185,8216,8247,8278,
8309,8340,8371,8402,8433,8464,8495,8526,8557,8588,8619,8650,8681,8712,8743,8774,8805,8836,8867,8898,8929,8960,8991,9022,9053,9084,
9115,9146,9177,9208,9239,9270,9301,9332,9363,9394,9425,9456,9487,9518,9549,9580,9611,9642,9673,9704,9735,9766,9797,9828,9859,9890,
9921,9952,9983,10014,10045,10076,10107,10138,10169,10200,10231,10262,10293,10324,10355,10386,10417,10448,10479,10510,10541,10572,
10603,10634,10665,10696,10727,10758,10789,10820,10851,10882,10913,10944,10975,11006,11037,11068,11099,11130,11161,11192,11223,
11254,11285,11316,11347,11378,11409,11440,11471,11502,11533,11564,11595,11626,11657,11688,11719,11750,11781,11812,11843,11874,
11905,11936,11967,11998,12029,12060,12091,12122,12153,12184,12215,12246,12277,12308,12339,12370,12401,12432,12463,12494,12525,
12556,12587,12618,12649,12680,12711,12742,12773,12804,12835,12866,12897,12928,12959,12990,13021,13052,13083,13114,13145,13176,
13207,13238,13269,13300,13331,13362,13393,13424,13455,13486,13517,13548,13579,13610,13641,13672,13703,13734,13765,13796,13827,
13858,13889,13920,13951,13982,14013,14044,14075,14106,14137,14168,14199,14230,14261,14292,14323,14354,14385,14416,14447,14478,
14509,14540,14571,14602,14633,14664,14695,14726,14757,14788,14819,14850,14881,14912,14943,14974,15005,15036,15067,15098,15129,
15160,15191,15222,15253,15284,15315,15346,15377,15408,15439,15470,15501,15532,15563,15594,15625,15656,15687,15718,15749,15780,
15811,15842,15873,15904,15935,15966,15997,16028,16059,16090,16121,16152,16183,16214,16245,16276,16307,16338,16369,16400,16431,
16462,16493,16524,16555,16586,16617,16648,16679,16710,16741,16772,16803,16834,16865,16896,16927,16958,16989,17020,17051,17082,
17113,17144,17175,17206,17237,17268,17299,17330,17361,17392,17423,17454,17485,17516,17547,17578,17609,17640,17671,17702,17733,
17764,17795,17826,17857,17888,17919,17950,17981,18012,18043,18074,18105,18136,18167,18198,18229,18260,18291,18322,18353,18384,
18415,18446,18477,18508,18539,18570,18601,18632,18663,18694,18725,18756,18787,18818,18849,18880,18911,18942,18973,19004,19035,
19066,19097,19128,19159,19190,19221,19252,19283,19314,19345,19376,19407,
19438,19469,19500,19531,19562,19593,19624,19655,19686,19717,19...

As you can see this is a little bit sub-optimal ;) and will be a performance 
issue if the list grows more and more.

Is there a better solution out in the world ?

Regards,
Dirk

-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*. Nur noch kurze Zeit!
"Feel free" mit GMX DSL: http://www.gmx.net/de/go/dsl


Re: get_for_model building bad SQL?

2006-08-05 Thread Jay Klehr

Malcom,  sorry about the reply, I use my email client to interact with 
google group and pressed reply so that it would use the right account to 
send from (since I'm not subscribed with my default account).  Won't 
happen again now that I know google groups is smarter than I though. ;)

I created a ticket:  http://code.djangoproject.com/ticket/2488

Thanks,

Jay

Malcolm Tredinnick wrote:
> Hi Jay,
>
> Please start a new thread for a new topic, rather than replying on an
> existing thread. Makes things easier to track both in threaded email
> clients and in the web view. Thanks. :-)
>
>   

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: List all categories, list all objects within these categories

2006-08-05 Thread Todd O'Bryan

In your view code, include { 'categories':BookCategory.objects.all 
() } in your context.

Then, in the template


{% for cat in categories %}
{{ cat }}

{% for book in cat.book_set.all %}
{{ book }}
{% endfor %}


{% endfor %}


This assumes you have the __str__() method of Book and BookCategory  
set to output something you're happy with. If you'd prefer, you can  
use {{ cat.name }} and {{ book.name }} (or a similar idea, depending  
on what the actual field is called in your model) instead.

Todd

On Aug 5, 2006, at 11:13 AM, [EMAIL PROTECTED] wrote:

>
> Hi,
>
> Using the models below, I want a single page to show:
>
> bookcategory1
>   book1
>   book2
> bookcategory2
>   book1
>   book2
>   ...
> bookcategory3
>   ...
> ...
>   ...
>
> ##
>
> # Models
>
> class BookCategory(models.Model):
>   ...
>
> class Book(models.Model):
>   ...
>   category = models.ForeignKey(BookCategory)
>   ...
>
> ##
>
> What would be the preferred way to do this?
> Can it be done without templatetags? How?
>
> If the solution must rely on templatetags, can you give me a short
> example of how this templatetag might look?
>
> Thanks very much!
>
> Best regards,
> Cello
>
>
> >


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: List all categories, list all objects within these categories

2006-08-05 Thread [EMAIL PROTECTED]

Hello Jonathan,

Thank you for your quick reply. Works fine!

Bye,
Cello


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: List all categories, list all objects within these categories

2006-08-05 Thread Jonathan Buchanan

[EMAIL PROTECTED] wrote:
> Hi,
> 
> Using the models below, I want a single page to show:
> 
> bookcategory1
>   book1
>   book2
> bookcategory2
>   book1
>   book2
>   ...
> bookcategory3
>   ...
> ...
>   ...
> 
> ##
> 
> # Models
> 
> class BookCategory(models.Model):
>   ...
> 
> class Book(models.Model):
>   ...
>   category = models.ForeignKey(BookCategory)
>   ...
> 
> ##
> 
> What would be the preferred way to do this?
> Can it be done without templatetags? How?
> 
> If the solution must rely on templatetags, can you give me a short
> example of how this templatetag might look?
> 
> Thanks very much!
> 
> Best regards,
> Cello

If you pass the complete list of BookCategories to your template as 
"categories":


{% for category in categories %}
   {{ category }}
   {% for book in category.book_set.all %}
   {{ book }}
   {% endfor %}
{% endfor %}


The .all may or may not be necessary - I don't have any code at hand to 
test this :)

If you add related_name="books" to the definition of the category field 
in your Books model, you could use {% for book in category.books.all %} 
in the inner loop.

See http://www.djangoproject.com/documentation/db_api/#related-objects

Jonathan.

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



List all categories, list all objects within these categories

2006-08-05 Thread [EMAIL PROTECTED]

Hi,

Using the models below, I want a single page to show:

bookcategory1
book1
book2
bookcategory2
book1
book2
...
bookcategory3
...
...
...

##

# Models

class BookCategory(models.Model):
...

class Book(models.Model):
...
category = models.ForeignKey(BookCategory)
...

##

What would be the preferred way to do this?
Can it be done without templatetags? How?

If the solution must rely on templatetags, can you give me a short
example of how this templatetag might look?

Thanks very much!

Best regards,
Cello


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: How would I do this with Djangol?

2006-08-05 Thread HBTaylor

I'm not sure about your models, but I assume it is something like the
following:

from django.db import models

class Holding(models.Model):
symbol = models.CharField(maxlength=10)

def __str__(self):
return self.symbol

def _get_latest_price(self):
return self.price_set.all()[0]

get_latest_price = property(_get_latest_price)

class Admin:
pass

class Price(models.Model):
holding = models.ForeignKey(Holding)
price = models.FloatField(max_digits=6,decimal_places=2)
pdate = models.DateField()

def __str__(self):
return "%s - %s - %s" %
(self.holding.symbol,self.pdate,self.price)

class Admin:
pass

class Meta:
ordering = ("-pdate",)

For it, I've added ordering to the Meta for Price, so it always returns
the prices in descending order of date. At that point, the
event_set.all()[0] for a given Holding will give its latest price. I
added a _get_latest_price() convenience method (and made it a property)
just for giggles, but that should allow you to do use something like
myholding.get_latest_price.price (as well as accessing the date) for a
holding of your choice.

Will that do the trick?

By the way, it seems like having the symbol in your Price model would
be redundant, since you can use myprice.holding.symbol to get the
symbol if you are listing (for example) all of the prices for a given
day.

H.B.


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Using custom forms with generic views

2006-08-05 Thread jeffmikels

I'm trying to create a site that has entries of different types and
tags that can link to any type of entry.

In my models, I have a

tags = models.ManyToManyField(Tag, blank=True,
filter_interface=models.HORIZONTAL, related_name="tags")

when using generic views and form.tags, I get a select box; however, i
would rather have a single text box into which I can type a string of
comma separated tags, and then have them parsed behind the scenes. Can
I still use generic views, or do I have to roll my own view?


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Invalid character error using Oracle backed

2006-08-05 Thread David

Django-0.95, with Oracle backend patch (latest: 3496?) applied.
Python 2.4 on Linux
Oracle XE and Oracle 10gR2

When I try to run syncdb using the Oracle backend, I reliably get the
following error (last part of traceback only, let me know if I should
post the whole traceback):

  File "django/db/backends/oracle/base.py", line 70, in execute
return Database.Cursor.execute(self, query, params)
cx_Oracle.DatabaseError: ORA-00911: invalid character

I get this error whether I configure to use an Oracle XE (10g) instance
or Oracle 10gR2 instance. If I do a "sqlall" and run the resulting file
using sqlplus, I don't get this error. (I DO get some
identifier-too-long errors, but if I edit the output of sqlall, those
go away.)

The main question is: How can I get syncdb to work without tracing
back?

A second question: What are my options with respect to long
identifiers? So far, it's just in the constraint names. For example:

ALTER TABLE trips_aircraft ADD CONSTRAINT
type_id_referencing_trips_actype_id FOREIGN KEY (type_id) REFERENCES
trips_actype (id);

The constraint name (optional in Oracle) tries to be
type_id_referencing_trips_actype_id but Oracle has a maximum allowed
length of 30 characters.


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: How would I do this with Djangol?

2006-08-05 Thread John Matthew
Thanks Chris,I looked at that but it only gives me one record.  What i need is the last price for each stock.  Maybe im using the latest() function wrong?ThanksJohn
On 8/4/06, Chris Long wrote:This might help:
http://www.djangoproject.com/documentation/db_api/#latest-field-name-noneChris

--~--~-~--~~~---~--~~
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 options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Django covered in podcast with Guido

2006-08-05 Thread Simon Willison

http://www.twit.tv/floss11

Django gets some good discussion about 50 minutes in.


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: How to user django upload file ?

2006-08-05 Thread Gabriel Puliatti

On 8/5/06, Zheng JinYuan <[EMAIL PROTECTED]> wrote:
>
> Can not find document in django site about how to upload file ? Any tips ?
>

I did that a couple of days ago.

http://code.google.com/p/arrrt

Get the code, and look for the functions for uploading in views.py.


-- 
Wagner's music is better than it sounds. -- Mark Twain

Gabriel Puliatti
predius.org

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: File upload and custom manipulator

2006-08-05 Thread didier Belot

2006/8/5, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> I had problems with file uploading time ago and I found this post
>
> http://groups.google.com/group/django-users/browse_thread/thread/d83259c6bdd0151f/3880fdebcef9a367?lnk=gst=uploading+images=5#3880fdebcef9a367
>
> It helped me so much. And I wonder it could help you.
Thanks for the link.


> Notice the atributes of the form in the template, specially
> enctype="multipart/form-data"
>
> Also note that the "real" content of the file is at
>
>  data = request.FILES[ 'file' ][ 'content' ]

Yes. The main point is that my form and view works great with the
automatic AddManipulator, but I want to make it working with a custom
manipulator.

Anyway, i'm currently trying to understand the AutomaticManipulator
code, where certainly is the solution ;-)

Thanks again.
-- 
didier

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django model -> DOT converter

2006-08-05 Thread Antonio Cavedoni

On 5 Aug 2006, at 3:40, Jeremy Dunck wrote:
> On 8/4/06, Antonio Cavedoni <[EMAIL PROTECTED]> wrote:
>> I have an initial, rather crude implementation of the Django model ->
>> DOT (the Graphviz file format) converter.
>
> Related:
> http://groups.google.com/group/django-users/browse_frm/thread/ 
> bde9e0928973f14a/08d286888aa781f5?tvc=1=en#08d286888aa781f5

Thanks for the pointer, Jeremy, I totally missed this one when it was  
posted. I merged some of Andrew Barilla’s ideas in my code (like not  
having to call modelviz for every model, but rather on a per-app  
basis), but I think his own is more complete.

For example, mine doesn’t yet generate arrows that start from a model  
property and get to the related model box. I’m just connecting the  
two boxes blindly.

Still, the way I see it, this should be more of a job for a batch  
script (maybe manage.py?) than for a Django app. That way the only  
thing that Django has to take care of is to generate the .dot files,  
then it’s somebody else’s job to take them and render them by  
importing in a desktop app like OmniGraffle o Graphviz itself and  
Django itself doesn’t have the dependency of the graphviz codebase  
just for this nifty trick.

> ...And I'm very close to having a graph generator for template  
> inheritance and load source.

Cool, would be very nice to see it!

Cheers.
-- 
Antonio



--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django model -> DOT converter

2006-08-05 Thread Antonio Cavedoni

On 5 Aug 2006, at 2:44, Malcolm Tredinnick wrote:
> That's a lot of circles! :-)

Hehe, I told you it was crude! ;-)

> If you weren't aware of them, you might want to have a look at the  
> "record" style for Nodes in graphviz. They are useful for  
> displaying things like class diagrams or database tables. It might  
> make it easier to differentiate between your models and the fields  
> within the models.

Thanks Malcolm, I looked them up and now the modelviz uses the  
“record” style for models.

New code and examples:

  http://code.djangoproject.com/wiki/DjangoGraphviz

Cheers!
-- 
Antonio





--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Internationalization and HTTP headers.

2006-08-05 Thread Poromenos

Never mind, I hadn't installed the Locale middleware, apparently it's
used for HTTP header detection as well as manual language override.


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



multiple choices in model

2006-08-05 Thread Michael
Hello,From dajngo documentaytion:
A choices list looks like this:
YEAR_IN_SCHOOL_CHOICES = (('FR', 'Freshman'),('SO', 'Sophomore'),('JR', 'Junior'),('SR', 'Senior'),('GR', 'Graduate'),)Is it possible to have field with multiple choices in model like 
year=models.CharField(maxlength=2, multiplechoices=YEAR_IN_SCHOOL_CHOICES
)?The reason for that I have to write web front end for legacy application and they store multiple choices in DB as text field. Choices separated by new line.ManyToManyField not suitable for that case.
-- --Michael

--~--~-~--~~~---~--~~
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 options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Internationalization and HTTP headers.

2006-08-05 Thread Poromenos

I have translated my site from English to Greek (el) and I have left
english as the fallback language (I haven't created an english .po
file), but the HTTP-header language selection doesn't work for me. If I
set the installation language it works fine, but I can't get it to
select content via the HTTP header.

Is there anything I should do/anything I'm doing wrong?


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django model -> DOT converter

2006-08-05 Thread Antonio Cavedoni

On 5 Aug 2006, at 3:05, Russell Keith-Magee wrote:
> Nifty! If I may make some comments (and this is intended as  
> constructive criticism, not an attempt to belittle your work)

Well, I was just procrastinating my university thesis anyway…

> - The graphs that are drawn are accurate, but don't differentate  
> between attributes and models

Fixed!

> - The data type of Attribute data type is not represented (but  
> would be helpful)

Fixed!!

> - The arrows describe both relationships between models and  
> relationships with attributes

Fixed!!!

> - Arrow direction doesn't describe relationship direction

Almost fixed ;-)

Thanks for the feedback and the comments, keep them coming!

Cheers.
-- 
Antonio




--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: get_for_model building bad SQL?

2006-08-05 Thread Malcolm Tredinnick

Hi Jay,

Please start a new thread for a new topic, rather than replying on an
existing thread. Makes things easier to track both in threaded email
clients and in the web view. Thanks. :-)

On Fri, 2006-08-04 at 23:06 -0600, Jay Klehr wrote:
[...]
> When I run this line:
> 
> ctype = ContentType.objects.get_for_model(quartz)
> 
> 
> I get this SQL built:
> 
> SELECT 
> `django_content_type`.`id`,`django_content_type`.`name`,`django_content_type`.`app_label`,`django_content_type`.`model`
>  
> FROM `django_content_type` WHERE (`django_content_type`.`model` = quartz 
> AND `django_content_type`.`app_label` = myapp)

Looks like a bug. I can replicate this with other database backends as
well. Can you file a ticket for it so it doesn't get lost, please?
Shouldn't be too hard to fix.

Thanks,
Malcolm


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django model -> DOT converter

2006-08-05 Thread [EMAIL PROTECTED]

Nice work! & I'd love to see this in contrib somewhere.

--Simon


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: How would I do this with Djangol?

2006-08-05 Thread Chris Long

This might help:

http://www.djangoproject.com/documentation/db_api/#latest-field-name-none

Chris


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---