Re: Crispy forms not showing bootstrap and save/submit button

2017-07-13 Thread JHeasly
Also, do you have any FormActions defined? That's where the Bootstrap button comes from: http://django-crispy-forms.readthedocs.io/en/latest/layouts.html#bootstrap-layout-objects -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Crispy forms not showing bootstrap and save/submit button

2017-07-13 Thread JHeasly
Hello Taufiq — Have you tried using the "instance level helper"? See http://django-crispy-forms.readthedocs.io/en/latest/crispy_tag_forms.html#crispy-tag-with-forms >From the docs link above: from crispy_forms.helper import FormHelper class ExampleForm(forms.Form): [...] def

Re: Django with generic odbc database

2017-05-03 Thread JHeasly
I've had a good experience with the mxODBC Django Database Engine . (The web page says you can use the ORM, but elsewhere it clarifies that's only if you're using MS SQL Server 2005, 2008 and 2012.) But as Jani says, you do have to do all

Re: __unicode__ rather than __str__ in Part 2 of 'Writing you first Django app"?

2016-02-12 Thread JHeasly
Hi Simon — I was pretty sure I was missing something obvious. Thanks for pointing it out. — John -- 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

__unicode__ rather than __str__ in Part 2 of 'Writing you first Django app"?

2016-02-11 Thread JHeasly
In "Writing your first Django app, part 2" (https://docs.djangoproject.com/en/1.9/intro/tutorial02/), it's outlines adding a __str__() method to your models. But if you've got a unicode string that's called in the admin, you're going to get a big, unfriendly UnicodeEncodeError error when you

Re: utf-16le encode generic view object_list

2015-05-22 Thread JHeasly
@Tim: render_to_string! Forgot about that, somehow. That could clean it up a bit. Thanks! @Stephen: Thanks for the feedback. This app's running internally and is on insecure and ancient 1.4, but the mimetype parameter reminder is a good one! Thank you. -- You received this message because

utf-16le encode generic view object_list

2015-05-21 Thread JHeasly
Hello all, I've got a function-based generic view that I want to return a utf-16le encoded response (for use as an InDesign tagged text file; the utf-16le is what InDesign wants). I've got it working here <https://gist.github.com/jheasly/0f7c53eec6d92905e127>, but am wondering if t

Re: Sharing templates across multiple projects

2015-03-09 Thread JHeasly
Thanks for the feedback Simon & Ilya. I've done submodules in Git before, but I think I'll keep the templates in a separate repo and symbolic link to the repo ... -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Sharing templates across multiple projects

2015-03-06 Thread JHeasly
Hello — I'm looking for any blogposts/best practices for deploying a common set of templates across multiple Django projects. My initial impulse is to just make a master Github repo of the template and pull it into each of the projects. Are there better approaches? TIA, John -- You received

Re: HELP with unicode!!!!!

2012-05-01 Thread JHeasly
Also, have a look at this slidedeck: http://farmdev.com/talks/unicode/ It's from a PyCon 2008 talk, "Unicode In Python, Completely Demystified" A video of the talk is at http://www.youtube.com/watch?v=cecJ9o5GGmw, but the audio's miserable, and the slides are pretty good, so it may be all you

Re: admin list_filter: limit choices to model values?

2012-01-30 Thread JHeasly
In 1.4/trunk, looks like filterspec.py gets replaced by filters.py (as part of adding the ability to filter a list_filter), so we'll just sit tight and wait for 1.4 to be released (rather than have to go back and remove the defunct filterspec code). — John -- You received this message

Re: Using the same storage backend for media and static files.

2011-11-05 Thread JHeasly
Hi Ian — You might get better traction with your question over on the django-developerslist. And thanks for your django-storages work! — John -- You received this message because you are subscribed to the Google Groups "Django

Re: Having trouble overriding template_object_name for the list_detail in generic view

2011-02-11 Thread JHeasly
You need to closely read the second sentence of template_object_name item in the *Optional arguments* section of the generic view bject_list docs. Based on the template_object_name in your

Re: admin panel fieldsets for different type of users?

2010-09-03 Thread JHeasly
Also wondering the exact same thing, so +1 on any pointers/hints/ help ... On Aug 1, 3:50 am, gondor wrote: > I use formset in my admin panel to group/title my related fields. > This works great except when I go to exclude some fields for lesser > users. > > In the simple

Re: what do you do to take your site down?

2010-08-06 Thread JHeasly
Also, see "Maintenance Mode for Django Sites" http://www.weavingtheweb.com/professional-blogs/78-maintenance-mode and this related link http://pypi.python.org/pypi/django-maintenancemode/ HTH, John On Aug 6, 9:24 am, Margie Roginski wrote: > Thank you very much - that

Re: Dynamic data into a form

2010-07-05 Thread JHeasly
Hi Plaoto, The blog post below is about the Admin, but I think the principles may apply to your situation: Runtime ChoiceField filtering in Django’s admin http://www.artfulcode.net/articles/runtime-choicefield-filtering-in-djangos-admin/ HTH, John On Jul 5, 1:43 am, Plaoto

Clean method across multiple models?

2010-06-16 Thread JHeasly
Hello all, Is there a sane way to make a clean [1] method that depends on fields from across multiple models? I've got a view that uses two form classes and want to write custom validation that checks clean_data fields in both models and I'm looking for an example of such. TIA, John [1]

Re: Working for a startup.

2010-04-22 Thread JHeasly
There's also this: http://kurtgrandis.com/blog/2010/02/24/python-django-vs-c-asp- net-productivity-showdown/">Python + Django vs. C# + ASP.NET: Productivity Showdown >From the above: "People are often asking me how and why my department shifted from an ASP.NET environment to Django. I’ve

Re: Order model objects by foreign key "set" count

2010-03-11 Thread JHeasly
This post was exactly was I was looking for! Just a reminder, don't forget to from db.models import Count On Jan 11, 8:51 pm, Margie Roginski wrote: > Ah - yes, that is so awesome!  For anyone interested, here's the magic > incantation: > >

Good way to modify admin list_filter based on is_superuser?

2009-11-20 Thread JHeasly
In using Simon W.'s "simple example of row-level permissions in the admin" (http://www.djangosnippets.org/snippets/1054/), I'm trying to extend the concept by modifying the 'list_filter' tuple of the subclassed ModelAdmin based upon the request.user.is_superuser property buy am struggling with

Re: default blank choice on form.Form select widget

2009-08-07 Thread jheasly
ticket 4092 into trunk ... - John On Aug 5, 1:49 pm, Paulo Almeida <igcbioinformat...@gmail.com> wrote: > Did you see this ticket? > > http://code.djangoproject.com/ticket/4092 > > Maybe you can use the patch code to customize your field. > > - Paulo > > On Wed, Aug

Re: default blank choice on form.Form select widget

2009-08-05 Thread jheasly
Hey Paulo, No I hadn't seen the ticket. Thanks for the heads up. Hard to tell from Trac what is holding up 4092. I see 10969 is more recent, but a different angle of attack on the issue. — John --~--~-~--~~~---~--~~ You received this message because you are

default blank choice on form.Form select widget

2009-08-05 Thread JHeasly
The doc page "Creating forms from models" (http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#topics- forms-modelforms) describes how "If the model field has choices set ... [snip] ... The choices will normally include the blank choice which is selected by default. ... " I have a form

Count the number of times FormPreview displays preview?

2009-03-18 Thread JHeasly
Hello all, Using Django's sessions, I want to keep track of how many times a user displays the FormPreview preview. After a given number of re-displays, I'd like to redirect the user (via an HttpResponseRedirect) to a help page. I'm trying to discern if this is A.) a feasible workflow and B.)

Re: django-contact-form contexts?

2009-01-16 Thread JHeasly
Hello Ryan, Admittedly the docs at http://django-contact-form.googlecode.com/svn/trunk/docs/overview.txt just say you need to create the template files "contact_form/ contact_form_subject.txt" and "contact_form/contact_form.txt" and not much else, but in "contact_form_subject.txt" you need to

date_hierarchy on a ForeignKey?

2007-12-20 Thread JHeasly
My hunch is the answer is "No," but is it possible to do a 'date_heirarchy' on a ForeignKey date object? Haven't been able to find anything in the archive on the topic. Pointers gratefully accepted. John --~--~-~--~~~---~--~~ You received this message because you

Re: Why are 'greater than', 'less than's getting rendered as HTML entities?

2007-12-04 Thread JHeasly
d) a point in the *right* direction. (I'll read all the docs a'fore wondering about how much magic's taking place : ) ) Anyways, *many* thanks James! On Dec 4, 1:04 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 12/4/07, JHeasly <[EMAIL PROTECTED]> wrote: >

Why are 'greater than', 'less than's getting rendered as HTML entities?

2007-12-04 Thread JHeasly
Hello, I'm missing something somewhere. Somebody please point me in the right direction. I'm using Rev. 6865. My view.py: def foo(request) : return render_to_response('classifieds/blank.html', { 'content': "", }, mimetype

Re: remember me feature

2007-08-01 Thread JHeasly
Hey James, This might get you going in the right direction: "The default SessionMiddleware that comes with Django lets you pick if you want all sessions to be browser-length or persistent, if you want to use different types of sessions based on a users preference (e.g. the good old "Remember

More of a lighttpd question (I think)

2007-07-31 Thread JHeasly
I keep getting this loop in my lighttpd error log: 09:41:07: (mod_fastcgi.c.3457) all handlers for /mysite.fcgi/ classifieds/topjobs/5/ on /mysite.fcgi are down. 09:41:12: (mod_fastcgi.c.2669) fcgi-server re-enabled: unix:/usr1/ local/oper/class.sock 09:41:18: (mod_fastcgi.c.1739) connect

Re: Working '/comments/flag/[comment.id here]/' examples?

2007-07-03 Thread JHeasly
> Ah, ok. Yeah, this has been broken a long while. Well, I guess that's a good reason for it not to work! : ) > The comments contrib needs some love, but I understand Jacob's working > on a rewrite Good deal! I look forward to it. > But you're in luck; I recently ported from an old version

Re: Working '/comments/flag/[comment.id here]/' examples?

2007-07-02 Thread JHeasly
On Jun 29, 6:05 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > Very odd. UserFlag has an objects attribute which is an of > UserFlagManager. Looking at the svn source, I don't see how UserFlag > in views.userflags.flag() could refer to a UseFlagManager object > rather than the UserFlag model.

Working '/comments/flag/[comment.id here]/' examples?

2007-06-29 Thread JHeasly
Hello, I've been poking around the SVN Comments and django.contrib.comments.views.userflags. I've got the URL "/comments/flag/[comment.id here]/" working the "first" time, i.e. like it's used on an ljworld.com story page, where it returns an "are you sure?" page and a "Yes, go ahead" form

Re: Common problem? Grouping date based objects by year?

2007-01-17 Thread JHeasly
Hi Rob, Try something like this (untested): {% regroup news_list by year as grouped %} {% for group in grouped %} {{ group.grouper }} {% for item in group.list|dictsort:"year" %} {{ item.date_posted|date:"F Y" }}

"Decimal not JSON serializable"?

2006-12-18 Thread JHeasly
Hello all, I'm following the "Serializing Django objects" documentation and have a view pretty much verbatim from the docs: def my_json_view(request): data = serializers.serialize("json", Location.objects.all()) return HttpResponse(data, mimetype='text/javascript') My Location model

Lighttpd log timestamp

2006-11-03 Thread JHeasly
It's more of a Lighttpd issue, (I've Googled, posted to the Lighttpd wiki and e-mailed and heard nothing back ... ) but I'm serving Django with the Lighttpd/flup/FastCGI combo which works fine. The problem is I can't get the proper time zone to show up in the access logs. The timestamps are GMT

RSS syndication and URLs

2006-10-17 Thread JHeasly
Just to verify, to get something like the "complex example" of the docs (http://www.djangoproject.com/documentation/syndication/) to work -- where feeds publish different data for different URL parameters -- is there anything special you need to do to the URLConf regex? Is (r'^rss/(?P.*)/$',

Re: Mysql 3.23.xx

2006-10-10 Thread JHeasly
James Bennett wrote: > > I can't think of anything we do that would break it, but I also don't > know nearly enough about ancient versions of MySQL. If you have a "date_hierarchy" in your models.py, it will break with MySQL 3.23.53 as Django builds a query that uses "CAST()", which didn't exist

Re: Using Django in a Cron Job

2006-08-09 Thread JHeasly
Steven Armstrong wrote: > On 08/09/06 17:56, Joe wrote: > > I would like to set up a python script that runs every night to send > > out an email subscription. I would like to access a Django model that > > has the user's email addresses, as well as use the Django sendmail > > function. Can

Re: Declare a variable in a template

2006-08-04 Thread JHeasly
Don Arbow wrote: > > list_1 = Shows.objects.filter(upcoming=True) > list_2 = Shows.objects.filter(past=True) > > return render_to_response('template.html' > {'upcoming_shows':list_1, 'past_shows':list_2}) > > Don Don, Thanks for the clean, clear example! It helped me see a way out in a

Re: error in your SQL syntax near '(DATE_FORMAT... on adding date_hierarchy = 'pub_date'

2006-06-13 Thread JHeasly
Andy Dustman wrote: > ... [snip] ... > Your original error was: "You have an error in your SQL syntax near > '(DATE_FORMAT(`polls_poll`.`pub_date`, '%Y-01-01 00:00:00') AS > DATETIME) FROM `p' at line 1" I'm going to guess that the bit before > the leading parenthesis is "CAST", and CAST() does

Re: html input tag width corresponding to CharFields always fixed

2006-05-30 Thread JHeasly
Is there a way to fold this into a model that uses only generic views (i.e., without getting into custom manipulators)? And if so, an example would be humongously appreciated! John H. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Three models linked together: how do i do (...) ?

2006-05-04 Thread JHeasly
For a some ideas, you might want to have a look at Paul Bissex's twenty minute trouble ticket system: http://e-scribe.com/news/230 John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: load comments

2006-05-04 Thread JHeasly
Adrian Holovaty wrote: > > Hi John, > > Yes, that's the proper "fix." The comments app is an add-on; we'd > rather not force the installation of those database tables for every > Django user, so it's up to you to opt into installing it. Hello Adrian, Yeah, I got caught up in that infectious

load comments

2006-05-03 Thread JHeasly
I watched Jacob's great Bay Area Google video and had never seen any of that nifty {{ load comments }} stuff before. Eager to give it a try, I was sad when I added it to polls app tutorial results.html template and it broke. I fixed it by adding 'django.contrib.comments', to the INSTALLED_APPS

Re: How to get vote total in poll tutorial

2006-03-31 Thread JHeasly
Ah! You're correct. I get it now. 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,

Re: How to get vote total in poll tutorial

2006-03-29 Thread JHeasly
> > Then you probably want it to read: > choices.get_values(fields=['poll', 'votes'], poll_id__exact=1) > > i.e. your "field" is "poll_id" and the lookuptype is "exact" > which translates to "poll_id__exact", and THEN the equals sign > and what value you are asking it to match. > > -- > Glenn