Re: How to use password hasher snippet in Django?

2015-01-22 Thread Tom Lockhart
On Jan 22, 2015, at 4:42 PM, Supermario wrote: > Many thanks for your help Thomas. Indeed I am in the middle of big escape > effort to get the heck away from Drupal. > > I tested your snippet in the shell and DrupalPasswordHasher hashes perfectly > well there. > > Howe

Re: How to use password hasher snippet in Django?

2015-01-22 Thread Supermario
Many thanks for your help Thomas. Indeed I am in the middle of big escape effort to get the heck away from Drupal. I tested your snippet in the shell and DrupalPasswordHasher hashes perfectly well there. However, when I integrate the hash into my project as per your explanation, django

Re: How to use password hasher snippet in Django?

2015-01-21 Thread Tom Lockhart
On Jan 21, 2015, at 3:07 PM, Supermario <human...@gmail.com> wrote:I am trying to move Druap 7 site to django 1.7 without invalidating user passwords, and this proved to be daunting.Fortunately, I have found this SO question and this hashing snippet but there is no documentation and as a new

How to use password hasher snippet in Django?

2015-01-21 Thread Supermario
/snippets/3030/> hashing snippet but there is no documentation and as a newbie to django, I have no clue how to integrate the snippet into my project. So greatly appreciate your help about this. -- You received this message because you are subscribed to the Google Groups "Django

Re: Using multiple model files per app with the Improved Multiple Model Files Django Snippet

2013-06-01 Thread Doug S
Awesome, thanks, I love python but I am not (yet) skilled at the art of incantation. The snippet above: http://djangosnippets.org/snippets/1838/ did have some incantation but the post was fairly old in terms of django/python's history. I can't tell one incantation from another but I

Re: Using multiple model files per app with the Improved Multiple Model Files Django Snippet

2013-05-30 Thread Mike Dewhirst
= appname __all__.append(decl.__name__) django.db.models.loading.register_models(appname, decl) except: pass I don't understand this code, but hopefully I don't have to. I just want to be able to import my individual model modules: models1.py &models2.py from my views and admin.py the impor

Using multiple model files per app with the Improved Multiple Model Files Django Snippet

2013-05-30 Thread Doug S
vidual model modules: models1.py & models2.py from my views and admin.py the import statements are not included in the snippet and I've tried what seems reasonable and keep getting errors importing the modules saying they don't exist I would expect you do something like import mya

Re: template for "Pagination for admin inlines" snippet

2013-02-06 Thread Axel Rau
Am 05.02.2013 um 22:16 schrieb Conor Pollock: > I'm currently trying to figure this out as well... I can pass a page query > in the url and everything works as expected, but I can't figure out how to > render the pagination controls in my template file. > > Did you ever get this to work? No,

Re: template for "Pagination for admin inlines" snippet

2013-02-05 Thread Conor Pollock
I'm currently trying to figure this out as well... I can pass a page query in the url and everything works as expected, but I can't figure out how to render the pagination controls in my template file. Did you ever get this to work? On Monday, 8 October 2012 10:37:09 UTC-4, axel...@chaos1.de w

template for "Pagination for admin inlines" snippet

2012-10-08 Thread Axel Rau
Hi, anybody got a template working for this https://gist.github.com/559911 ? I have no idea how to fiddle it into the admin template system. Thanks, Axel --- PGP-Key:29E99DD6 ☀ +49 151 2300 9283 ☀ computing @ chaos claudius -- You received this message because you are subscribed to th

Re: In views.py snippet of Code

2012-03-15 Thread Sami Balbaky
Thank you Kevin, problem solved. I'm actually reading the book from www.djangobook.com. I need to cross reference with the documentation on www.thedjangoproject.com. Best, SB On Thu, Mar 15, 2012 at 11:43 AM, Kevin Wetzels wrote: > > > On Thursday, March 15, 2012 7:32:53 PM UTC+1, Django_for_S

Re: In views.py snippet of Code

2012-03-15 Thread Kevin Wetzels
On Thursday, March 15, 2012 7:32:53 PM UTC+1, Django_for_SB wrote: > > Hi All, > > I'm using render_to_response() in my views.py module. And of course, > I've imported the method: > > "from django.shortcuts import render_to_response" > > # This is the code that's generating the error: > def

In views.py snippet of Code

