Re: problem getting the admin to work (in tutorial)

2006-03-09 Thread patrick k

try to set the collations of your database manually (e.g. using cocoamysql
on osx), using "utf 8".

hope that helps,
patrick



> 
> i have been running through the tutorial and everything has been
> running fine.. (running macosx)..
> 
> i found my first problem that i have not been able to figure out..
> 
> i am trying to create a superuser, and i am getting the following error
> (any help on this is appreciated... thanks!):
> 
> Username (only letters, digits and underscores): sergio
> Traceback (most recent call last):
> File "manage.py", line 11, in ?
>   execute_manager(settings)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/management.py",
> line 1051, in execute_manager
>   execute_from_command_line(action_mapping)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/management.py",
> line 969, in execute_from_command_line
>   action_mapping[action]()
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/management.py",
> line 529, in createsuperuser
>   users.get_object(username__exact=username)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/utils/functional.py",
> line 3, in _curried
>   return args[0](*(args[1:]+moreargs), **dict(kwargs.items() +
> morekwargs.items()))
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/meta/__init__.py",
> line 1356, in function_get_object
>   obj_list = function_get_list(opts, klass, **kwargs)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/meta/__init__.py",
> line 1396, in function_get_list
>   return list(function_get_iterator(opts, klass, **kwargs))
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/meta/__init__.py",
> line 1379, in function_get_iterator
>   cursor.execute("SELECT " + (kwargs.get('distinct') and "DISTINCT "
> or "") + ",".join(select) + sql, params)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/db/base.py",
> line 10, in execute
>   result = self.cursor.execute(sql, params)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /django/core/db/backends/mysql.py",
> line 32, in execute
>   return self.cursor.execute(sql, params)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /MySQLdb/cursors.py",
> line 137, in execute
>   self.errorhandler(self, exc, value)
> File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
> /MySQLdb/connections.py",
> line 33, in defaulterrorhandler
>   raise errorclass, errorvalue
> _mysql_exceptions.OperationalError: (1267, "Illegal mix of collations
> (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for
> operation '='")
> 
> 
> 


--~--~-~--~~~---~--~~
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: stringformat in template

2006-03-09 Thread Rob Slotboom

Dear Geert,

I entered {{ total_amount|stringformat:".2f" }} and it realy worked :-)

Actualy I red the STRINGFORMAT docu but I didn't get the clue. Now I
do...

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



problem getting the admin to work (in tutorial)

2006-03-09 Thread [EMAIL PROTECTED]

i have been running through the tutorial and everything has been
running fine.. (running macosx)..

i found my first problem that i have not been able to figure out..

i am trying to create a superuser, and i am getting the following error
(any help on this is appreciated... thanks!):

Username (only letters, digits and underscores): sergio
Traceback (most recent call last):
  File "manage.py", line 11, in ?
execute_manager(settings)
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management.py",
line 1051, in execute_manager
execute_from_command_line(action_mapping)
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management.py",
line 969, in execute_from_command_line
action_mapping[action]()
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management.py",
line 529, in createsuperuser
users.get_object(username__exact=username)
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/utils/functional.py",
line 3, in _curried
return args[0](*(args[1:]+moreargs), **dict(kwargs.items() +
morekwargs.items()))
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/meta/__init__.py",
line 1356, in function_get_object
obj_list = function_get_list(opts, klass, **kwargs)
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/meta/__init__.py",
line 1396, in function_get_list
return list(function_get_iterator(opts, klass, **kwargs))
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/meta/__init__.py",
line 1379, in function_get_iterator
cursor.execute("SELECT " + (kwargs.get('distinct') and "DISTINCT "
or "") + ",".join(select) + sql, params)
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/db/base.py",
line 10, in execute
result = self.cursor.execute(sql, params)
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/db/backends/mysql.py",
line 32, in execute
return self.cursor.execute(sql, params)
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/MySQLdb/cursors.py",
line 137, in execute
self.errorhandler(self, exc, value)
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/MySQLdb/connections.py",
line 33, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1267, "Illegal mix of collations
(latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for
operation '='")


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

2006-03-09 Thread Gacha

If I write:

SetHandler mod_python
PythonHandler django.core.handlers.modpython
PythonPath "['/home/gacha/poll'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE myproject.settings
PythonDebug On


then I get error: EnvironmentError: Could not import
DJANGO_SETTINGS_MODULE

But when I change:
PythonPath "['/home/gacha/poll'] + sys.path"
to:
PythonPath "['/home/gacha/poll']"

then I get this:

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 287,
in HandlerDispatch
log=debug)

File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 454,
in import_module
f, p, d = imp.find_module(parts[i], path)

ImportError: No module named django


How to get this to work?


--~--~-~--~~~---~--~~
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: why is my view for a submitted form not getting a POST?

2006-03-09 Thread Ivan Sagalaev

Amit Upadhyay wrote:

> . is django way of handling form is there is any, makes it more 
> "portable", one less thing to change when you are relocating your 
> pages on your site, and your template need not know the actual page 
> where the form would be deployed.

In fact tutorial could easily use action="./" to avoid confusion.

--~--~-~--~~~---~--~~
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: specifying a model with a field computed from other fields

2006-03-09 Thread Amit Upadhyay
On 3/10/06, Gavin <[EMAIL PROTECTED]> wrote:
I want expenditures to be a ForeignKey, but I want to create it basedon values entered (num_units * unit_cost, account).My question: How can I create a foreign key based on the values enteredfor other fields?
_pre_save() is a function that if you define for your model, will be called just before the model is saved in the database. You can put your logic there. -- Amit Upadhyay
Blog: http://www.rootshell.be/~upadhyay+91-9867-359-701
--~--~-~--~~~---~--~~
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: specifying a model with a field computed from other fields

2006-03-09 Thread Gavin

thanks for the refs, i'll get reading :)


--~--~-~--~~~---~--~~
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: specifying a model with a field computed from other fields

2006-03-09 Thread Russell Keith-Magee
On 3/10/06, Gavin <[EMAIL PROTECTED]> wrote:
I can compute these values by inspecting both the Orders and Reimbursetables. Is that the best way?Rule 1 of database design - Don't replicate data. Ever. You need to have a serious look at your requirements, and make sure that any given datum has one, and only one representation in the table. If you're looking for some pointers on the sort of representations you should be striving for, try searching for "Third Normal Form" -  
http://en.wikipedia.org/wiki/Third_normal_form is not a bad starting point.In your case, I would be asking questions like: - Will the expenditure account always be the same as the Reimbursement account? If so, don't keep the account reference twice.
- Will the reimburse_for amount always equal price*count on the related expenditure? If so, don't keep the amount separately- Can a single order be part of multiple expenditures? If not, why does Order relate 1-n with Expenditure?
An entity-relationship model might help you sort out these details:http://en.wikipedia.org/wiki/Entity-relationship_modelOnce you have your model sorted out, you can use SQL to pull data from multiple tables, and you can use SQL to perform calcuations based upon data from multiple tables. 
for example:SELECT tableA.field1, (tableA.field1 * tableB.field2) AS total FROM tableA INNER JOIN tableB ON tableA.join_id = tableB.idDjango provides access to this sort of thing using a combination of select, where and tables clauses. Select allows you to add additional attributes to the objects you are retrieving; tables allows you to force other sources of data into a query, and where allows you to add additional constraints (such as a join constrain). The previous SQL query would end up something like:
>>> tableAs.get_list(select={'total', 'tableA.field1 * tableB.field2'}, tables='tableB', where='tableA.join_id=tableB.id')[obj1, obj2,...]Then, to look at your total:>>> obj1.total
42However - the first step is to get your data model right.Russ Magee %-)

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


