Django 2.1 inspectdb supports Oracle ?

2018-10-11 Thread pk
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

url template tag ; url generation

2010-09-08 Thread pk
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

Re: automatic documentation (docutils) does not pull in class methods?

2010-07-13 Thread pk
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):

Re: automatic documentation (docutils) does not pull in class methods?

2010-06-21 Thread pk
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)

automatic documentation (docutils) does not pull in class methods?

2010-06-17 Thread pk
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

Re: select childless parents, i.e. base with no derived classes in model inheritance

2009-01-02 Thread pk
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)

Re: select childless parents, i.e. base with no derived classes in model inheritance

2008-12-29 Thread pk
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

select childless parents, i.e. base with no derived classes in model inheritance

2008-12-29 Thread pk
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

Re: Template inheritance

2008-11-03 Thread pk
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

Re: Using settings.py mechanism for application settings

2008-11-03 Thread pk
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.

Using settings.py mechanism for application settings

2008-10-31 Thread pk
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

Re: Template variable in filter?

2008-05-03 Thread pk
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? >

Re: Should I set up Django locally or on a web server?

2008-05-03 Thread pk
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

Re: Templating patterns

2008-05-03 Thread pk
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

Re: Extending pythonpath within python code

2007-12-22 Thread pk
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

Re: Django documentation in chm (Dec 22, 2007)

2007-12-22 Thread pk
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

Re: Database filters

2007-12-20 Thread pk
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.

Re: Backward Relationship In Template

2007-12-13 Thread pk
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

Re: Dynamic Choicefield

2007-12-09 Thread pk
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

Re: How to display if a user is logged in? Do I develop a custom template tag?

2007-11-29 Thread pk
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

Re: How to display if a user is logged in? Do I develop a custom template tag?

2007-11-26 Thread pk
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