2012-03-15 Thread Django_for_SB
Hi All, I'm using render_to_response() in my views.py module. And of course, I've imported the method: "from django.shortcuts import render_to_response" # This is the code that's generating the error: def hours_ahead(request, offset): try: offset = int(offset) except ValueError:

Re: Django Snippet imports?

2012-02-03 Thread msbuck
Yes you need to put register = template.Library() in your module. See https://docs.djangoproject.com/en/1.3/howto/custom-template-tags/ for more info on where this code should reside. On Feb 3, 9:17 am, Jesramz wrote: > source:http://djangosnippets.org/snippets/847/ > > from django.contrib.auth.m

Re: Django Snippet imports?

2012-02-03 Thread Jesramz
source: http://djangosnippets.org/snippets/847/ from django.contrib.auth.models import User, Group from django.utils.encoding import force_unicode from django import template Missing anything? Would I have to use 'register = template.Library()' ? -- You received this message because you are s

Django Snippet imports?

2012-02-02 Thread Jesramz
What would I have to import to use the following snippet (source: http://djangosnippets.org/snippets/847/)? @register.filter def in_group(user, groups): """Returns a boolean if the user is in the given group, or comma- separated list of groups. Usage:: {% i

Re: help optimizing a snippet

2011-12-06 Thread Tom Evans
On Tue, Dec 6, 2011 at 2:24 PM, Felipe Morales wrote: > Hi, > > Maybe I can't understand you, but try with > > u = User.objects.filter(groups__name__in = > gruppe).exclude(groups__name__in='Timesheet-Boss','TimeSheet-Manager','Projektleiter','Normal-User','Manager']).values_list('id', > 'username'

AW: help optimizing a snippet

2011-12-06 Thread Szabo, Patrick (LNG-VIE)
izing a snippet Hi, Maybe I can't understand you, but try with u = User.objects.filter(groups__name__in = gruppe).exclude(groups__name__in='Timesheet-Boss','TimeSheet-Manager','Projektleiter','Normal-User','Manager']).values_list(&#

Re: help optimizing a snippet

2011-12-06 Thread Felipe Morales
Hi, Maybe I can't understand you, but try with u = User.objects.filter(groups__name__in = gruppe).exclude(groups__name__in= *'Timesheet-Boss'*,*'TimeSheet-Manager'*,*'Projektleiter'*,*'Normal-User'*,* 'Manager'*]).values_list('id', 'username') 2011/12/6 Szabo, Patrick (LNG-VIE) > Hi, > >

Re: help optimizing a snippet

2011-12-06 Thread Tom Evans
On Tue, Dec 6, 2011 at 1:42 PM, Szabo, Patrick (LNG-VIE) wrote: > Hi, > > > > I’v got this piece of code: > > > > def get_my_choices(gruppe): > >     users = User.objects.all() > >     choices_list = () > >     for user in users: > >     try: > >     for groupe in gruppe: > >  

help optimizing a snippet

2011-12-06 Thread Szabo, Patrick (LNG-VIE)
Hi, I'v got this piece of code: def get_my_choices(gruppe): users = User.objects.all() choices_list = () for user in users: try: for groupe in gruppe: for groupe2 in user.groups.all(): if groupe2 == groupe and (user

Re: snippet

2011-07-27 Thread Stuart MacKay
Rahul, Not everything posted to djangosnippets is working code. The ratings and number of comments is your best guide as to the quality of the solution. If you use your favourite search engine for "django admin drag and drop" you have lots of alternatives - snippet 2306 does not sho

snippet

2011-07-25 Thread rahul jain
Tried this snippet but not working http://djangosnippets.org/snippets/2306/ Anyone else tried it, I would like to drag and drop rows on django admin. Thanks. RJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

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

2011-06-13 Thread Micky Hulse
On Mon, Jun 13, 2011 at 9:44 AM, Micky Hulse wrote: > Ooh, great tip! That looks very useful and possibly a little more > simple/straight-forward than using a form field. Too easy! https://gist.github.com/1023327 Thanks for the help Martin and Alex, I really appreciate it! :) Have an awesome d

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

2011-06-13 Thread Micky Hulse
Hi Alex! Thanks for the reply, I really appreciate it. :) On Sun, Jun 12, 2011 at 9:01 PM, Alex Kamedov wrote: > It'll be better to use validators with IntegerField > In this case you can specify allowed year range. Ooh, great tip! That looks very useful and possibly a little more simple/straigh

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

2011-06-12 Thread Alex Kamedov
hanks 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 y

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

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