Can I pass a python iterator to a template?

2006-03-09 Thread Mike Kent

I want to display a grid view of some of the data from a large
database.  I want to manipulate each data row prior to displaying it,
so I can't just let the template code do the database read work.  Since
the dataset is potentially large, what I want to do is write an
iterator which will read the model's data (using get_iterator()',
manipulate the data rows, and then yield a dictionary (what Django
seems to call a 'context') for each row.  Then I would pass my iterator
in to the template, and use a 'for' loop in the template to get each
row of the data and fill in the data values.

When I actually try this, I get a traceback ending with:

/home/mike/Work/projects/django/trunk/django/core/template/defaulttags.py
in render

  83. context.push()
  84. try:
  85. values = self.sequence.resolve(context)
  86. except VariableDoesNotExist:
  87. values = []
  88. if values is None:
  89. values = []

  90. len_values = len(values)

So, am I completely off base here?  Is what I want to do not possible,
or is there another way I can tackle this?

Thanks,
Mike Kent


--~--~-~--~~~---~--~~
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: LDAP _without_ built-in Django user authentication

2006-03-09 Thread Matthew Flanagan

On 3/10/06, Matt <[EMAIL PROTECTED]> wrote:
>
> OK, I was confused about why Django still needs usernames in its
> database even though LDAP is the new authentication method.  I thought
> it would require authenticating via LDAP, then checking for the user
> _and_ pass in Django's database.  I didn't realize that I will only
> have to copy the username (not the password), and that authentication
> does not need to occur a second time against the Django user list.  It
> looks like I'll be able to convince the man in charge that Django is a
> great framework choice for our needs.
>
> Thanks to all for the feedback!
>
>

