Re: Pydev + Django + Ubuntu 9.10

2009-12-15 Thread paul.dorman
I can confirm that removing the Python interpreter and re-adding
solved this issue for me. I'm using Karmic packages for Eclipse and
for Django.

On Dec 8, 8:32 am, Brian McKeever  wrote:
> I'm using django from the repositories.
> Installed this 
> way:http://docs.djangoproject.com/en/dev/topics/install/#installing-devel...
>
> I configured my interpretor in eclipse by doing this:
> "Now, on to re-configure the pydev interpreter to add those new
> paths... I'm kind of lazy, so, usually I just remove the interpreter
> and add it again, instead of figuring out just the new paths (I also
> thinks it's safer, as it gets all the folders it finds in the
> pythonpath automatically). "
>
> From:http://pydev.blogspot.com/2006/09/configuring-pydev-to-work-with-djan...
>
> On Dec 7, 8:17 am, turkan  wrote:
>
>
>
> > Hello Brian.
>
> > Strange, I am also using Eclipse downloaded from eclipse.org. Did you
> > add any special folders to the PYTHONPATH? Are you using django from
> > the Ubuntu repositories?
>
> > On Dec 7, 6:06 am, Brian McKeever  wrote:
>
> > > I was having the same trouble you are when I installed eclipse from
> > > the repository.
> > > I fixed it by downloading it again from the 
> > > websitehttp://www.eclipse.org/downloads/
> > > (Eclipse IDE for C/C++ Developers (79 MB) is the one I picked
> > > specifically).

--

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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Content blocks editable in Admin

2009-07-09 Thread paul.dorman

Django-chunks appears to be the perfect solution to my problem. Thanks
Daniel! Thanks to you too Eugine for your response.

On Jul 10, 2:19 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Jul 9, 8:47 am, "paul.dorman" <paul.dor...@gmail.com> wrote:
>
>
>
> > Hi all,
>
> > I'd like to include blocks of content in my templates which is
> > editable in the Admin app. I'd design the overall template, but
> > include bits that the computer illiterate folks here could change,
> > something like this:
>
> > [my template]
> > 
> > [a form which is included in the template]
> > [a block of content that can be edited in the Admin application by
> > computer illiterate monkeys]
> > 
>
> > I initially thought that flatpages would be the answer (with TinyMCE),
> > but alas, there appears to be no built-in way to include a flatpage
> > inside a template.
>
> > I don't want the content blocks to have a URL (so no URLConf entry). I
> > don't mind if I use a model, but I don't know how to get the Admin app
> > to pick up the model without a URLConf entry.
>
> > Also, how do I reference a value from the model inside any template?
> > I've tried creating a variable (testblock = ContentBlock.objects.get
> > (name='testblock')) in my view, and then including {{testblock}} in my
> > template, but that does nothing. I know I'm doing it wrong, but I
> > can't find documentation to help.
>
> > Please help. This is my first real Django application (so yes, I'm a
> > newb), but I'd like to stick with common practice as far as possible.
>
> > Thanks for your help,
> > Paul
>
> There are various third-party apps which do what you want. See for
> example django-chunks:http://code.google.com/p/django-chunks/
>
> As regards the problem with referencing the block in your view, are
> you sure you included it in your context?
> --
> DR.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Content blocks editable in Admin

2009-07-09 Thread paul.dorman

Hi all,

I'd like to include blocks of content in my templates which is
editable in the Admin app. I'd design the overall template, but
include bits that the computer illiterate folks here could change,
something like this:

[my template]

[a form which is included in the template]
[a block of content that can be edited in the Admin application by
computer illiterate monkeys]


I initially thought that flatpages would be the answer (with TinyMCE),
but alas, there appears to be no built-in way to include a flatpage
inside a template.

I don't want the content blocks to have a URL (so no URLConf entry). I
don't mind if I use a model, but I don't know how to get the Admin app
to pick up the model without a URLConf entry.