2011-06-10 Thread Martin
I think this is not how it works. The snippet is a form field, not a model field. Basically I think you should use an IntegerField (you just want to store a year, right?). Then somehow you need to override the widget or so and make sure that in the admin that form will be used for that

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

Re: how use this snippet

2011-05-18 Thread Tonton
TOM > It's a management command. It belongs in > /management/commands/.py, and you then run it by > calling "python manage.py ". > > More on management commands: > http://docs.djangoproject.com/en/1.3/howto/custom-management-commands/ > > Yes Tom ! i never heard this before so i think it will be

Re: how use this snippet

2011-05-17 Thread Gabriel Gunderson
On Tue, May 17, 2011 at 10:33 AM, Tom Evans wrote: > I don't mean to sound glib, but (almost) everything is detailed in the > very fine manual. Read, re-read and re-re-read the manual - even the > boring bits! I think it's important to remember that one of the strengths of Django is its docs. Th

Re: how use this snippet

2011-05-17 Thread AJ
Thanks for the great advice Tom. On Tue, May 17, 2011 at 12:33 PM, Tom Evans wrote: > On Tue, May 17, 2011 at 5:04 PM, AJ wrote: > > Many times I do not know how to use some snippets on djangosnippets.org. > has > > anyone else felt the same? I, obviously, am a newbie. > > > > I don't mean to so

Re: how use this snippet

2011-05-17 Thread Tom Evans
On Tue, May 17, 2011 at 5:04 PM, AJ wrote: > Many times I do not know how to use some snippets on djangosnippets.org. has > anyone else felt the same? I, obviously, am a newbie. > I don't mean to sound glib, but (almost) everything is detailed in the very fine manual. Read, re-read and re-re-read

Re: how use this snippet

2011-05-17 Thread AJ
uderstand how to use this snippet > > > > http://djangosnippets.org/snippets/2225/ > > > > i don't understand how it works and if it's work > > > > does anyone use it before ? > > > > regards > > > > T. > > > > I

Re: how use this snippet

2011-05-17 Thread Tom Evans
On Tue, May 17, 2011 at 4:49 PM, Tonton wrote: > hello > > i'd like to uderstand how to use this snippet > > http://djangosnippets.org/snippets/2225/ > > i don't understand how it works and if it's work > > does anyone use it before  ? > > regards

how use this snippet

2011-05-17 Thread Tonton
hello i'd like to uderstand how to use this snippet http://djangosnippets.org/snippets/2225/ i don't understand how it works and if it's work does anyone use it before ? regards T. -- You received this message because you are subscribed to the Google Groups "Django u

Re: Reusing a code snippet

2011-04-12 Thread Sithembewena Lloyd Dube
Thanks Daniel :) On Tue, Apr 12, 2011 at 12:20 PM, Daniel Roseman wrote: > On Tuesday, April 12, 2011 11:17:15 AM UTC+1, Lloyd Dube wrote: >> >> Hi Daniel, >> >> Thanks. I would think that plugging about in the default django >> installation would not be good practice - can that file simply resid

Re: Reusing a code snippet

2011-04-12 Thread Daniel Roseman
On Tuesday, April 12, 2011 11:17:15 AM UTC+1, Lloyd Dube wrote: > > Hi Daniel, > > Thanks. I would think that plugging about in the default django > installation would not be good practice - can that file simply reside in the > project directory and the name > in settings.py MIDDLEWARE_CLASSES be

Re: Reusing a code snippet

2011-04-12 Thread Sithembewena Lloyd Dube
dleware to the django-pagination middleware and it works just fine. Thank you! On Tue, Apr 12, 2011 at 12:01 PM, Daniel Roseman wrote: > > On Tuesday, April 12, 2011 10:44:27 AM UTC+1, Lloyd Dube wrote: >> >> Hi all, >> >> I found a code snippet to fix a dumplicvate

Re: Reusing a code snippet

2011-04-12 Thread Daniel Roseman
On Tuesday, April 12, 2011 10:44:27 AM UTC+1, Lloyd Dube wrote: > > Hi all, > > I found a code snippet to fix a dumplicvated first page of paginated > results and was wondering if anybody knows where in the code it should be > implemented? > > It looks like something th

Reusing a code snippet

2011-04-12 Thread Sithembewena Lloyd Dube
Hi all, I found a code snippet to fix a dumplicvated first page of paginated results and was wondering if anybody knows where in the code it should be implemented? It looks like something that should be in views.py to me, but I'd like others' input The code snippet is h