I'm using the method mentioned in the link to do LDAP auth.

http://www.carcosa.net/jason/blog/computing/django/authentication-2005-12-05-13-25.html

A dummy django user must exist, with or without your app's django
permissions or groups assigned, before LDAP is looked up. In my
environment I didn't want all LDAP users to be able to login to the
application, only thosee userrs that had had been explicitly created
in the django user db.

So the flow is this:

If user in django userdb:
  check user password via ldap (or whatever) auth method.

I have written a very simple pluggable auth module that does all of
this and has support for LDAP.

I'll put it up in the django wiki next week when i get back to work if
anyone is interested. It looks like the MultiAuth stuff will supersede
this anyway in the near future.

regards

matthew

--~--~-~--~~~---~--~~
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: specifying a model with a field computed from other fields

2006-03-09 Thread Gavin

You're absolutely right, I could simply compute those values as
required. I also confess to not having very much dbase design
experience so your commentary is valuable. My question was also partly
motivated by the documentation on the _pre_save method, which seemed to
suggest it might serve my purpose.

My motivation here is there are tables other than Reimburse that will
do very similar things, but require some unique attributes. So I was
looking for a way to assess expenditures in one place, rather than
inspecting multiple tables. Of course I realise common things like
count and price belong in expenditures, bit I'm still faced with the
issue of needing to associate that expenditure with an Account. And
that means if I want to determine the status of an account I need to
look at all tables in which expenditures are being made.

Modifying Russell's model, I'll add a Order table and put price and
count into Expenditure:

-- model --

class Account(Model):
   owner = CharField()

class Order(Model):
catalogid = IntegerField()
vendor = CharField()
account = ForeignKey(Account)
expenditure = ForeignKey(Expenditure) # diff

class Reimburse(Model):
account = ForeignKey(Account)
reimburse_for = CharField()
expenditure = ForeignKey(Expenditure) # diff

class Expenditure(Model):
price = FloatField()
count = IntegerField()
account = ForeignKey(Account)

I can compute these values by inspecting both the Orders and Reimburse
tables. Is that the best way?

Comments appreciated.


--~--~-~--~~~---~--~~
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: specifying a model with a field computed from other fields

2006-03-09 Thread Malcolm Tredinnick

On Thu, 2006-03-09 at 17:20 -0800, Gavin wrote:
> thanks for the reply, let me modify your example.
> 
> class Account(Model):
>owner = CharField()
> 
> class Reimburse(Model):
> price = FloatField()
> count = IntegerField()
> account = ForeignKey(Account)
> expenditure = ForeignKey(Expenditure) # diff
> 
> class Expenditure(Model):
> cost = FloatField()
> account = ForeignKey(Account)
> 
> the only diff is Reimburse now has a field called expenditure.
> 
> so how would the creation code work now?

One concern I have had with your question is *why* you want to make this
a foreign key? Since expenditure is duplicating information that is
already available, it is slightly bad database practice to include it in
there (your model is not in any "normal form" in the nomenclature).

Is there some reason you need a foreign key here, rather than just a
separate value? After all, if you were doing this as a pure database
problem (rather than through Django), it would be recommended that you
never store expenditure, but just compute it from the raw values when
needed (which is pretty fast, since it involves a join on one field).

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: specifying a model with a field computed from other fields

2006-03-09 Thread Gavin

thanks for the reply, let me modify your example.

class Account(Model):
   owner = CharField()

class Reimburse(Model):
price = FloatField()
count = IntegerField()
account = ForeignKey(Account)
expenditure = ForeignKey(Expenditure) # diff

class Expenditure(Model):
cost = FloatField()
account = ForeignKey(Account)

the only diff is Reimburse now has a field called expenditure.

so how would the creation code work now?


--~--~-~--~~~---~--~~
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: specifying a model with a field computed from other fields

