Custom model field/form: __init__() got multiple values for keyword argument 'baz'

2011-09-20 Thread mhulse
Hello, The problematic code can be found here: TypeError: __init__() got multiple values for keyword argument 'baz' I have spent the last couple days trying to figure out how to pass a kwarg from model to fields/forms (and eventually to a widget). TBTH, I ha

Re: Need help getting this snippet to work in Django 1.2...

2011-06-10 Thread mhulse
Hi Martin! Thanks so much for the help, I really appreciate it. :) > The snippet is a form field, not a model field. Well, that would explain things! Lol. When I read this in the instructions: "Usage eg: yob = BirthYearField(label="What year were you born?")" I thought that was a model field.

Need help getting this snippet to work in Django 1.2...

2011-06-10 Thread mhulse
I feel like this should be simple... I would like to replace this model field: date = models.DateField(_(u'Year'), unique=True) ...with this snippet: http://djangosnippets.org/snippets/508/ I have spent the last couple hours banging my head on my keyboard... During the course of my tests, at

Custom select_related()

2011-06-07 Thread mhulse
Hello, I have a M2M field... class A(models.Model): foo1 = models.ManyToManyField('B', related_name='foo1_set' ...) foo2 = models.ManyToManyField('B', related_name='foo2_set' ...) ... When I run: ...foo.select_related() I get all of the B entries related to A instance. I would lik

ManyToManyField limit_choices_to that instance via Django admin.

2011-06-06 Thread mhulse
Hello, Here's some example code: [code] class Creative(...): file2 = models.ManyToManyField('Asset', ...) class Asset(...): file = models.FileField(...) [/code] Can I use limit_choices_to to limit "Asset" to only the files that were uploaded by the currently viewed "

created/modified base abstract class?

2011-05-23 Thread mhulse
In my latest project I have have a few models that need to have a created/modified date/time non-editable fields. I was wondering what would be the best way to handle this... Should create a base abstract class: https://gist.github.com/987022 ... and have the models that need those fields exte

Re: custom tag and filtered value

2010-07-20 Thread mhulse
On Jul 20, 2:57 pm, owidjaya wrote: > how can i pass a filtered value to a custom tag? +1 from me. I just asked a similar question here: "Template tag does not like parameters with filters ({% with foo as bar %} question)" I was not sure what to Google for, that is

Re: www.djangoproject.com

2010-07-02 Thread mhulse
> try rebooting, but there could be other DNS caches between you and a > good name server. If that's the case, would OpenDNS be of any help? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Practical Django Projects 2: Weblog urls.py help...