Re: How to use the given snippet..?

2010-09-22 Thread bruno desthuilliers
On 22 sep, 07:50, girish shabadimath wrote: > >>> from xxx.xxx import RequestFactory > >>> req = RequestFactory.request This looks up the name 'request' on the RequestFactory object and binds the result - here an unbound method object - to the name 'req'. > >>> req > > You want >>> req = Requ

How to use the given snippet..?

2010-09-21 Thread girish shabadimath
hi all, how to make use of this snippets http://djangosnippets.org/snippets/963/ i have a view function def demand(request, id, template = 'hello.html'): i want to test dis using the above snippets,, i copied the snippet in my localmachine when i

SNIPPET: assert_model_changes(record, 'field', 41, 42, lambda: money_line())

2010-03-10 Thread Phlip
Djangoids: This is from Cuker's fork of django-test-extensions: def assert_model_changes(self, mod, item, frum, too, lamb): source = open(lamb.func_code.co_filename, 'r').readlines() [lamb.func_code.co_firstlineno - 1] source = source.replace('lambda:', '').strip() mod

Re: CSV to JSON snippet

2009-12-12 Thread Zeynel
This is fixed by modifying lines 31-32: http://stackoverflow.com/questions/1894099/csv2json-py-error On Dec 10, 3:12 pm, Zeynel wrote: > This worked fine before but now I get the error > > C:\...\Django\sw2\wkw2>csv2json.py csvtest1.csvwkw2.Lawyer > Converting C:\...\Django\sw2\wkw2csvtest1.csvf

Re: CSV to JSON snippet

2009-12-10 Thread Zeynel
2json.py", line 37, in f = open(in_file, 'r' ) IOError: [Errno 2] No such file or directory: 'C:\\...\\Django\\sw2\ \wkw2cvtest1.csv' >From the snippet http://www.djangosnippets.org/snippets/1680/: 31 in_file = dirname(__file__) + input_file_name 32 out_file = dirname(

Re: CSV to JSON snippet

2009-11-14 Thread Zeynel
Great, thank you. When I ran it in the command prompt it worked fine. I noticed that the first column needs to be "pk" with rows starting with integers. On Nov 13, 11:24 pm, Karen Tracey wrote: > On Fri, Nov 13, 2009 at 10:57 PM, Zeynel wrote: > > Thanks, I tried but this did not work either: >

Re: CSV to JSON snippet

2009-11-13 Thread Karen Tracey
On Fri, Nov 13, 2009 at 10:57 PM, Zeynel wrote: > Thanks, I tried but this did not work either: > > >>> csv2json.py sw.csv wkw1.Lawyer > > File "", line 1 >csv2json.py sw.csv wkw1.Lawyer > ^ > SyntaxError: invalid syntax > >>> > > You need to run the .py script from an OS she

Re: CSV to JSON snippet

2009-11-13 Thread Zeynel
Thanks, I tried but this did not work either: >>> csv2json.py sw.csv wkw1.Lawyer File "", line 1 csv2json.py sw.csv wkw1.Lawyer ^ SyntaxError: invalid syntax >>> I checked "stdin" but I didn't understand how it relates to this case: http://en.wikibooks.org/wiki/Python_Pro

Re: CSV to JSON snippet

2009-11-13 Thread BenChapman
At line 21 of csv2json.py, change "import simplejson" to "from django.utils import simplejson" Now try running the csv2json.py script from the command line: python csv2json.py sw.csv wkw1.Lawyer See if that solves the problem. Best, Ben On Nov 12, 2:14 pm, Zeynel wrote: > Hi, > > my pro

Re: CSV to JSON snippet

2009-11-12 Thread Zeynel
Hi, my project is in C:/sw1/wkw1 models are in C:/sw1/wkw1/models.py Model name is Lawyer. So, in the python shell I import simplejson with from django.utils import simplejson then I enter csv2json.py sw.csv wkw1.Lawyer and I get the error >>> from django.utils import simplejson >>> csv2js

Re: CSV to JSON snippet

2009-11-12 Thread R. Gorman
What is the error message you are receiving? R. -- 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...@googlegr

CSV to JSON snippet

2009-11-12 Thread Zeynel
Hello, I am trying to use this CSV to JSon Fixture snippet but I couldn't make it work. http://www.djangosnippets.org/snippets/1680/ Can anyone help me to run this snippet. I copy the instruction below. Thank you. -- The instruction