2006-03-09 Thread Russell Keith-Magee
On 3/10/06, Gavin <[EMAIL PROTECTED]> wrote:
My question: How can I create a foreign key based on the values enteredfor other fields? I can't help but feel that I'm missing some subtlety in your requirements, but here's a rough example (exact field details, namespaces etc ommitted for clarity):
*** MODELS.PYclass Account(Model):   owner = CharField()class Reimburse(Model):    price = FloatField()    count = IntegerField()    account = ForeignKey(Account)class Expenditure(Model):
    cost = FloatField()    account = ForeignKey(Account) *** CREATION CODEa1 = Account(name='Russ')a1.save()r1 = Reimburse(price='1.99', count=3, account=a1)r1.save()e1 = Expenditure(cost=(
r1.price*r1.count), account=a1)e1.save()or, if you want to factor out the common bits:def createExpenditure(r)    e = Expenditure(cost=(r.price*r.cost), account=r.account)    e.save()    return e
e1 = createExpenditure(r1)Is that what you were looking for? Hope this helps,Russ Magee %-)

--~--~-~--~~~---~--~~
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: My first troubles after downloading and installation

2006-03-09 Thread Russell Keith-Magee
On 3/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]
> wrote:"python manage.py runserver command" works, but "python 
manage.py init"doesn't work - it fails with error message "The database couldn't beinitialized. an integer required". I am sure I set up database settingscorrectly :-/.Suggest me please where I am wrong?
I don't know for certain if this is your problem, but I seem to recall a recent discussion that revealed that mysql doesn't like the 'string' form for port numbers. Try taking the quotes off the DATABASE_PORT definition (
i.e., DATABASE_PORT=3306, not DATABASE_PORT='3306')Hope that helps,Russ Magee %-)

--~--~-~--~~~---~--~~
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: My first troubles after downloading and installation

2006-03-09 Thread [EMAIL PROTECTED]

This trouble was gotten by trying to run first tutorial.


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



My first troubles after downloading and installation

2006-03-09 Thread [EMAIL PROTECTED]

I got an archive and installed Django on my Windows machine. I set up
settings to

DATABASE_ENGINE = 'mysql' # 'postgresql', 'mysql', 'sqlite3' or
'ado_mssql'.
DATABASE_NAME = 'django' # Or path to database file if
using sqlite3.
DATABASE_USER = 'root' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = 'localhost' # Set to empty string for
localhost. Not used with sqlite3.
DATABASE_PORT = '3306' # Set to empty string for default.
Not used with sqlite3.


"python manage.py runserver command" works, but "python manage.py init"
doesn't work - it fails with error message "The database couldn't be
initialized. an integer required". I am sure I set up database settings
correctly :-/.

Suggest me please where I am wrong?

TIA


--~--~-~--~~~---~--~~
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: First topic

2006-03-09 Thread Joseph Kocherhans

On 3/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

> Could talk how many web sites (at least, some famous) are done with
> Django?

There's a list on Django's homepage http://www.djangoproject.com/
And also on the wiki http://code.djangoproject.com/wiki/DjangoPoweredSites

Joseph

--~--~-~--~~~---~--~~
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: LDAP _without_ built-in Django user authentication

2006-03-09 Thread Matt

OK, I was confused about why Django still needs usernames in its
database even though LDAP is the new authentication method.  I thought
it would require authenticating via LDAP, then checking for the user
_and_ pass in Django's database.  I didn't realize that I will only
have to copy the username (not the password), and that authentication
does not need to occur a second time against the Django user list.  It
looks like I'll be able to convince the man in charge that Django is a
great framework choice for our needs.

Thanks to all for the feedback!


--~--~-~--~~~---~--~~
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: specifying a model with a field computed from other fields

2006-03-09 Thread Gavin

Thanks for your response and sorry about the cryptic nature of the
query.

In my model I have a table class (Reimburse) that records an items'
unit price, the number of items bought and an account (a ForeignKey)
from which the cost (unit price * number of items) will be recorded
against. I want to be able to record this transaction in an
expenditures table - recording the cost and account.

I want expenditures to be a ForeignKey, but I want to create it based
on values entered (num_units * unit_cost, account).

My question: How can I create a foreign key based on the values entered
for other fields?

I hope that is clearer.

cheers,

g


--~--~-~--~~~---~--~~
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: First topic

2006-03-09 Thread [EMAIL PROTECTED]

Sorry my English please, I'd like to say "could you tell" :)


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



First topic

2006-03-09 Thread [EMAIL PROTECTED]

Hello, there!

Let's greet you and let me my Django questions :).

Could talk how many web sites (at least, some famous) are done with
Django?

Thanks in advance,
Nicolay


--~--~-~--~~~---~--~~
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: models and forward declarations

2006-03-09 Thread Michael Radziej

