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
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
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
/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
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
= 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
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
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,
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
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
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
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
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:
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
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
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
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'
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(
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,
>
>
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:
>
>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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(
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:
>
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
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
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
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
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
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
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
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
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
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?
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
-%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
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
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
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
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.
>
>
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
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
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
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
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
>
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
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
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
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
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
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
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
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
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
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
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'
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
80 matches
Mail list logo