Re: practical django and snippet rating problems

2009-09-07 Thread Karen Tracey
RATING_UP, 'useful'), > (RATING_DOWN, 'not useful')) >snippet = models.ForeignKey(Snippet) >user = models.ForeignKey(User, related_name='cab_rating') >rating = models.IntegerField(choices=RATING_CHOICES) >date = models.DateTimeFi

Re: practical django and snippet rating problems

2009-09-07 Thread andreas schmid
ode sharing site in the practical django projects book: > > if i try to get the score of a snippet with {{ object.get_score }} in > the template i get a result like: > >{'rating__sum': -2} > > > why is that? > >def get_s

Re: practical django and snippet rating problems

2009-09-07 Thread Karen Tracey
On Mon, Sep 7, 2009 at 5:45 AM, andreas schmid wrote: > > hi list, > > im experiencing problems with the rating functionality described in the > code sharing site in the practical django projects book: > > if i try to get the score of a snippet with {{ object.get_score }} in

practical django and snippet rating problems

2009-09-07 Thread andreas schmid
hi list, im experiencing problems with the rating functionality described in the code sharing site in the practical django projects book: if i try to get the score of a snippet with {{ object.get_score }} in the template i get a result like: {'rating__sum': -2} why is that?

Re: how to return an html snippet using ajax $.post()?

2009-08-21 Thread Margie
Yes, I have been learning and using jquery a lot lately. I find it really makes traversing around in the dom easy. Also, I have found some excellent plugins such as the cluetip pluging and datepicker plugins. All good stuff! Margie On Aug 20, 3:16 pm, Matthias Kestenholz wrote: > On Thu, Aug

Re: how to return an html snippet using ajax $.post()?

2009-08-21 Thread Margie
-%d %H:%M") >     json = simplejson.dumps(rdata) >     return HttpResponse(json, mimetype="application/json") > > The JavaScript dutifully evaluates the returned JSON [phobic security risk: > it would be > much better to use a JSON library for this] and replaces any current

Re: how to return an html snippet using ajax $.post()?

2009-08-20 Thread Steve Holden
regards Steve On Thu, Aug 20, 2009 at 5:34 PM, Margie Roginski wrote: > > Could someone give me a hand with a very simple ajax problem? I want > to post some data and have the server just return a small snippet of > html, which I then want to insert into my dom at a particular i

Re: how to return an html snippet using ajax $.post()?

2009-08-20 Thread Matthias Kestenholz
On Thu, Aug 20, 2009 at 11:53 PM, Margie wrote: > > Ah - thank you!  Yes, sorry, in the process of my debugging the issue > and trying to simplify it, I unintentionally introduced even more > errors, and then when posting it, even more!  But you somehow despite > that, managed to identify my real

Re: how to return an html snippet using ajax $.post()?

2009-08-20 Thread Margie
simple ajax problem?  I want > > to post some data and have the server just return a small snippet of > > html, which I then want to insert into my dom at a particular id. > > > Let's say the html snippet to be returned is just a string: hello > > world. > > &g

Re: how to return an html snippet using ajax $.post()?

2009-08-20 Thread Matthias Kestenholz
On Thu, Aug 20, 2009 at 11:34 PM, Margie Roginski wrote: > > Could someone give me a hand with a very simple ajax problem?  I want > to post some data and have the server just return a small snippet of > html, which I then want to insert into my dom at a particular id. > >

how to return an html snippet using ajax $.post()?

2009-08-20 Thread Margie Roginski
Could someone give me a hand with a very simple ajax problem? I want to post some data and have the server just return a small snippet of html, which I then want to insert into my dom at a particular id. Let's say the html snippet to be returned is just a string: hello world. Does my vie

Re: cab snippet add gives error

2009-08-03 Thread andreas schmid
dont know what it was but cleaning the tables and make a new sqlall cab solved the problem! prabhu S wrote: > Appears like a data type mismatch. Are you entering some string value > in a integer field or something of that sort? > > On Aug 3, 12:45 pm, andreas schmid wrote: > >> hi, >> >> im t

Re: cab snippet add gives error

2009-08-03 Thread prabhu S
Appears like a data type mismatch. Are you entering some string value in a integer field or something of that sort? On Aug 3, 12:45 pm, andreas schmid wrote: > hi, > > im trying to build the cab code sharing app with the practical django > projects book, at the moment i have a problem adding sni

cab snippet add gives error

