Re: Error during template rendering

2019-05-23 Thread Rock N Roll Mühlbacher
Am Donnerstag, 23. Mai 2019 20:06:31 UTC+2 schrieb cixtus anyanwu: > Guys am following the django girls pdf tutoril but am stuck here. Its saying: > > > > django.urls.exceptions.NoReverseMatch: Reverse for 'post_details' with > keyword arguments '{'pk': 3}' not found. 1 pattern(s) tried:

Django model complex query ( use table A.column1 as parameter to query result from table B)

2014-10-21 Thread zhang rock
es.address Thanks Rock -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send e

Libraries for generating URL of uploading files in Django

2012-06-01 Thread First Rock
Need to develop a project for file uploading and generating its(files's) URL, which could be shared. Are there any particular libraries or simple means in Python,(Django) that would be handy and efficient.? ~ Newbie trying a Herculean Task~ Thanks in Advance :) -- You received this message

Integrating Admin and Polls Applications

2012-05-24 Thread First Rock
I want to take forward the application creating experience with django, by integrating the polls and admin applications. As far as my knowledge is concerned in the polls appl we developed anyone could enter the url and cast their vote. I wish if we could integrate the admin apppl, and allow only

Unable to view results page of polls tutorial

2012-05-18 Thread First Rock
hi al almost done with the django tutorial#4.. But my app doesnt use the html pages, n doesnt load the radio buttons and results page.. Other than those the app is displayed in the default template and shows al the pages of groups users n polls.. i have placed the html templates in templates

Re: Blueprint css versus YUI grids versus ?

2009-01-19 Thread Rock
I have generated several static sites using Django aym-cms, blueprint.css and markdown. This worked so well that I created a django app that encapsulates blueprint.css so that I now have the ability to manipulate layouts dynamically. Next up is to hook up "pagelets" (i.e., django-chunks,

Re: Recipe 534109: XML to Python data structure

2009-01-06 Thread Rock
Elementtree is now part of the python distribution. I am using it in a Django app I created for a client to extract data from XML provided by a web service. It works well but the documentation could be clearer. On Jan 6, 9:27 am, "shi shaozhong" wrote: > I am reading in

Re: Django Training

2008-12-12 Thread Rock
Steve, I think that the book by Forcier, Bissex and Chun called "Python Web Development with Django" is worth looking at with regards to ideas for a lesson plan. To me it seems that it would be an excellent workbook for a very full week of classes. Their chapter 1 on python and the first few

Re: can't pass a parameter to my named url using {% url %} tag in template

2008-11-27 Thread Rock
I had the same problem recently in a template that was created for use in an inclusion_tag. My workaround was to the perform the reverse call in the templatetag and pass in the resulting url. If that is not an appropriate workaround for you, perhaps a "with" will do the trick. If that doesn't

Re: Testing dynamic apps

2008-11-26 Thread Rock
I took a similar path. I cloned the run_tests function from django.tests.simple.py and put it in my project directory as test_setup.py while adding this near the top of the function: if settings.TEST_APPS: settings.INSTALLED_APPS += settings.TEST_APPS That at least allows me to define

Re: Multiple Database

2008-11-26 Thread Rock
http://www.eflorenzano.com/blog/post/easy-multi-database-support-django/ On Nov 26, 8:30 am, "Austin Gabel" <[EMAIL PROTECTED]> wrote: > Hello, > I am currently attempting to roll my own multiple database support for > django for a new project.  I have attempted to search for examples of this >

Re: App for creating "subsites"

2008-11-12 Thread Rock
First you have to figure out how you want to map your users to their pages. Do you want to use subdomains? How about something like the delicious.com scheme (i.e., http://delicious.com/username/ ) Or perhaps you have something else in mind. After you figure out your URL mapping, the rest looks

Re: compare old and new model field value

2008-11-11 Thread Rock
Take a look at http://code.google.com/p/django-reversion/ which may be more than what you need, but certainly fills the bill for your general use case. On Nov 10, 1:03 pm, Tim <[EMAIL PROTECTED]> wrote: > Basically, I want to be able to do something if the value of a field > changes in a model.

Re: A best-practice question: reusable apps: where to write views in my proj?

2008-11-11 Thread Rock
I have used both approaches on different occasions. I feel the choice boils down to the quantity of shared stuff that you need. For a large app I recently created a "common" app that ended up having no models, but did include a large assortment of shared views, choices, forms, templatetags,

Re: Sphinx Search ORM

2008-11-11 Thread Rock
You are going to have better luck using David Cramer's project which is up to date with Django 1.0: http://code.google.com/p/django-sphinx/ On Nov 11, 6:05 am, dusans <[EMAIL PROTECTED]> wrote: > Has onyone been able set make Sphinx Search ORM to >

Re: Django pluggable adressbook/mini-CRM?

2008-11-11 Thread Rock
I have looked for this myself and in my opinion the answer is no. There are several mini-crm prototypes that were started in pre-1.0 days and abandoned. None of them includes a basic design that I find compelling. The minibooks app is the closest thing to a working Django CRM, but it has several

Re: updating a single field / attribute, is it possible? or better practices?

2008-11-01 Thread Rock
In the meantime, creating and executing your own update command is not difficult. Here is a snippet for a custom PositionField that updates itself when necessary with an SQL UPDATE: http://www.djangosnippets.org/snippets/884/ --~--~-~--~~~---~--~~ You received

Re: populating forms using models

2008-11-01 Thread Rock
In brief, your forms field for province does not have to have anything to do with your corresponding model field. Just make a forms.ChoiceField with the data filled in that you need (or else look up the pattern for loading dynamic data into a forms.ChoiceField and do something like that.) If you

Re: Splitting models.py won't install models

2008-10-28 Thread Rock
I tried to do this several months ago during the run up to the 1.0 release and, at that time, the capability was broken. Furthermore I recall having a discussion with some core developer that it was not on the short list to fix for 1.0. I didn't submit a ticket for this, but it may have been

Re: page not updating right away

2008-10-18 Thread Rock
A very common problem is that the timezone or system clock is off. Most Blog implementations allow you to create a blog entry "in the future" so it shows up on your web page only after a specified time. This capability plays havoc with noobies who haven't bothered to set their timezone correctly

Re: Is there anything like the RailsKits for Django?

2008-10-10 Thread Rock
Satchmo is your best bet at this time. It provides a rather complete Django-based web storefront and includes explicit support for subscription management. See satchmoproject.com for more information. There is a Google group for satchmo users called satchmo-users. On Oct 10, 7:19 am, Wayne M

Re: Rendering just child template...

2008-10-02 Thread Rock
No. Typically you would make a stand-alone template that does not extend anything else. This template only renders the contents of the container in question. It can be used by your AJAX view to create an updated container which can be passed back to the browser. But the same template can also be

Re: alphabetize options in a ForeignKey dropdown?

2008-10-02 Thread Rock
On Oct 2, 2:00 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-10-02, o godz. 01:03, przez Rock: > > > Have you tried setting the order within your model? I think that is > > the only simple way to tackle this at this time. > > >  

Re: Dynamically appending a step to FormWizard

2008-10-02 Thread Rock
is works out for you. Rock --~--~-~--~~~---~--~~ 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

Re: Dynamically appending a step to FormWizard

2008-10-02 Thread Rock
I can't show you the code yet since I haven't got permission to post it cleared from my company, but I got this working. (It was not easy and req --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: alphabetize options in a ForeignKey dropdown?

2008-10-01 Thread Rock
Have you tried setting the order within your model? I think that is the only simple way to tackle this at this time. class Meta: ordering = ("fruit",) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: 'get_latest' is not a valid tag library

2008-09-26 Thread Rock
Hmmm... Here are some guesses: If that return statement in render is a single doublequote instead of 2 singlequotes, then your code probably won't parse and, even if it does, get_latest certainly won't be found. It seems to me like you need to coerce the string being assigned to self.num as

Re: Can I create unique instances of a model to live under another model?

2008-09-26 Thread Rock
Oops. I meant intermediary class, not intermediary field. On Sep 26, 1:39 pm, Rock <[EMAIL PROTECTED]> wrote: > It may be as simple as creating an intermediary field between Document > and agency called Study. (See the Django docs regarding adding extra > fields to a many-to-ma

Re: Can I create unique instances of a model to live under another model?

2008-09-26 Thread Rock
of time and money in the long run. Rock --~--~-~--~~~---~--~~ 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,

Re: 'get_latest' is not a valid tag library

2008-09-25 Thread Rock
You need an empty __init.py__ in the directory or else the python files there will not be found. On Sep 25, 10:29 pm, Matthew Crist <[EMAIL PROTECTED]> wrote: > Here's my template: > > {% load get_latest %} > "http://www.w3.org/TR/html4/loose.dtd;> > >         >                 My Site -

Re: INSTALLED_APPS from a template

2008-09-25 Thread Rock
I have no idea, but it only took me a few minutes to create a filter you can put in some templatetags module: from django import template from django.conf import settings from django.template.defaultfilters import stringfilter register = template.Library() @register.filter @stringfilter def

Re: Many-To-Many with extra fields

2008-09-19 Thread Rock
In my code I have a reference and a name such that I can do perform a "get" to procure the reference to the correct intermediate object. Then I simply interrogate that object directly. It should be possible to do a "values" style query instead if you only want a particular field or set of fields.

Re: how to setup LDAP authorisation in django/apache.

2008-09-19 Thread Rock
We rolled our own LDAP authorization. First I created a python module that imported ldap from the python-ldap-2.2.1 package and wrapped in functions that performed authentication and pulled selected data from our corporate LDAP server. Then one of my partners used that to create our own

Re: New django 1.0 website: www.astronomy2009.org

2008-09-11 Thread Rock
as they almost never fix bugs of that nature.) Fortunately the menus provide access to current events so maybe this SNAFU is ignorable. Also I noticed "The Portal to the Universe" project. Are you guys doing that one? If so, how can I help? Rock On Sep 11, 9:16 am, "[EMAIL PROTECTED]&quo

Re: Has anyone made an MS excel exporter in a django site yet?

2008-04-11 Thread Rock
While I have used Django to emit csv files, I have also found that my users are quite happy at times with simply cutting and pasting data that I display in HTML tables via Django directly into their spreadsheats. You might want to see if this is an adequate option for some of your use cases. It

Re: Has anyone made an MS excel exporter in a django site yet?

2008-04-11 Thread Rock
I can't believe that no one has mentioned the xlrd package: http://scienceoss.com/read-excel-files-from-python/ http://pypi.python.org/pypi/xlrd/0.5.2 Then again I haven't used this one yet, much less tried to incorporate it with Django.

Re: Google App Engine & Django

2008-04-08 Thread Rock
Brox ... Nice writeup! Many thanks! Now for my thoughts... I have been using PyTables as an adjunct datastore along with the Django ORM for almost a year. To me, BigTable looks a lot like PyTables and, as such, I know that it can be be a great supplement to the Django ORM in certain

Re: Unittest test-database not empty

2008-01-30 Thread rock
I have no fixtures/initial_data-files anywhere in my project tree! Actually, the only file named "initial_data" on my system is djtrunk/ tests/modeltests/fixtures/fixtures/initial_data.json. And that file doesn't contain much. The "ghost-users" only show up when I'm running "./manage.py test".

Re: Unittest test-database not empty

2008-01-29 Thread rock
Thanks Russ, for your helpful comments! I'm now searching for the initial_data fixture. I have looked through all files in this project without success. When I run python manage.py test there is no such sentence as "Loading 'initial_data' fixtures", but maybe there shouldn't be one? I've also

Unittest test-database not empty

2008-01-28 Thread rock
I'm using the unittesting-environment for test-driven-development in Django. It works excellent, but one matter is puzzling. The Django documentation tells me this: "The test database Tests that require a database (namely, model tests) will not use your "real" (production) database. A separate,

Re: Template Macros Like In Jinja

2008-01-22 Thread Rock
You can create an intermediate base class that extends your base class and includes elements like: {% if actions %} ... show action table ... {% endif %} {% if element %} ... show edit element form ... {% else %} ... show add element form ... {% endif %} and so forth and so on. Now your page

Re: Problem with manage.py and shared app/project structure

2008-01-17 Thread Rock
Put shared in site-packages right alongside django. Problem solved. --~--~-~--~~~---~--~~ 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

Re: Django Tutorial02 / TEMPLATE_DIRS

2008-01-17 Thread Rock
The templates have to be within a directory named "templates" found in the /var/www/ directory. BUT DON'T PUT TEMPLATES THERE! Put the templates dir in the same directory as your settings.py file and set the path accordingly in the settings.py file. Here is another good alternative: Comment

Re: An easier way to do this Pagination in a template?

2008-01-09 Thread Rock
I would move the logic into a custom filter. This keeps it out of the view and radically simplifies the template logic. It is easy to create a filter that takes an argument, so the fact that you have two inputs (page_number and current_page) is no problem. On Jan 9, 11:02 am, "Prof. William

Re: cache middleware and middlewareorder

2007-12-21 Thread Rock
On Dec 5, 7:02 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > If you're using CACHE_MIDDLEWARE_ANONYMOUS_ONLY you need a different > middleware ordering, as the error message says. That setting is a real > hack and I'd love to implement it in a better way some day. At the > moment, though,

Re: Random Data

2006-12-06 Thread Rock
I wrote a utility to parse a model files as well as embedded comments that provided data loading hints. It was trivial to do. The utility used "cog" to generate a data loading program. That worked like a charm even as the underlying models evolved. (This approach was a "win" since the data

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-12-04 Thread Rock
> > > Talking through my hat?No, I think not -- I think that syntax > > (``queryset.groupby(field).max()``) > actually looks like the best proposal for aggregates I've seen thus far... > Sounds pretty good to me. Besides the usual min, max and such, I also like: queryset.groupby(field).stats()

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-11-30 Thread Rock
applications based on Django and our ability to quickly respond to requests for improvements has changed the dynamics of how our entire division does much of its work. Rock On Nov 29, 11:51 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 11/30/06, Rob Hudson <[E

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-11-29 Thread Rock
On Nov 29, 2:30 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > > I needed aggregates. (I also learned about data bubbles and redesigned > > my tables to include them as necessary. This redesign eliminated almost > > all of my needs for an aggregate function interface.)Whatsa data bubble? > >

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-11-29 Thread Rock
. It would be nice to know what, if anything, is happening along these lines. I might even be willing to spend some time on this during the holidays. Rock Howard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

Re: Database Migration

2006-08-24 Thread Rock
One of my django apps contains testing data about every item our company has manufactured over the last year or so. The database has over 50 million rows of data. Despite this I have successfully migrated the database several times. Sometimes it is trivial. Back up the data for safety and then

how to add content of the page's textarea in django ?

2006-08-20 Thread rock
how to upload a picture ,then add the url link of the picture to the page's textarea content. Some bbs can do this . But how can I do like this in django, any advice would be appreciated --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Strange 'caching' issue

2006-08-14 Thread Rock
I forget the details, but this has something to do with your time and/or timezone setup. The default blog app doesn't post items that are set "in the future". The time you set by seleting "now" in the admin may or may not be the time that you think it should be because of the server clock and

Re: Caching in Django admin

2006-07-20 Thread Rock
Well I switched to per view caching and it went off quite easily. Thanks for the encouragement. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Caching in Django admin

2006-07-19 Thread Rock
I can confirm that the odd behavior that you are seeing comes from setting up the global caching for a site. I see the same thing on a site under 0.91 that uses global caching, but not at all on other non-caching sites. (BTW, the work around is to periodically blow away the files *admin* in the

Re: Splitting the databases

2006-06-23 Thread Rock
This is not quite precise. I use two different databases on a single installation. In fact, using the virtual hosting capability of apache and modpython, I have one set of Django applications uses a PostgreSQL database and an entirely different set of Django applications that use a MySQL

Re: create models from the admin page?

2006-05-03 Thread Rock
falcon wrote: > I still believe that > many 'developers' could benefit from defining simple to moderately > complex models on the web. If code needs to get more complex, > developers can just switch back to using models.py. > I have gone in a different direction. I have written a tool to

Re: urls.py changes ignored

2006-03-30 Thread Rock
I found a tiny difference in the http.conf files (AllowOveride was set to "FileInfo" instead of "None".) I made that change, even though I seriously doubted that it would make a difference. Then I bounced apache and amazingly enough the new urls.py showed up. I set the AllowOverride setting back

Re: urls.py changes ignored

2006-03-30 Thread Rock
Yes I did. No help. Then I forced the creation of a new urls.pyc by importing urls.py in "python manage.py shell" and importing urls.py and explicitly checking that the correct number of urlpatterns were defined. Still no joy in the browser though. Note that the access_log shows my request but

urls.py changes ignored

2006-03-30 Thread Rock
I have a development site where I can update myproject.urls.py and the changes are acted upon immediately by my server. I just cloned this site onto another computer and everything seems to be in order except that on this new system, changes to urls.py are entirely ignored. Nothing I do seems to

numeric formatting

2006-03-24 Thread Rock
about in order to create my own filter? Rock --~--~-~--~~~---~--~~ 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

Re: Need help for query, how could i do this with django ? or a raw SQL.

2006-03-24 Thread Rock
Dropping down to the raw SQL level is easy... Assuming my_sql_command is a string with your select statement... from django.core.db import db cursor = db.cursor() cursor.execute( my_sql_command ) row = cursor.fetchone() result = row[0] You might prefer fetchall(), but I leave the data

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

Re: adding page

2006-02-21 Thread Rock
Mary, In your templates directory you need a template named default.html. Here is what mine looks like: http://www.w3.org/TR/REC-html40/loose.dtd;> {{ flatpage.title }} {{ flatpage.content }} --~--~-~--~~~---~--~~ You received this message because you are

Re: forward references

2006-02-18 Thread Rock
Good catch, but this was just an example to show the poblem I was facing. FWIW, if someone really wanted to implement _pre_delete for Reporter as discussed, they should add this version of the function to class Reporter: def _pre_delete( self ): for article in

Re: forward references

2006-02-18 Thread Rock
Ahhh. That makes sense. 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

Re: forward references

2006-02-18 Thread Rock
You would think so, but somehow that didn't work... Precisely what import statement would you use. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

forward references

2006-02-18 Thread Rock
Well this is more of a python question I guess, but here goes. Let's say that I am using the example model from http://www.djangoproject.com/documentation/models/many_to_one/;>this page in the documentation. I decide to add a _pre_delete function to class Reporter that will delete any articles

Re: is Django too powerful?

2005-12-13 Thread Rock
Wrong I think. There are already several Djangoids looking at making a discussion forum together as an open project. I expect there will be plenty of similar activities. The problem is that Django is changing fast right now without regards to backwards compatability. Wait until 1.0 hits and soon

Re: Django screencast

2005-12-13 Thread Rock
"Django" is pronounced correctly in the screencast.

Server Error pages

2005-11-21 Thread Rock
My view code for my calendar app can detect when a user supplies a bad year, month or day, but I have no idea how to get Django to display an application specific "500" page. I put a 500.html in my templates subdir for the calendar app, but it is not found when a raise an exception. It does look