2010-05-11 Thread mhulse
> I think the problem is due to the month digit... The book opted to use > the 3-letter month name vs the two digits... I personally like the > month as digits so I changed the urls.py and models.py to use %m. My coworker solved this problem for me: entry_info_dict = { 'queryset': Entry.o

Practical Django Projects 2: Weblog urls.py help...

2010-05-09 Thread mhulse
Hi, I am working my way through Practical Django Projects, 2nd addition, and I am having troubles getting the weblog permalink url to function. >From my urls.py: === entry_info_dict = { 'queryset': Entry.objects.all(), 'date_field': 'pub_date', } ... ... (r'^(?P\d{4}

Re: Template not displaying validation errors [solved]

2010-05-05 Thread mhulse
Hi Karen! Thanks so much for your quick reply, I really appreciate it. :) > form.is_valid() is what annotates the existing form with error information > in the case where there are errrors. However, if form.is_valid() returns > False, the code here immediately overwrites the existing (now annotate

Template not displaying validation errors

2010-05-05 Thread mhulse
Hi, I have spent half the day googling and testing my code with no luck getting an error message to appear via my template. I am hoping ya'll could provide a little assistance. :) forms.py: class SearchForm(forms.Form): q = forms.CharField( max_length = 128,

Re: Noob questions: Syntax, Python listserv, utility/helper methods?

2010-05-05 Thread mhulse
> HTH, Very much so! Thanks so much Peter, I really appreciate your help. :) One last question: I have been working with django-schedule (just been doing the templating) and I noticed that the author of that code prepended underscores to all of his included files: ... _detail.html _dialogs.html

Noob questions: Syntax, Python listserv, utility/helper methods?

2010-05-04 Thread mhulse
I come from the PHP/CodeIgniter/Actionscript/Other world I am slowly learning Django and Python. + Question 01: Sorry if OT... This is kinda more of a Python question. :( In as3 oop, I like to do this (for example): = ... public class ClickTag { // Private:

Re: Nested for loop: {% cycle ... %}

2010-03-25 Thread mhulse
> As I understand it, {{ foo }} renders the current value of the > variable and doesn't change it. > {% cycle foo %} or the creating {% cycle "odd" "even" as foo %} > advance the variable and > then render it.  So you still need one of the latter in your loop, or > the variable won't advance. Ahhh

Re: Nested for loop: {% cycle ... %}

2010-03-25 Thread mhulse
Hi Peter and Bill! Thanks for the quick replies, I really appreciate it. :) @Peter: I tried this: == {% for foo, baz in tuple %} ... ... {% cycle "odd" "even" as foo %} {% for bar in baz %} ... ... {% endfor %} ... ... {% endfor %} == But the cycle "renders" the output and t

Nested for loop: {% cycle ... %}

2010-03-25 Thread mhulse
Hi! Example code: == {% for pretty_date, days_events in date_days_events_tuple %} ... ... {% for details in days_events %} ... ... {% endfor %} ... ... {% endfor %} == The output: == .. .. ... == What I really want: == .. .. ...

Re: Noob question: Templates: How to count for loop?

2010-02-16 Thread mhulse
Many thanks for the help rebus_ and Daniel! All of your suggestions, code samples, and links have been extremely helpful. I appreciate it. Have a great day! Cheers, Micky -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread mhulse
> You could do it like this. There was a discussion recently about mod > operator and what happens when you want to do something every N times > but can't find it now for some reason :( Ah, interesting! Thanks for the code sample, I really appreciate your assistance. I will search around for the

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread mhulse
> Check out "cycle" template tag too. > http://docs.djangoproject.com/en/dev/ref/templates/builtins/#cycle Thanks rebus_! I have played with that just a little bit. I will explore it further. Cheers, Micky -- You received this message because you are subscribed to the Google Groups "Django us

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread mhulse
> Hrmm, forloop.counter. It is one of those days. :P But, how can I tell if it is every third item? Also, is there a way to check if the current number is even? In a PHP template, I might do this: ... forloop ... ... endforloop ... Sorry if silly question. Thanks! M -- You received this me

Re: Noob question: Templates: How to count for loop?

2010-02-15 Thread mhulse
> Is this possible? I am sure it is... Any tips ya'll could send my way > would be spectacular! Hrmm, forloop.counter. It is one of those days. :P -- 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...

Noob question: Templates: How to count for loop?

2010-02-15 Thread mhulse
Hi, In my template: {% for photo in photos %} stuff {% endfor %} Is this possible? I am sure it is... Any tips ya'll could send my way would be spectacular! Thanks! Micky -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: Date/time field styling?

2009-08-11 Thread mhulse
Hi! > Look at the SplitDateTimeWidget in django.forms.widgets. I am sorry to be a complete noob here, but I am not sure how I can use SplitDateTimeWidget to break-up the two dat/time fields? I am actually using django-schedule: Looks lik

Re: Date/time field styling?

2009-08-04 Thread mhulse
For those interested, I found this link via browsing the django-html git source: Django Developers: Proposal: Form rendering with filters Looks interesting. Unfortunately, I am still a noob, so I probably won't be able to cross that bridge for a while. :) Thanks agai

Re: Date/time field styling?

2009-08-04 Thread mhulse
Thanks Alex and Malcolm! I really appreciate the help. :) Have a great day/night. Cheers, Micky --~--~-~--~~~---~--~~ 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

Date/time field styling?

2009-08-03 Thread mhulse
Hello, {{ form.start }} For example, outputs this: I have tried: {{ form.start_0 }} and {{ form.start_1 }}, but that outputs absolutely nothing. :) Is it possible to split up the two fields so I can handle them individually? Also, is it possible to control the XHTML output? I prefer use a

Re: Ajax-based generic views?

2009-07-22 Thread mhulse
> How do we implement ajax-based generic views? I am also a noob, but I personally would google: django and jquery Seems like Django is one beast to tackle, and Jquery is another. Cheers, M --~--~-~--~~~---~--~~ You received this message because you are subscri