Just found out that ForeignKeyField also accepts the model *name* 
instead of the model itself. Might solve the problem if this really 
works out :-)

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



Re: CSS issues

2006-03-09 Thread Steven Armstrong

On 03/09/06 11:47, tomass wrote:
> Hi Folks,
> 
> I've copied the admin css to be used for my views, but I've added in
> this custom section which is a modified version of the FILTER COLUMN
> from changelist.css:
> 
> /*  FILTER COLUMN  (CUSTOM VERSION) */
> 
> #changelist-filter-custom {position:absolute; top:0; right:0;
> width:180px; border-left:1px solid #ddd; background:#efefef; margin:0;}
> #changelist-filter-custom h2 {font-size:11px; padding:2px 5px;
> border-bottom:1px solid #ddd;}
> #changelist-filter-custom h3 {font-size:12px; margin-bottom:0;}
> #changelist-filter-custom ul
> {padding-left:0;margin-left:10px;_margin-right:-10px;}
> #changelist-filter-custom li {list-style-type:none; margin-left:0;
> padding-left:0;}
> #changelist-filter-custom a {color:#999;}
> #changelist-filter-custom a:hover {color:#036;}
> #changelist-filter-custom li.selected {border-left:5px solid #ccc;
> padding-left:5px;margin-left:-10px;}
> #changelist-filter-custom li.selected a {color:#5b80b2 !important;}
> 
> Basically what I've changed is the width in the first item (from 160px
> to 180px, as well as removing the z-index so that a custom calendar
> item pops up okay. Problem now is best illustrated with a picture:
> http://www.greenleaftech.net/members/mthaddon/django_css
> As you can see I have some trailing non-aligned part of the filtered
> list, and the last column of the table gets run into the filtered list
> at the top.
> 
> Can anyone help out with some css magic?


Search for the following rule in the file /media/css/changelists.css:

.change-list .filtered table, .change-list .filtered .paginator, 
.filtered #toolbar, .filtered div.xfull { margin-right:160px !important; 
width:auto !important; }

and change the margin-right to 180px. It's the sixt rule from the top in 
  the unmodified css file.


To get the changelist columns background to also be 180px from top to 
bottom you may have to make the following image 20px wider:
/media/img/admin/changelist-bg.gif

Don't know if that's all that needs changing. But it should get you started.

cheers
Steven



--~--~-~--~~~---~--~~
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: models and forward declarations

2006-03-09 Thread Michael Radziej

Rock schrieb:
> Search for "forward reference" in this group. (Basically you cleverly
> locate your import statement inside a function call.)

I found your thread at:

http://groups.google.com/group/django-users/browse_thread/thread/71fc72ab1f547d3/4d0dbfdfd9dc8a05?q=%22forward+references%22=2#4d0dbfdfd9dc8a05


No, unfortunately, this doesn't work within the class itself but only 
within a def.

I tried, just to make sure, this:

class Person(models.Model):
 from django_pop.email_admin.models import Ipkunde
 ...
 uremip = models.ForeignKey(Ipkunde, db_column='ipkunde')

class Ipkunde(models.Model):
 ...
 owner = models.ForeignKey(Owner, db_column='person')


Result:

Traceback (most recent call last):
   File "", line 1, in ?
   File "/home/mir/src/django_pop/../django_pop/email_admin/models.py", 
line 663, in ?
 class Person(models.Model):
   File "/home/mir/src/django_pop/../django_pop/email_admin/models.py", 
line 664, in Person
 from django_pop.email_admin.models import Ipkunde
ImportError: cannot import name Ipkunde


There's also another thread, about my problem, at

http://groups.google.com/group/django-users/browse_thread/thread/24a996f32de9c112/35e4a288a7337db9#35e4a288a7337db9

but there's only someone else stating the same problem and no solution :-(

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



Re: LDAP _without_ built-in Django user authentication

2006-03-09 Thread ChaosKCW

>Another issue that would create problems is
>adding users to LDAP directly -- Django wouldn't know about those users

Yes, but you create the user in django on login attempts to django
sites.

If LDAP auth successfukl:
  search user DB
  if not found: 
 add usert to db based on ldap pertmissions


--~--~-~--~~~---~--~~
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: models and forward declarations

2006-03-09 Thread Rock

Search for "forward reference" in this group. (Basically you cleverly
locate your import statement inside a function call.)


--~--~-~--~~~---~--~~
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: LDAP _without_ built-in Django user authentication

2006-03-09 Thread Matt

