d:
python manage.py inspectdb > models.py
python manage.py inspectdb --include-views > models.py
In both cases, no errors are produced and the output just contains:
'''
# [generated comments...]
from django.db import models
'''
Thanks,
pk
--
You received thi
views.byname'),
2. Why/how is 'mysite' built into the url ?
Thanks,
pk
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this gro
On Jun 22, 4:12 am, "euan.godd...@googlemail.com"
wrote:
> You could try using Spinhx if you don't think docutils gives you
> enough flexibility. The autodoc extension is great.
>
However sphinx + autodoc does not know how to extra django model
definitions,
e.g.
class A(models.Model):
Answering my own question -- it is django.contrib.admindocs.view that
limits the admindocs view to only list methods on a model that has a
single argument. The lines:
for func_name, func in model.__dict__.items():
if (inspect.isfunction(func) and len(inspect.getargspec(func)
[0]) == 1)
The automatic documentation generated, via docutils, in the admin
interface for a django app does not pull in documentation for methods
defined for classes, only attributes. Is this a "feature" of the
django implementation or docutils?
Thanks,
P.K.
--
You received this message because you are su
The Place/Restaurant sample is from the model doc under
multi table inheritance:
http://docs.djangoproject.com/en/dev/topics/db/models
It is a simple inherited model relationship:
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
Alex,
First I made a mistake in the original post. The first query returns
*nothing*, not "all places". This is the correct "question:
1) print Place.objects.filter(restaurant__isnull=True).count()
returns 0
and 2) print Place.objects.filter
(restaurant__serves_hotdog__isnull=True).count()
wo
I have a need to select base classes that does not have derived class
defined using the ORM. Using the Place/Restaurant example in the
Django doc, I find that:
1) Place.objects.filter(restaurant__isnull=True)
returns all places.
and
2) Place.objects.filter(restaurant__serves_hotdog__isnull=True
One simple way to think about template inheritance (which is a GREAT
feature) is to think
of it as "specialization":
You first define the general look of a website, the logo, banner, menu
bars, footers.
All that goes into the base template A. In fact, you can render just
the base template A
and s
To clarify the question a bit more, I am talking about an "app" in the
sense of a reusable component that is developed by me but want
to distribute for others to use.
James is right that for any of my own app, I can just tell the user
to put in some settings in the project level settings.py file.
There are always needs for application level configuration settings. I
really like the way settings.py works, with a package (django) level
default settings overridable by local settings. However looking at the
whole LazySettings setup it is not easily used outside of django/conf.
Am I missing som
Isn't this already in settings.py?
Look at the code for the filters
/django/template/defaultfilters.py
it reads DATE_FORMAT and TIME_FORMAT from the settings file.
P.K.
On Apr 29, 2:25 am, Mike Chambers <[EMAIL PROTECTED]> wrote:
> Is it possible to include a template variable inside a filter?
>
if you are running Leopard (IMPORTANT) it is very easy to setup
Django.
I wrote up what I did here:
http://www.pkshiu.com/loft/archive/2008/01/django-on-leopard
The key is to just use sqlite and the development server to do
development.
There are some issues with sqlite compare to postgresql (I
sometimes extending the template system with application specific tags
solves my problem. YMMV of course.
On May 2, 1:49 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I've got a lot of templates with the same pattern, so i want to put
> some code like this in a template.
>
> {% if iterable
os.path.normpath('e:/a/b/c') will give 'e:\\a\\b\\c'
On Dec 22, 6:50 am, Julien <[EMAIL PROTECTED]> wrote:
> Thanks for the tip!
>
> However, it's a bit strange because it only accepts paths with double
> back slashes, instead of the forward slashes required for declaring
> the template path for
Thanks very much for doing this. While reading on djangoproject is
nice, sometimes it is faster/better to have a local version -- When I
am coding on a plane, for example !
P.K.
On Dec 22, 8:36 am, char101 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have created a chm format of the django docs taken
Are you using the built-in Group and User classes? If what you are
quoting is cut-and-pasted from your console, you maybe using your own
model? Maybe you should show us the actual source code.
FYI -- the built-in classes are django.contrib.auth.models.Group
and ..User
not Groups nor Users
P>P.K.
You mean the first one of the set?
{{ objectb.objecta_set.all.0 }}
You can also slice it, etc. But of course, you really need to define
the ordering to get to the "First" one whatever "first" means to you.
P.K.
--~--~-~--~~~---~--~~
You received this message beca
tity'].choices = [(str(product.id) + "_" +
> str(c),
> c) for c in range (1, product.stock_quantity)]
>
> The problems come when I try to validate user's choice and add the
> product to the shopping cart with the following snippet:
>
> def add_product_to_ca
There are two issues.
1) you can't change the auth_user table/class. There are different
ways to "extend" the auth_user class. The "B-List" site has some
article on how you may do it. http://www.b-list.org/
I have my own "user" class that is one-to-one implemented as "many-to-
one" back to the a
There are a couple of things you have to do to get the "user" object
automatically available to all templates.
1. Follow the authentication setup as suggested.
2. Then read the bit about request_context:
http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestconte
21 matches
Mail list logo