2009-08-03 Thread andreas schmid
hi, im trying to build the cab code sharing app with the practical django projects book, at the moment i have a problem adding snippets bc i get this error: http://dpaste.com/74671/ solutions? thx --~--~-~--~~~---~--~~ You received this message because you are su

Re: Trouble with a django snippet FieldAccessForm (per-field user access for forms derived from models)

2009-06-19 Thread Rama Vadakattu
Jun 19, 7:40 am, dj wrote: > snippet:http://www.djangosnippets.org/snippets/1148/ > > This snippet is exactly what I need, however, I am having difficulty > understanding how to render the fields so that they contain the values > from the instance object. I setup the form >

Trouble with a django snippet FieldAccessForm (per-field user access for forms derived from models)

2009-06-18 Thread dj
snippet: http://www.djangosnippets.org/snippets/1148/ This snippet is exactly what I need, however, I am having difficulty understanding how to render the fields so that they contain the values from the instance object. I setup the form according to the sidebar instructions. I pass the form to

Re: I would like some feedback about address model snippet...

2008-12-24 Thread klein.steph...@gmail.com
vate sample, I would like publish public address model snippet. Then my code haven't to be in djangopaster.com. Regards, Stephane --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: I would like some feedback about address model snippet...

2008-12-24 Thread Kenneth Gonsalves
On Wednesday 24 Dec 2008 3:02:10 pm klein.steph...@gmail.com wrote: > I've write a address model snippet at : > > http://www.djangosnippets.org/snippets/1177/ > > I would like to know if you see some missing fields or mistake/ > misnamed fields ? why are you putting

Re: I would like some feedback about address model snippet...

2008-12-24 Thread Ramdas S
wrote: > > Hi, > > I've write a address model snippet at : > > http://www.djangosnippets.org/snippets/1177/ > > I would like to know if you see some missing fields or mistake/ > misnamed fields ? > > Note : I'm french and I haven't international add

I would like some feedback about address model snippet...

2008-12-24 Thread klein.steph...@gmail.com
Hi, I've write a address model snippet at : http://www.djangosnippets.org/snippets/1177/ I would like to know if you see some missing fields or mistake/ misnamed fields ? Note : I'm french and I haven't international address system background. Thanks for your feedback. Re

New snippet for chaining select boxes in admin

2008-09-05 Thread James Lance
I see requests for how to chain select boxes in the automatic admin come up on occasion. I just implemented it for a project that I was working on so I thought I would put together an entry on djangosnippets.org. Here is the link http://www.djangosnippets.org/snippets/1028/ I'm using mootools t

New snippet: Tenjin integration as a decorator

2008-05-05 Thread Martin Diers
http://www.djangosnippets.org/snippets/739/ This provides basic Tenjin integration, using a decorator. Tenjin is a blazingly fast templating system, the fastest pure-python system available. You can find it here: http://www.kuwata-lab.com/tenjin/ For usage and configuration, see the example

Re: return html snippet via XHR with simplejson

2007-08-11 Thread Udi
If you just want to return html that will get dumped into a container via innerHTML, then I don't really see the need to return json. Just return the html as text/html and dump the response directly into the container. However, the approach you are taking is nice because it lets you add more met

Re: return html snippet via XHR with simplejson

2007-08-11 Thread olivier
Hi, > This seems pretty appropriate to me, but as I am relatively new to > python and django, I was wondering if others are doing something > similar or if there are other suggestions for returning the html > formatted. Well, I'm doing roughly the same thing... I would be interested to see if o

return html snippet via XHR with simplejson

2007-08-10 Thread r_f_d
I was wondering what people are doing to format html snippets returned via XHR. I am currently using code like: response_dict = {} t = ModelObject.objects.all() html_table = render_to_response('table_template.html', {'table': t}) response_dict.update({'table': html_table}) return HttpRespon

Re: 2 ways to render HTML snippet, which is preferred?

2006-10-05 Thread Rob Hudson
It's looking like option #2 might be best for my case... I'd like make one general method to handle the building of the question context and depending on the question type render one template snippet vs another. Since inclusion_tags are tied to a template filename, this isn'

2 ways to render HTML snippet, which is preferred?

2006-10-03 Thread Rob Hudson
I'm working on a way to allow our content creators to put certain form elements on pages based on question types (open text, radio, checkbox, likert scale, etc). I can see 2 ways of accomplishing what I'm trying to do. As pretext, I have 2 models: Question and Option. Option has a ForeignKey re