Sure that would work, but it sounds like a lot of work, and it's
duplicating a lot of data.  Another issue that would create problems is
adding users to LDAP directly -- Django wouldn't know about those users.


--~--~-~--~~~---~--~~
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: __init__.py use for ?

2006-03-09 Thread Eugene Lazutkin

okl wrote:
> 
> im new to python web framework, may i know whats the purpose of the
> file?

You can find all gory details in Python tutorial: 
http://docs.python.org/tut/node8.html#SECTION00840

I suggest to read the whole tutorial --- it reasonably small and gives a 
very good overview of the language.

Thanks,

Eugene


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



__init__.py use for ?

2006-03-09 Thread okl

hi there,

im new to python web framework, may i know whats the purpose of the
file?

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: [0.91] Model, subclassing, accessing superclass ?

2006-03-09 Thread bruno desthuilliers

Laurent RAHUEL wrote:
> Ooops,
> 
> It should be :
> 
> class Derived(Parent):
> 
> def _pre_save(self):
> do_some_other_things_here
> self.my_method()
> 
> Indentation problem ;-)

Thanks Laurent, but there was a typo in my original post !-)

It should have been:

class Parent(meta.Model):
  ...
  def my_method(self):
do_some_thing_here

class Derived(Parent):
  
  def my_method(self):
do_some_other_things_here
try:
  Parent.my_method()
except NameError:
  try:
parents.Parent.my_method()
  except NameError:
print "this (hum) 'magic' mumbo-jumbo is a royal PITA and "
  " sucks big time"
print "(too bad 0.92 is not released yet)"


-- 
bruno desthuilliers
développeur
[EMAIL PROTECTED]
http://www.modulix.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



models and forward declarations

2006-03-09 Thread Michael Radziej

Hi,

I try to throw django on an existing database. Unfortunately, there are 
cyclic foreign key dependencies between tables, and I'm looking for a 
way to express this in the model. (I use the magic-removal branch from cvs).

Is there a way? Something like

class Bah(Models.model):
...

class Igitt(Models.model):
bah = Models.ForeignKeyField(Bah)
...

Bah.igitt = Models.ForeignKeyField(Igitt)

?

Any suggestions welcome ...

I'm also interested whether anyone has tried to use an existing database 
with Django.

Best regards,

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



Re: why is my view for a submitted form not getting a POST?

2006-03-09 Thread Amit Upadhyay
On 3/9/06, Glenn Tenney <[EMAIL PROTECTED]> wrote:
see http://www.djangoproject.com/documentation/forms/ in the finishedversion of the "create_form" template it uses "action="" with no
trailing slash.A . means the current page, and given the page was generated by django, which always adds a / to all page URLs its gauranteed that current page will end with a /. . is django way of handling form is there is any, makes it more "portable", one less thing to change when you are relocating your pages on your site, and your template need not know the actual page where the form would be deployed. 
Django facilitates these things as best practices, you are completely free to follow whatever your requirements tell you. Its usually recommended to serve the form in the GET request and handle it in POST request on the same url. 
-- Amit UpadhyayBlog: http://www.rootshell.be/~upadhyay+91-9867-359-701
--~--~-~--~~~---~--~~
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: LDAP _without_ built-in Django user authentication

2006-03-09 Thread Matt

If it was my decision I'd simply use Django's authentication.
Unfortunately it's my supervisor's decision, and he wants me to use
LDAP _exclusively_ so that's what I have to do.

I don't know much about LDAP, but from what I understand users can be
grouped based on their level of access.  For example, if John Doe has a
new user account on our LDAP server, then he would be in the catch-all
Employee group.  However, to gain access to the web app he would need
to be the in DjangoUser group (or whatever).  Thus, even though he can
be authenticated by LDAP, he wouldn't have the necessary group
permissions.


--~--~-~--~~~---~--~~
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: table needs all fields filled in?

2006-03-09 Thread abe

thanks, that seems to work.
having trouble understanding what this core=True is actually meaning.

-E


--~--~-~--~~~---~--~~
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: table needs all fields filled in?

2006-03-09 Thread tonemcd

Hi,
blank=True should allow you to submit a partially-filled form, but you
have a lot of core=True fields in there as well, perhaps you have too
many? From the Model Reference documentation
http://www.djangoproject.com/documentation/model_api/;

core
For objects that are edited inline to a related object.

In the Django admin, if all "core" fields in an inline-edited object
are cleared, the object will be deleted.

It is an error to have an inline-editable relation without at least one
core=True field.

Cheers,
Tone


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