Also, how do I reference a value from the model inside any template?
I've tried creating a variable (testblock = ContentBlock.objects.get
(name='testblock')) in my view, and then including {{testblock}} in my
template, but that does nothing. I know I'm doing it wrong, but I
can't find documentation to help.

Please help. This is my first real Django application (so yes, I'm a
newb), but I'd like to stick with common practice as far as possible.

Thanks for your help,
Paul
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Directed graph implementations for Django

2007-09-18 Thread paul.dorman

Thanks very much for your help Doug. Do you think there is value in
having a generic DAG implementation for Django? Seems to me like it
might be a useful addition, but I'm curious as to how useful it would
be given that most non-Django implementations I have come across are
as you describe 'very domain specific'.

I also wonder how much a DAG implementation should rely on RDMS
functions to minimize the chatter between the application and
database. For instance, it would be terrible to get a node from the
DB, determine it's parent(s), fetch each parent from the DB, determine
*its* parents, etc. etc. Now I could serialize the parents into the
node data, but don't know if that is going to be effective because if
the parent relationships change you're going to have a lot of
processing to update all your nodes.

I know that a DAG is a subset of a digraph, which is what an RDBMS is,
so I'm sure that there's a very elegant way of doing it. But the
problem for me is (a)determining how to do it from the database
perspective, and (b)how to do it in Django.

Cheers,
Paul

On Sep 18, 8:34 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> We use a Tree for the navigation bar (not a true DAG, but there are
> circular 
> checks):https://pycon.coderanger.net/browser/django/trunk/pycon/navbar/models.py
>
> There is a validator IsNotCircular, which does the obvious.
>
> There is code to do serialization (currently just a pickle), but there
> are plans to add json to communicate to the client.
> The (poor) documentation on using the navbar is 
> here:https://pycon.coderanger.net/wiki/PyCon08/NavBar
>
> I have other examples of true DAG's in DB form, but they are very
> domain specific and take advantage of the
> limitations in the data. (like the divided room problem where a
> conference room might have 3 parts which can
> make a total of 6 'rooms', but have special meaning for room
> scheduling). But the NavBar is closest to what
> you are trying to do.
>
> On Sep 17, 4:08 pm, "paul.dorman" <[EMAIL PROTECTED]> wrote:
>
> > Thanks for your response Julio,
>
> > something similar yes. What I'm after is an Django implementation of
> > andirectedacyclic graph. I understand there's some complexity
> > involved to ensure no cycles can be created (which I understand is the
> > graph equivalent of an endless loop). There's plenty of good examples
> > of DAG out there, but I'm not sure how to implement one that works
> > with RDMS (or Django for that matter!)
>
> > Paul
>
> > On Sep 17, 4:56 pm, Julio César Carrascal Urquijo
>
> > <[EMAIL PROTECTED]> wrote:
> > > I'm a newbie on Django my self but maybe this is what you are looking
> > > for:
>
> > > class Category(models.Model):
> > > code = models.CharField(maxlength=200, unique=True)
> > > products = models.ManyToManyField('Product')
>
> > > class Product(models.Model):
> > > parent = models.ForeignKey('Post')
> > > code = models.CharField(maxlength=200, unique=True)
>
> > > I've also read that you can specify signals for most operations on a
> > > model (Like when a model is inserted, updated or deleted from the
> > > database) though I can't find the URL right now. There's some mention
> > > of it here:
>
> > >http://www.djangoproject.com/documentation/db-api/
>
> > > On Sep 16, 9:54 pm, "Paul Dorman" <[EMAIL PROTECTED]> wrote:
>
> > > > Hi all,
>
> > > > definite newbie here. I'd like to implement a category type system in
> > > > Django. I've looked in the cookbook and Googled a bit, but to no avail. 
> > > > What
> > > > I'm after should be pretty simple: adirectedgraph for categories, where
> > > > objects and perhaps categories can be a member of one or more 
> > > > categories.
> > > > For example, a 'server' is an 'infrastructure component' (for the 
> > > > techies),
> > > > as well as an 'asset' (for the financial types). In my grand scheme 
> > > > when an
> > > > object is associated with one or more categories (one is the minimum), 
> > > > the
> > > > application will  execute method calls stored (with optional 
> > > > parameters) in
> > > > the database (serialized as JSON or XML). With the 'server' example, it
> > > > might be that being in the 'infrastructure component' category triggers 
> > > > an
> > > > email to be sent to the system administrator, and the existence in the
> > > > 'asset' category would trigger an automated update to the asset 
&

