Re: Django 2.2 and custom media in the admin

2019-04-10 Thread Thorsten Sanders
min/js/jquery.init.js', ...] when declaring form media assets. [1] Cheers, Simon [0] https://docs.djangoproject.com/en/2.2/releases/2.2/#merging-of-form-media-assets [1] https://docs.djangoproject.com/en/2.2/topics/forms/media/#assets-as-a-static-definition Le mardi 9 avril 2019 11:02:35 UTC-4, Th

Django 2.2 and custom media in the admin

2019-04-09 Thread Thorsten Sanders
Hello, I insert a custom javascript inside the admin and do use the "django.jquery" this worked fine until updating to Django 2.2. With 2.2 the order in which the javascripts are loaded changed and the jquery.init.js is now loaded after my custom javascript, is that considered a bug or a

Re: Custom user model password is not hashed

2015-11-12 Thread Thorsten Sanders
If you wanna set the password yourself you need to generate it: https://docs.djangoproject.com/en/1.8/topics/auth/passwords/ scroll down to the bottom and have a lookt at make_password Am 12.11.2015 um 16:11 schrieb Benjamin Smith: I have my own custom User model, and its own Manger too.

Re: Google indexing issue

2015-09-01 Thread Thorsten Sanders
Considering a: https://www.google.de/search?q=site:http://www.schoolofdevelopers.in shows more results than in the sitemap.xml are, this feels a bit like a hidden advertising. Am 01.09.2015 um 20:04 schrieb James Schneider: The front landing page does not have any links leading to the

Re: Logout user on tab closing

2015-05-19 Thread Thorsten Sanders
I wouldnt do that at all, lets take ebay as an example when I use that I have several tabs at the same time open and it would be really annoying if I get a logout if I close one of those tabs and the same is true for many other sites. Same is true for my bank too, they just do a logout if I

Re: JSON data

2015-05-07 Thread Thorsten Sanders
Am 07.05.2015 17:37, schrieb Tim Chase: On 2015-05-07 13:56, palansh agarwal wrote: processing of json is slow. It takes considerable amount of time to process data after calling the API. You seem fairly confident in this. Do you have the timing statistics? Can you provide sample JSON data

Re: Namespace url lookup inside template of an app