table needs all fields filled in?

2006-03-09 Thread abe

hi,

I use the class below to define molecule properties:

In the admin interface I get a nice mol_properties table to fill, but
the values
are only accepted if I enter values for all columns of the table. Is
this
correct behaviour? What can I do to make it accept a partially filled
in table?


class MolProperties(meta.Model):

compound =
meta.ForeignKey(Compound,edit_inline=meta.TABULAR,num_in_admin=1,unique=True)
mol_weight =
meta.FloatField(max_digits=8,decimal_places=4,blank=True,core=True)
ClogP_calc =
meta.FloatField(max_digits=8,decimal_places=4,blank=True,core=True)
ClogP_exp =
meta.FloatField(max_digits=8,decimal_places=4,blank=True,core=True,)
solubility = meta.CharField(maxlength=600,blank=True,core=True,)
solubilize_howto =
meta.CharField(maxlength=600,blank=True,core=True,)

class META:
db_table = 'mol_properties'
admin=meta.Admin()

def __repr__(self):
return `self.compound_id`




--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: why is my view for a submitted form not getting a POST?

2006-03-09 Thread Glenn Tenney

On Thu, Mar 09, 2006 at 11:21:38PM +0800, limodou wrote:
> Please check this document http://code.djangoproject.com/wiki/NewbieMistakes
> It seems that you lost a '/' after action name "rated".

Whoa!   Thanks!!!That did it!

I never even thought of that because my url pattern had a "rated/$"
and it got to my view...  AND the documentation on forms shows an
action with no trailing slash for "create_form" so I never thought
that a trailing slash was needed.

see http://www.djangoproject.com/documentation/forms/ in the finished
version of the "create_form" template it uses "action="." with no
trailing slash.  

So, why is it that action="." as in the documentation with no trailing
slash is ok but action="rated" isn't ok?  Is "." a special case (if
so, then why use that in the documentation as the example of how to do
a change_form), or is the finished version of the change_form wrong?

-- 
Glenn

--~--~-~--~~~---~--~~
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: why is my view for a submitted form not getting a POST?

2006-03-09 Thread Clint Ecker
What is happening is that Django is redirecting your request from "rating" to "rating/" (which is the correct location).  Unfortunately POST information is lost in this redirect.
On 3/9/06, Glenn Tenney <[EMAIL PROTECTED]> wrote:
I've taken a working template and a working detail view and addeda form to that template AND another view to handle that form whensubmit gets clicked.In my template I've got:
Rating: ="" />
and that view's code is:def place_rated(request, app_label, module_name, object_id=None, template_name=None):   foo = foobar   try:  s = places.get_object(id__exact=object_id, select_related=True)
   except: raise Http404   # we either have a rating already or have to create one   rating = 0   if request.POST:  foo = foo  # this will actually do some other stuff, but... for example...
  s.rating = request.POST['rating']  s.save()   foo = bar   return HttpResponseRedirect("/place/%s/" % object_id)When I clicked on the form it got to that view just fine, but never seemed to do
anything, so... I added the "foo=..." lines purposely for debugging to throw an exceptionto see what was happening.I added the "foo = foobar" line because it never got to the "foo = foo" line
(i.e. never got to the "if request.POST").it barfs on the foo = bar line and the debug info shows:   Request Method:   GET   ...   GETNo GET data   POST   No POST data
I thought that clicking on the SUBMIT button would be a post methodand that request.POST would be true (and POST would bepopulated)... but it's not.  Because it gets an exception at the"foo=..." line, I know that it is getting to that view when I click
submit.Huh? ? What's happening?   What am I doing wrong? ?p.s. although it never gets to the line "... request.POST['rating']",is that the right way to write it to pull the input field named "rating"


--~--~-~--~~~---~--~~
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: LDAP _without_ built-in Django user authentication

2006-03-09 Thread ChaosKCW

Whats the problem with faking a user ?

I would reccomend during you LDAP auth code you simple create a user in
django.users if it doesnt already exit. This can be compeltly
transparent to the user, they will never know.

I tend to like to have to setup users to my small admin sites, cause
everyone who works for the company shouldnt have access to it even
though they could auth via ldap correctlty.


--~--~-~--~~~---~--~~
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: why is my view for a submitted form not getting a POST?

2006-03-09 Thread limodou

Please check this document http://code.djangoproject.com/wiki/NewbieMistakes
It seems that you lost a '/' after action name "rated".


--
I like python!
My Blog: http://www.donews.net/limodou
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: [0.91] Model, subclassing, accessing superclass ?