Re: Directed graph implementations for Django

2007-09-17 Thread paul.dorman

Thanks for your response Julio,

something similar yes. What I'm after is an Django implementation of
an directed acyclic graph. I understand there's some complexity
involved to ensure no cycles can be created (which I understand is the
graph equivalent of an endless loop). There's plenty of good examples
of DAG out there, but I'm not sure how to implement one that works
with RDMS (or Django for that matter!)

Paul

On Sep 17, 4:56 pm, Julio César Carrascal Urquijo
<[EMAIL PROTECTED]> wrote:
> I'm a newbie on Django my self but maybe this is what you are looking
> for:
>
> class Category(models.Model):
> code = models.CharField(maxlength=200, unique=True)
> products = models.ManyToManyField('Product')
>
> class Product(models.Model):
> parent = models.ForeignKey('Post')
> code = models.CharField(maxlength=200, unique=True)
>
> I've also read that you can specify signals for most operations on a
> model (Like when a model is inserted, updated or deleted from the
> database) though I can't find the URL right now. There's some mention
> of it here:
>
> http://www.djangoproject.com/documentation/db-api/
>
> On Sep 16, 9:54 pm, "Paul Dorman" <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > definite newbie here. I'd like to implement a category type system in
> > Django. I've looked in the cookbook and Googled a bit, but to no avail. What
> > I'm after should be pretty simple: a directed graph for categories, where
> > objects and perhaps categories can be a member of one or more categories.
> > For example, a 'server' is an 'infrastructure component' (for the techies),
> > as well as an 'asset' (for the financial types). In my grand scheme when an
> > object is associated with one or more categories (one is the minimum), the
> > application will  execute method calls stored (with optional parameters) in
> > the database (serialized as JSON or XML). With the 'server' example, it
> > might be that being in the 'infrastructure component' category triggers an
> > email to be sent to the system administrator, and the existence in the
> > 'asset' category would trigger an automated update to the asset register.
> > The methods are stored according to the standard CRUD set of operations, so
> > that a user can create a new category in the view, and then specify actions
> > which occur when an object is created, read, updated, or deleted (provided
> > by the application itself). Actions are triggered for both objects (the
> > things that are categorized) and for child categories (so for example it may
> > be that a parent category can be locked in such a way as to prevent any more
> > child categories from being added).
>
> > Note that categories are purely containers with generic actions (for crud
> > operations on objects in the category) and distinct from objects, which I
> > imagine would have a category_id FK. And note also that my objects are all
> > using the same model, with the bulk of data serialized as XML.
>
> > Has anyone out there in Djangoland done something like this? The graph's the
> > thing - I'm happy to deal with the CRUD triggers myself. If there's a model
> > out there that would be a good starting point that would be great.
>
> > One additional thing I'm wondering about is how Django can work with stored
> > procedures. For example, it might be more efficient if the application can
> > ask the database for the methods to run  when an object is created,  and
> > have the database return the methods for not only the object's bottom-level
> > category, but for all parent categories as well.
>
> > P.S.
>
> > Congratulations on the great sprint!
>
> > P.P.S. I hope I haven't just embarrassed myself with my naïveté.
>
> > --
> > "Science fiction writers are the only ones who care about the future"
> > --  Kurt Vonnegut


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---