Re: ANN Satchmo 0.7 Release
On Mon, May 26, 2008 at 11:05 PM, Chris Moffitt <[EMAIL PROTECTED]> wrote: > I am very happy to announce the immediate availability of Satchmo version > 0.7. Congratulations to you Chris and the rest of the team. I'm looking forward to digging into all the new features. Good work. Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: Ajax widget
So I'm really confused. You asked this same question on 12/14: http://groups.google.com/group/django-users/browse_frm/thread/3415d1b0bf21cf7a/c26747fb42ae3b24?lnk=st=AJAXWidgetComboBox#c26747fb42ae3b24 The original author of the Wiki page that you're referring to responded. The code is a year and a half old and it seems to not be working. But now you're asking the same question again. My recommendation is to take the ideas that are in that code and rewrite them to make them work, if you're stuck on that dojo implementation. If you're not up to that task then I suggest you look at several on Django Snippets: Jquery: http://www.djangosnippets.org/snippets/269/ YUI: http://www.djangosnippets.org/snippets/392/ If neither of those suit you, contact me directly and I can send you some other code for a YUI implementation. Good luck. Michael Trier blog.michaeltrier.com On Jan 4, 2008 9:52 AM, mike <[EMAIL PROTECTED]> wrote: > > thx for the reply malcolm, I am trying to implement the Dojo select > box into one of my forms, I followed the instructions and i know the > javascript is working because I can get results by using the query > string in my browser, > > http://localhost:8000/myapp/reporter_lookup/?q= returns results, > The last part involves using a template tag (formtags.py) that comes > with the nong javascript package and loading it with a {% load > formtags %} statement then using a > > {% selectrow form.reporter "/myapp/reporter_lookup/?q=% > {searchString}" > "first_name" %} > > statement to spit out the code for the input box. This template tag is > no longer valid and cannot be imported so the select row statement > will no longer work > > On Jan 3, 8:36 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > > > On Thu, 2008-01-03 at 15:25 -0800, mike wrote: > > > I am trying to implement the Dojo Select box into a template I am > > > creating. > > > I have used the formtags that is inluded in the nongselect tar > > > package. but It seems with the development version of django the > > > import > > > statements {% load formtags %} no longer work, I need a way to > > > replace the > > > > You seem to be mixing up multiple problem reports here, but let's start > > with this one. The "load" tag still works in Django. So you should try > > to figure out why whatever third-party code you're using doesn't want to > > load with the development version. > > > > Regards, > > Malcolm > > > > -- > > No one is listening until you make a > > mistake.http://www.pointy-stick.com/blog/ > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How do I connect to development server with my browser?
http://www.djangoproject.com/documentation/django-admin/#runserver-optional-port-number-or-ipaddr-port "Note that the default IP address, 127.0.0.1, is not accessible from other machines on your network. To make your development server viewable to other machines on the network, use its own IP address (e.g. 192.168.2.1) or 0.0.0.0." Michael Trier blog.michaeltrier.com On Jan 2, 2008 12:12 AM, Keith <[EMAIL PROTECTED]> wrote: > > Greetings: > > I am an absolute beginner at Python / Django / Web development. (Old > school COBOL, VB desktop apps. developer trying to update my skills.) > My son gave me some space to play in on an Apache server he rents. I > set up Django, created my first project, and ran it in the > development server. Then the Definitive Guide to Django says to bring > up 127.0.0.1:8000 in my browser and I should see an "It worked" > message. I can't connect to this and, I suspect, this it's because > this is a local host address and I'm not local. Is there a way to > connect with the development server remotely? > > TIA > Keith > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Blogango - a blog software written with django
> Hi everyone, > Its almost the new year here, so Happy new year! > Let me just say a big thanks to every one on the django-users list, > who helped me with most of my questions, many of them inane. In > particular James Bennet and Malcolm Tredinnick were very helpul. > Django wont be as much fun without the great community. > Ah and let me plug the shiny new blogging app I wrote Blogango. Code > is available at http://code.google.com/p/blogango/source and is under > GPLv2. I have done a test install at http://test.blogango.com , you > can ogin as demo/demo. Take it for a test ride and let me know what > you think of it. Sugestions very welcome, I plan to work on it over > this month. > > A few thoughts I had while developing this, > 1. Should not each app must have a settings.py, instead of/apart from > a per project settings.py? For example IMHO templates should be > present under each app directory. If we had a per app settings.py we > can put this in settings.py. Templates can exist under each application provided you have the 'django.template.loaders.app_directories.load_template_source' TEMPLATE_LOADER in your settings.py, which is the default. > 2. I remember there was a huge discussion about changing > ADMIN_MEDIA_PREFIX on django-dev list. I have been bitten by this > behaviour each time I start a new project. Once you have a lot of > familairity with django, this wont make a difference, but people just > starting out, will be bitten. Yes, I agree. By the way, I suggest you map your admin media appropriately otherwise things don't look right and will be a distraction to people that may be interested in your software. Keep up the good work. Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: Problem with media_root, OLDPHOTO template
You need to provide more information. Django doesn't serve your media, so what are you using to serve media? Is it apache? If so you probably need to provide your apache conf for your site and information on where in your filesystem your media is stored. Michael Trier blog.michaeltrier.com On Dec 30, 2007 4:49 AM, eat <[EMAIL PROTECTED]> wrote: > > PLease anyone can help? > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to create an "iffirst" tag?
> I'm making a list of objects, and only including some of them in the output: > > {% for thing in mylist %} >{% if thing.test %} > {{thing}} >{% endif %} > {% endfor %} > > Now if I want to comma-separate the list, how do I do it? The natural > thing to my mind is an "iffirst" tag: > > {% for thing in mylist %} >{% if thing.test %} > {% iffirst %}Things: {% else %}, {% endiffirst %} > {{thing}} >{% endif %} > {% endfor %} > > {% iffirst %} is true the first time it is evaluated in each loop. > Because of the "if thing.test", it could be evaluated first on the third > time through the loop, for example. That's why forloop.first isn't > sufficient. > > I've tried creating such a tag, but can't find the contextual > information I need to know when the for loop has been restarted. > > (Also: the whitespace will be messed up even if I do have this tag: the > comma will have space before it). > > So, two questions: 1) How would I create a tag like this, and 2) is > there some simpler way to achieve my purpose? > the for loop has a forloop.first, see: http://www.djangoproject.com/documentation/templates/#for Creating your own tags is covered in http://www.djangoproject.com/documentation/templates_python/ I would look at the join filter though. http://www.djangoproject.com/documentation/templates/#join Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: Cannot redirect after login
> Also, I don't understand what the last tag is for, either. Any > help would be greatly appreciated. > The last form tag is an error. It should be the closing form tag Fix that and see if your problem persists. Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: How to add a parent class to the Poll class? (First tutorial)
On Dec 27, 2007 5:22 PM, Robert <[EMAIL PROTECTED]> wrote: > > Hi, Sorry about the misunderstanding. > > I am supposed to get this message when I try to add a new object: > > > However, after having added a foreign key in the poll class I receive > this error instead: > > "Poll has no attribute choice" > > Why? Did you do a reset? It sounds like you added the foreignkey after the fact and things are out of sync. A poll object should have a choice_set. Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: How to add a parent class to the Poll class? (First tutorial)
I'm not seeing the problem. You might try doing a reset (if you don't mind losing all your data) to be sure that the database is in sync. Michael Trier blog.michaeltrier.com On Dec 27, 2007 10:36 AM, Robert <[EMAIL PROTECTED]> wrote: > > Hi, > > I wanted to expand the Poll example in the first tutorial by > organizing polls in groups. I thought this could be done by simply > adding a Foreign key to the Poll class. > > from django.db import models > > class Pollgroup(models.Model): > name = models.CharField(maxlength=200) > > class Poll(models.Model): > pollgroup = models.ForeignKey(Pollgroup) > question = models.CharField(maxlength=200) > pub_date = models.DateTimeField('date published') > > class Choice(models.Model): > poll = models.ForeignKey(Poll) > choice = models.CharField(maxlength=200) > votes = models.IntegerField() > > However, when I now try to create a new object in the Choice class and > add it to an object in the Poll class, it says that the question > object has no choice attribute. I use a Python shell and follow the > same procedure as in the tutorial. > > >>> p = Poll.objects.get(pk=1) > >>> p.choice_set.create(choice='Not much', votes=0) > > > Why do I get this error message? > > I have django 0.96 installed. > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: forms.form_for_model
> Thanks for the reply I tried using the method you described and > searched the __init__.py, but just couldnt make any sense of it, > > def my_callback(field, **kwargs): > if f.name == 'customer': >return f.formfield(formfclass=forms.HiddenInput) Since you're receiving the field as 'field' that's what you need to use: See my post here: http://blog.michaeltrier.com/2007/11/23/customizing-newforms It shows exactly what you are trying to do in the section on formfield callbacks. Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: cannot run django with Apache
> Add this line in the urls.py > (r'^$','temp.helloworld.index'), > Your url pattern is not going to match a subfolder. Remember as you have it setup everything after the http://localhost/ is what will be sent to be matched. If you want to use /temp in apache as a sub, then you need also specify that in your url pattern: (r'^temp/$','temp.helloworld.index'), Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: Inheritance
> I have a lot of models for classifications. All of them have similar > attributes. When I try to use inheritance in the models design, the > admin interface doesn't work with ForeignKey fields. > > Example: > > class BasicModel(models.Model): > name=models.CharField(maxlength=30) > def __str__(self): > return self.name > > class Reference(BasicModel): > class Admin: > pass > > class Data(BasicModel): > ref = models.ForeingKey(Reference) > class Admin: > pass > > Here, the ref field doesn't show all of their records in the Admin Add > Data form. You will likely run into all kinds of problems. Model Inheritance is currently not supported in Django. There has been discussions and proposals on the topic so I suspect that it will be available at some point. See here: http://code.djangoproject.com/wiki/ModelInheritance Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: no one on the IRC?
> I have from time to time tried to bump into someone on the #django IRC. > Unfortunately, I always get a blank. > It seems the french and german #django channels are more active? > or maybe its my timezone (africa/lagos)? > can someone plese give me a hand on when i am likely to meet people on > #django? > btw - have been using it for 3 months now and am having the time of my > life... > Thanks Guys (and the occassional Gals (Carole Zieler)) Generally there's quite a few people there anytime day or night, since we have folks all over the world that hang out. You might have not received much response today with the holidays and last minute shopping for those that are celebrating Christmas. I'll be on and off throughout the day, so please do give us another try. :) Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: Templates, filesystem, caching?
On Dec 21, 2007 4:50 PM, SmileyChris <[EMAIL PROTECTED]> wrote: > > After reading this thread the other day, I decided to write up a patch > [1]. > > [1] http://code.djangoproject.com/ticket/6262 Of course you did. Always with the patches. :) P.S. Thank you Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: django newforms and base_fields
This is not a very secure thing to do. But if you must, then just use initial to set the value. Michael Trier blog.michaeltrier.com On Dec 20, 2007 2:32 PM, mike <[EMAIL PROTECTED]> wrote: > > Hello, I am looking for a way to auto-populate a newforms field, I > would like to have the input hidden, and be auto-populated with the > name field of the Customer class the Issue class is a foreign key to > the Customer class can anyone point me in the right direction, any > help would be appreciated, should I use base_fields or is there a > better way? > > > def add_edit_customer(request, id=None): >if id is None: > CustomerEntryForm = forms.form_for_model(Customer) >else: > IssueEntryForm = forms.form_for_model(Issue) > entry = get_object_or_404(Customer, pk=id) > issues = Issue.objects.filter(name=entry.name) > CustomerEntryForm = forms.form_for_instance(entry) > cust1 = Customer.objects.get(pk=id) > issues = Issue.objects.filter(customer=cust1) > IssueEntryForm.base_fields['customer'].widget = > widgets.HiddenInput() > IssueEntryForm.base_fields['customer'] = cust1.name > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Form result notices
> I'll look into it, but before I go too far down one track, could > anybody give some advice on how to approach it using sessions? Here's an example: http://staticallytyped.com/2007/05/17/rails-flash-now-for-django/ It's simply middleware that handles stuffing, retrieving, and clearing. Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: Foreignkey / Relationship / Views
I'm not sure where you are getting the "u" from. It should be user, such as: AppointmentParticipant.objects.filter(participant_user__pk=user.id).select_related() You don't really need the depth in this case, unless you have more to your models I'm not seeing. The rest of it looks fine. Michael Trier blog.michaeltrier.com On Dec 15, 2007 12:44 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello, > > Thanks for your answers which helped me a lot. > > Finally my models.py looks like: > > def appointments_all(request): > user = request.user > appointments = > AppointmentParticipant.objects.filter(participant_user__pk=u.id).select_related(depth=2) > return render_to_response('appointments_all.html', {"user" : > user, "appointments": appointments}, context_instance = > RequestContext(request)) > > > appointments_all generates a SQL statement with all the implicit joins > I need. > > So my appointments_all.html is similar to: > > ... > Appointments for {{ user.user_name }} > > > > {% for appointment in appointments %} > > {{ appointment.appointment.description }} > {{ appointment.appointment.start_timestamp }} > {{ appointment.appointment.end_timestamp }} > {{ appointment.participant_role.description }} > > {% endfor %} > > > ... > > > Yours, > 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?hl=en -~--~~~~--~~--~--~---
Re: Putting django on Amazon DB
On Dec 14, 2007 7:44 PM, James Bennett <[EMAIL PROTECTED]> wrote: > > On Dec 14, 2007 5:55 PM, Empty <[EMAIL PROTECTED]> wrote: > > As an aside, if the database backends were truly pluggable, like > > sessions, then we could prove the stability, usability, and commitment > > of the implementation without core commitment ahead of time. A brief > > search showed that this was discussed here: > > As I've already said, you can write a database backend, right now, and > use it with Django, right now, without needing it to be part of Django > itself. The DATABASE_BACKEND setting will -- in addition to the named > backends which ship with Django -- accept a dotted Python path to a > backend module and use that. All you need to do is write the code. I didn't read that from your original post and the investigating I did I did not find that, so that's great to know. Thanks so much. Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: Attribute Error on Dumpdata
Added ticket http://code.djangoproject.com/ticket/6155 with patch. Still need to write tests. Michael On Dec 7, 2007 3:15 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > > On Dec 7, 2007 2:31 PM, Empty <[EMAIL PROTECTED]> wrote: > > > > > > > > > Seems dumpdata is coded to require a Manager named 'objects' for the > Models > > > it dumps, even though (as described here: > > > http://www.djangoproject.com/documentation/model-api/#manager-names), > Django > > > does not require that a Manager named objects exists for all Models. > > > Whether this is just an oversight in dumpdata or a conscious decision I > > > can't say, though it looks like an oversight to me. > > > > You're correct Karen. This bit of code is the culprit: > > > >objects = [] > >for app in app_list: > >for model in get_models(app): > > > >objects.extend(model.objects.all()) > > > > How would you propose that it be done differently? I know that > > through object._meta.admin.manager will give you the first manager > > like the Admin works off of, but that is only populated if the Admin > > inner class is defined. I looked for the logic that does that but I > > couldn't find it. > > > > I believe it should be using _default_manager, which looks to be set to > track the first Manager defined for a Model. I think a (legitimate) Model > will always have _default_manager, while it may not always have objects. > > Karen > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Attribute Error on Dumpdata
> Seems dumpdata is coded to require a Manager named 'objects' for the Models > it dumps, even though (as described here: > http://www.djangoproject.com/documentation/model-api/#manager-names), Django > does not require that a Manager named objects exists for all Models. > Whether this is just an oversight in dumpdata or a conscious decision I > can't say, though it looks like an oversight to me. You're correct Karen. This bit of code is the culprit: objects = [] for app in app_list: for model in get_models(app): objects.extend(model.objects.all()) How would you propose that it be done differently? I know that through object._meta.admin.manager will give you the first manager like the Admin works off of, but that is only populated if the Admin inner class is defined. I looked for the logic that does that but I couldn't find it. Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: serving static files with apache on windows with mod_python
> to the apache httpd.conf file > but when i turn off debug in the settings file as well as turning > PythonDebug Off in the httpd.conf, > my media files (css,images,...) disappear. > I have also done > > SetHandler None > > as well as > > SetHandler None > > I have read that my media files should be symlinked to my apache docroot, > and got a tool 'junction' for doing that > on winnt. however, i could not make head or tail of it as the docs are not > very clear to me > Can somebody help me please? > Also have been trying to get #django on ircnode ercently but can't, any IRC is working fine, there are a bunch of us on there now. Hop on so we can walk you through this. If you still can't get on then please dpaste your httpd.conf, the whole thing for you django project. Also we will need your settings.py file. Michael Trier blog.michaeltrier.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?hl=en -~--~~~~--~~--~--~---
Re: mark form field as required in markup
Well each field has and id that in your case here appears as 'id_age'. So you can attach a style sheet item to that field directly but that will not do anything for the whole row. If you just wanted to add something to the label like 'Age *" so the user can see that it's required that way, then use the label_suffix option when creating the form. If you want to customize the output of the form, you either have to write out the contents yourself (http://www.djangoproject.com/documentation/newforms/#complex-template-output), or create your own as_??? construct that give you what you want. Michael Trier blog.michaeltrier.com On Dec 7, 2007 5:27 AM, Frank 7200 <[EMAIL PROTECTED]> wrote: > Hi group, > another question. Is there a way how to pass an information to markup that a > form field is required? > > I have this form with one field, which is required (default value). > > class CustomForm(forms.Form ): > age = forms.ChoiceField(label='Age', choices=AGE_CHOICES) > > > {{ form.as_table}} > > > This is what appears in the markup > < > tr>Age: label> id="id_age"> > "1" selected="selected">0-3 > > I would need something like because I would like > to highlite the whole table row. Or at least > > How can I do that? > > Thanks for any advice, > Frank > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: ordering. missing FROM-clause entry for table "locations_location"
Read this: http://www.mail-archive.com/django-users@googlegroups.com/msg37967.html and this: http://www.djangoproject.com/documentation/db-api/#order-by-fields Michael Trier blog.michaeltrier.com On Dec 6, 2007 10:21 AM, sector119 <[EMAIL PROTECTED]> wrote: > > Hi! > > I use current trunk and I can't order by location field. When I try, > I'he get an error: missing FROM-clause entry for table > "locations_location" LINE 1: ... FROM > "organizations_organizationoffice" ORDER BY "locations... ^ > Exception Location: /home/sector119/devel/django_src/django/db/ > backends/util.py in execute, line 18 > > Traceback: > params [] > self > sql 'SELECT > "organizations_organizationoffice"."id","organizations_organizationoffice"."parent_id","organizations_organizationoffice"."location_id","organizations_organizationoffice"."name","organizations_organizationoffice"."bank","organizations_organizationoffice"."account","organizations_organizationoffice"."bic","organizations_organizationoffice"."code","organizations_organizationoffice"."in_testmode","organizations_organizationoffice"."day_is_open" > FROM "organizations_organizationoffice" ORDER BY > "locations_location"."id" ASC LIMIT 100 ' > start 1196954101.1103859 > stop1196954101.1115961 > > "locations_location" is really missing in FROM-clause entry... why? > How can I get ordering I need? > > class OrganizationOffice(models.Model): > parent = models.ForeignKey('self', verbose_name=_('The related > parent office.'), null=True, blank=True) > location = models.ForeignKey(Location, verbose_name=_('The related > location.')) > name = models.CharField(_('Office'), max_length=50) > > def __unicode__(self): > return self.name > > class Meta: > verbose_name = _('Office') > verbose_name_plural = _('Offices') > ordering = ['locations_location.id', 'parent', 'id'] > > class Admin: > pass > > 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?hl=en -~--~~~~--~~--~--~---
Re: how to let textField accept only clear text?
Would it not be possible to run it through the striptags filter first and then pass it into markdown? Michael Trier blog.michaeltrier.com On Dec 2, 2007 9:50 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Sun, 2007-12-02 at 18:26 -0800, [EMAIL PROTECTED] wrote: > > i have field like this: > > body = models.TextField() > > i want it only accept text without HTML code? > > i used body=markdown.markdown(text,safe_mode = True), but this will > > repalce HTML code with "HTML_REMOVED". > > > > is there other way can make sure only text content? thanks! > > You could run it through BeautifulSoup ([1]) and then extract the > contents from each node in the tree. Not blindingly fast, but pretty > robust. > > [1] http://www.crummy.com/software/BeautifulSoup/ > > Regards, > 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?hl=en -~--~~~~--~~--~--~---
Re: Django's doctest clashes with coverage.py
I could be off base here but in regards to the the execution of translation initialization I believe that is occurring because the django.core.management.base attempts to switch the translation to english if the can_import_settings attribute is set: if self.can_import_settings: from django.utils import translation translation.activate('en-us') According to the docs this is done because django-admin (manage.py) executes some database stuff related to permissions. Since this is set to True by the BaseCommand this is likely the cause. You might try creating your own custom command that executes the test runner but only after setting this attribute to false and checking your results then. Michael blog.michaeltrier.com On Nov 24, 2007 12:03 PM, Marcin Kaszynski <[EMAIL PROTECTED]> wrote: > > One more comment after a day of writing unit tests: installing > coverage.py via a test runner is not a good idea. > > The test runner is executed pretty late and there is a chance that > part of your code gets executed earlier. I do not know if this is the > only possible case, but I had the code in appname/__init__.py files > executed during translation initialization, which is way before Django > even looks at the command line passed to manage.py. > > Right now my code detects the --with-coverage option and installs > coverage right in projectname/manage.py as the very first thing, > before importing any other module. This gives far more accurate > results. > > I still believe it would be a good idea to add the --with-coverage > option to Django, since it would make it a bit easier it for people to > do proper testing (and one less excuse not to do it right). If it > sounds good to you I can create a patch for that, moving the code that > installs coverage.py to django.core.management. > > -mk > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Detecting Object with Empty Relation Ship
I'm not sure I follow you completely, but I think my blog post on the subject of finding lookup items that are not being used may get you going in the right direction. http://blog.michaeltrier.com/2007/8/12/finding-lookup-items-that-are-not-used I hope it helps. Michael On Nov 23, 2007 5:54 AM, Manakel <[EMAIL PROTECTED]> wrote: > > Hello Dear All, > > I have the following models > > A --is linked via A-LINKS-- to B --is linked via B-LINKS to C. > > where A,B,C are models (ie Requirement, Test,Defect) > and A-LINKS is a N-N relationship between A & B using a third party > object. (intermediate table) > and B-LINKS is a N-N relationship between B & C using a third part > object. (intermediate table) > > I need to be able to query > 1)A object that have no relationship with B Object > (eg Requirement without Test) > 2) B Object that have no relationship with C Object > (eg Test without Defects) > 3) A Object without relationship with C Object > (eg Requirement without a Defect via a Test) > > I'm able using __XX__ syntax to queries Requirement THAT DOES have a > TEST but i don't understand how to negate the query. > > I hope i'm not too confusing :-) > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Django-based forum software?
http://code.google.com/p/counterpoint/ Empty blog.michaeltrier.com On 8/30/07, daev <[EMAIL PROTECTED]> wrote: > > http://code.google.com/p/diamanda/ > > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: error with Admin
On 8/13/07, john <[EMAIL PROTECTED]> wrote: > > On Aug 13, 6:58 pm, Collin Grady <[EMAIL PROTECTED]> wrote: > > Do you have "django.contrib.admin" in INSTALLED_APPS? > > yes > > > > Are the templates actually present in django/contrib/admin/ > > templates/ ? > > there is a directory /usr/lib/python2.5/site-packages/django/contrib/ > admin/templatetags/... > > "templatetags" but no "templates" - is this right ? > You should have a templates directory in that location. Sounds like something might be wacky with your install. > > Are the permissions on that directory and every directory above it > > such that the webserver can read them? > > yes Empty --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: a generic JSON serializer???
I have pulled together pieces to do this. I posted about it here: http://blog.michaeltrier.com/2007/7/30/json-generic-serializer I don't know if it's exactly what you're looking for, but check it out. Empty On 7/26/07, Eric St-Jean <[EMAIL PROTECTED]> wrote: > > Hi, > There does not seem to be an easy way to serialize anything to JSON: > serializers.serialize will handle a QuerySet > simplejson.dumps will handle normal python data structures > > But what about a python dict which has a django model instance in it, > for example??? Or a Field? > > Sure, i can (and did) write a trivial recursive function (it was a hack, > i should make it a proper serializer) which looks into the structure and > loops into the elements. > upon finding a list or dict or tuple, it calls itself. > Finding a queryset it calls serializers.serialize > Finding a base python type it calls simplejson.dumps > Finding a model instance, i made a stupid quick hack to get a queryset > which has that instance only, and then i call serializers.serialize on it. > > But i can hardly believe i'm the first one with this problem; did anyone > make a generic serializer, which will handle both python stuff and > django stuff (not just QuerySets)??? > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---