2006-03-09 Thread Laurent RAHUEL

Ooops,

It should be :

class Derived(Parent):

def _pre_save(self):
do_some_other_things_here
self.my_method()

Indentation problem ;-)

Laurent

Le Jeudi 9 Mars 2006 14:21, Laurent RAHUEL a écrit :
> Le Jeudi 9 Mars 2006 12:58, bruno desthuilliers a écrit :
>
> Hi,
>
> > hello hello
> >
> > I must be a bit dumb, but I find myself a bit stucked with model
> > subclassing. Here's the problem: how does one call on the superclass
> > method when extending this method in the subclass ? ie:
> >
> > class Parent(meta.Model):
> >   
> >   def my_method(self):
> >  do_something_here
> >
> >
> > class Derived(Parent):
> >   
> >   def _pre_save(self):
> >  do_some_other_things_here
> >  Parent.my_method(self) # raises NameError, "Parent" is not defined
> >  parents.Parent.my_method(self) # idem, "parents" is not defined
>
> I guess you should do
>
> class Derived(Parent):
>   
>   def _pre_save(self):
>   do_some_other_things_here
>   self.my_method()
>
> You just inherit fields and methods from Parent. Your object is not a child
> of Parent but an "extension" of Parent.
>
> Regards,
>
> Laurent.
>
> > Is this a known issue, or I'm I missing something ? FWIW, the method I'm
> > trying to extend is actually _pre_save() - but I don't think it has much
> > to do with this problem..
> >
> > NB : I've solved the problem at hand using a template method pattern as
> > a workaround, but if the bug is - as often - between the chair and the
> > keyboard, please let me know...
> >
> > TIA
>


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



[0.91] Model, subclassing, accessing superclass ?

2006-03-09 Thread bruno desthuilliers

hello hello

I must be a bit dumb, but I find myself a bit stucked with model
subclassing. Here's the problem: how does one call on the superclass
method when extending this method in the subclass ? ie:

class Parent(meta.Model):
  
  def my_method(self):
 do_something_here


class Derived(Parent):
  
  def _pre_save(self):
 do_some_other_things_here
 Parent.my_method(self) # raises NameError, "Parent" is not defined
 parents.Parent.my_method(self) # idem, "parents" is not defined


Is this a known issue, or I'm I missing something ? FWIW, the method I'm
trying to extend is actually _pre_save() - but I don't think it has much
to do with this problem..

NB : I've solved the problem at hand using a template method pattern as
a workaround, but if the bug is - as often - between the chair and the
keyboard, please let me know...

TIA

-- 
bruno desthuilliers
développeur
[EMAIL PROTECTED]
http://www.modulix.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



CSS issues

2006-03-09 Thread tomass

Hi Folks,

I've copied the admin css to be used for my views, but I've added in
this custom section which is a modified version of the FILTER COLUMN
from changelist.css:

/*  FILTER COLUMN  (CUSTOM VERSION) */

#changelist-filter-custom {position:absolute; top:0; right:0;
width:180px; border-left:1px solid #ddd; background:#efefef; margin:0;}
#changelist-filter-custom h2 {font-size:11px; padding:2px 5px;
border-bottom:1px solid #ddd;}
#changelist-filter-custom h3 {font-size:12px; margin-bottom:0;}
#changelist-filter-custom ul
{padding-left:0;margin-left:10px;_margin-right:-10px;}
#changelist-filter-custom li {list-style-type:none; margin-left:0;
padding-left:0;}
#changelist-filter-custom a {color:#999;}
#changelist-filter-custom a:hover {color:#036;}
#changelist-filter-custom li.selected {border-left:5px solid #ccc;
padding-left:5px;margin-left:-10px;}
#changelist-filter-custom li.selected a {color:#5b80b2 !important;}

Basically what I've changed is the width in the first item (from 160px
to 180px, as well as removing the z-index so that a custom calendar
item pops up okay. Problem now is best illustrated with a picture:
http://www.greenleaftech.net/members/mthaddon/django_css
As you can see I have some trailing non-aligned part of the filtered
list, and the last column of the table gets run into the filtered list
at the top.

Can anyone help out with some css magic?

Thanks, Tom


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



Getting an object' content_type_id

2006-03-09 Thread Rob Slotboom

Is there a way to get an object's content_type_id?

I need it to store an object's id and content_type_id in another table.

Currently I solved this by using an sql-statement but maybe there is
some 'hidden' property or function like:
self.content_type or self.get_content_type


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