2015-01-30 Thread Thorsten Sanders
=request.resolver_match.namespace) Am 29.01.2015 um 21:24 schrieb Thorsten Sanders: Hello, writing currently an app which should show different things based on namespace which is working already, but I do have problems with generating the right url inside the templates of that app. I tried to use: {% url

Namespace url lookup inside template of an app

2015-01-29 Thread Thorsten Sanders
Hello, writing currently an app which should show different things based on namespace which is working already, but I do have problems with generating the right url inside the templates of that app. I tried to use: {% url 'myaddons:index' %} but that always shows the same namespace url the

Re: Problem with raw query and using in

2013-11-17 Thread Thorsten Sanders
: On Sat, 16 Nov 2013 22:39:09 +0100, Thorsten Sanders <thorsten.sand...@gmx.net> declaimed the following: I am using mysql and when I write it like (1) then I get int is not iterable on the first one, but the raw works, if I do it like (1,) the first one works, but the raw one gets again the

Problem with raw query and using in

2013-11-16 Thread Thorsten Sanders
Hello, wondering if I am doing something wrong or it is a bug, using django 1.5.5, but also tried with 1.6 resulting in the same problem. When I do the following: realms=[1] data = AuctionData.objects.filter(itemid__exact=itemid,realm__in=realms) data2 = AuctionData.objects.raw('SELECT *

Re: Associating Form Data with Users

2012-02-20 Thread Thorsten Sanders
You could do for example: exclude the user field from the form and in your view something like this: form = YourModelForm(request.POST) #fill the modelform with the data if form.is_valid(): # check if valid mynewobject = form.save(commit=False) #save it to create the

Re: what is the best IDE to use for Python / Django

2012-02-15 Thread Thorsten Sanders
Why this kind of stuff never ends?;( The best IDE is simply the one you can work best with, YOURSELF! On 15.02.2012 16:13, Vikas Ruhil wrote: Vim is best IDE for Python/Django ! look here the link http://learnhackstuff.blogspot.in/2012/02/vim-as-universal-idepart-1.html On Wed, Feb 15, 2012

Re: Translation inside the database

2012-02-08 Thread Thorsten Sanders
Am 08.02.2012 21:35, schrieb akaariai: On Feb 8, 9:33 pm, Thorsten Sanders<thorsten.sand...@gmx.net> wrote: Hello, I have tables having translation like this: name_en,name_de,name_fr... With google I found 2 solutions which support that, but they dont allow to use those

Translation inside the database

2012-02-08 Thread Thorsten Sanders
Hello, I have tables having translation like this: name_en,name_de,name_fr... With google I found 2 solutions which support that, but they dont allow to use those fields then with order,filter, values etc...so its kinda useless. With some trying arround, I came up with the following: from

Re: Django Tutorial Part 3 Decoupling the URLconfs

2012-02-06 Thread Thorsten Sanders
You are using the tutorial of the development version which is 1.4 alpha, but using yourself version 1.3.1, so you need to use django.conf.urls.defaults instead of django.conf.urls Better use the 1.3 tutorial instead of the development one to not run into such troubles. Am 06.02.2012 23:23,

Re: import error

2012-02-03 Thread Thorsten Sanders
Did you try to add a $ after the last slash for the login, may that makes a difference for the url resolver, but dunno, just a wild guess. Am 03.02.2012 18:39, schrieb Miten: hi guys, I am doing simple app for learning. I created page and then auth protected but as I added register link to

Re: Help Me With omab/django-socialauth

2012-02-02 Thread Thorsten Sanders
I took your config and its working fine, maybe your twitter api key is wrong? On 02.02.2012 11:22, coded kid wrote: I'm getting a redirect loop error. Whats the probs? On Feb 1, 1:22 pm, Thorsten Sanders<thorsten.sand...@gmx.net> wrote: Some sort of error traceback/description

Re: create users from /etc/passwd?

2012-02-02 Thread Thorsten Sanders
https://bitbucket.org/maze/django-pam/ maybe that helps? On 02.02.2012 16:47, Tim wrote: I'm running Django 1.3.1 on FreeBSD + Apache2.2 inside an intranet. I do not grok authentication, so here is my problem and a question about how I can solve it (maybe). What I need is the name of the

Re: Help Me With omab/django-socialauth

2012-02-01 Thread Thorsten Sanders
Some sort of error traceback/description would be helpful, from a quick look it seems all right. On 01.02.2012 13:23, coded kid wrote: Hey guys, I'm facing a huge problem with omab/django/socialauth. After setting all the necessary settings, I clicked on the “Enter using Twitter” link on my

Re: How do you pass dissimilar data from view to template?

2012-01-27 Thread Thorsten Sanders
If the data is presented as table, datatables is a really nice jquery plugin for such stuff: http://datatables.net/ On 27.01.2012 17:31, BillB1951 wrote: Thanks for the additional thought on this. It is a much appreciated confirmation to me. Last night I was torturing my brain over the

Caching and excluding in a template

2012-01-25 Thread Thorsten Sanders
Hello, wondering if there is any easy way to exclude a little part from a template to be cached, on every site there is a the usual register/login or you are logged in with a user menu, back in php+smarty times it was easy solved using a dynamic tag to easily exclude a small part from being

Re: django-localeurl and SEO

2012-01-20 Thread Thorsten Sanders
You could add sitemaps in the google webmaster tools or make a sitemap in the root dir which contains links to the other sitemaps. On 19.01.2012 17:59, ionic drive wrote: Hello django friends, I have installed "django-localeurl" successfully. After some redirecting troubles... don't worry

Re: Having Headache With LoginForm

2012-01-17 Thread Thorsten Sanders
With using @login_required decorator the user needs to be logged in to allow execution, don't makes much sense for a login :P Am 17.01.2012 22:23, schrieb coded kid: Hi guys, I’m having problem with my login form. The login form will redirect me to the next page even if I didn’t input

Re: Primary key for read-only models

2012-01-12 Thread Thorsten Sanders
Had recently kinda the same just that I have 2 tables without a primary key at all and I just declared one of the fields as primary key and works fine. On 12.01.2012 16:03, Demetrio Girardi wrote: I need to read data from an "external" database table from my django project. I am not

Re: Replicate admin format in django template

2012-01-12 Thread Thorsten Sanders
You need to convert the new lines to html code there are 2 templatetags for doing so: https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#linebreaks On 12.01.2012 09:54, Nikhil Verma wrote: Hi I have a column which is a TextField. When we look at django admin it appears as a box.

Re: Django orm and no primary key

2012-01-10 Thread Thorsten Sanders
Am 10.01.2012 20:46, schrieb Ian Clelland: This is possible -- there was some discussion on this list about it just a few days ago. If you tell Django that another field is the actual primary key, then it will not assume that there is an 'id' column (which is good, because otherwise it will

Django orm and no primary key

2012-01-09 Thread Thorsten Sanders
Hello, I am wondering if it is possible to still use the django orm without having a primary key at all, I currently got a table holding 61 million entries soon gonna expand to hold 600 million entries, that table never need to identify one entry alone its only to pull off statistics based

Re: This Week In History

2012-01-05 Thread Thorsten Sanders
You dont mention the database you use if mysql you could do SELECT * FROM WHERE DATE_FORMAT(, "%u") = DATE_FORMAT(curdate(), "%u") dont know if there is a django orm way to do it, but could always use a raw query. Am 05.01.2012 21:14, schrieb Tim Sawyer: Hi Folks, Does anyone have a

Re: Checkboxes for a list of items like in Django admin interface

2012-01-04 Thread Thorsten Sanders
ifications = Notification.objects.filter( id__in=id_list, ) Martin On Wed, 04 Jan 2012 12:11:11 +0100, Thorsten Sanders <thorsten.sand...@gmx.net> wrote: I do it this way: and in the view: todel = request.POST.getlist('todelete') ItemWatchList.objects.filter(user=request.user,id__

Re: Checkboxes for a list of items like in Django admin interface

2012-01-04 Thread Thorsten Sanders
I do it this way: and in the view: todel = request.POST.getlist('todelete') ItemWatchList.objects.filter(user=request.user,id__in=todel).delete() On 04.01.2012 11:33, Martin Tiršel wrote: Hello, I have a list of items (from a model) I want to display with checkboxes (for deleting

Re: error attempting to populate field

2012-01-03 Thread Thorsten Sanders
Because its a foreign field either get an instance of Listings with that id like: listening = Listings.objects.get(id=15) CanoeKayak.listings = listening or to add directly a value: CanoeKayak.listings_id = 15 Am 04.01.2012 04:46, schrieb BillB1951: I am trying to add the interger value

Re: mysql installation error

2011-09-21 Thread Thorsten Sanders
When I first installed django, that made me going crazy to try to install that library, in the end I just went with a pre-compiled from http://www.lfd.uci.edu/~gohlke/pythonlibs/ On 21.09.2011 04:59, PremAnand Lakshmanan wrote: Hi, When I try to install mysql I get the following error, Pls

Re: Create socket server in django

2011-09-20 Thread Thorsten Sanders
import sys,os sys.path.append('/path/to/your/django_project') os.environ['DJANGO_SETTINGS_MODULE'] = 'your_settings_file' This works fine for a cronjob I created On 20.09.2011 10:48, Thomas Orozco wrote: You just have to run your server as a daemon and use Django's setup_environment so you

Re: Trouble expressing a query in the ORM

2011-09-09 Thread Thorsten Sanders
On 09.09.2011 17:36, Daniel Gagnon wrote: On Fri, Sep 9, 2011 at 9:28 AM, Pewpewarrows > wrote: Tim Shaffer's response would have you doing N+1 queries, and having to loop through all of your Target objects in-memory.

Re: Delegating a async job from a django view

2011-08-25 Thread Thorsten Sanders
https://github.com/ask/django-celery Take a look at that, it should be able to do what you want, though never used it myself yet. On 25.08.2011 09:24, Amit Sethi wrote: What is the best solution for delegating a long time taking job from a django view. Basically i wish to query a few web

Re: Django Development environment

2011-08-23 Thread Thorsten Sanders
IDE: PyCharm (its for python with django support,not free but love it and not to expensive) Database: mysql/postgresql Standard apps: south (really a must have to apply database changes easy) debug_toolbar Am 23.08.2011 14:47, schrieb Yas,ar Arabac?: Development setup (when on my own