Re: Django v3.2 broken admin interface due to malicious JSON value

2023-03-09 Thread 'Johannes Filter' via Django users
D6FF27NJWKTEGAFRUDNSVVAFIHQ/ > > <https://mail.python.org/archives/list/python-...@python.org/message/B25APD6FF27NJWKTEGAFRUDNSVVAFIHQ/> > > Kind Regards, > > Johannes > > > > > -- > You received this message because you are subscribed to the Google Groups

Re: Question about post_save

2014-08-14 Thread Johannes Schneider
Is there any reason why this has to happen after saving? otherwise you could use pre_save. bg, Johannes On 14.08.2014 08:12, Neto wrote: I'm using post_save but he is in loop: @receiver(models.signals.post_save, sender=Cars) def auto_num_on_save(sender, instance, **kwargs): my code

Re: Full text search available on PostgreSQL?

2014-07-08 Thread Johannes Schneider
you could have a look at djorm-ext-pgfulltex. bg, Johannes On 28.06.2014 18:15, Bastian Kuberek wrote: Hi, Just saw that django.contrib.admin.ModelAdmin.search_fields <https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.search_fields> full text

Re: Question about moving code to product from local or development server.

2014-06-10 Thread Johannes Schneider
you can use 'Fabric' to deploy your code. But In this case you still have to write some parts on your own. https://pypi.python.org/pypi/Fabric/ bg, Johannes On 07.06.2014 22:50, Chen Xu wrote: I am building a django website, and wondering what is an easy way to move all of my code

Re: Circular import problem

2014-04-16 Thread Johannes Schneider
You can use from foo import bar inside your method/class definitions or you can use import foo.bar. bg, Johannes On 16.04.2014 11:37, Daniel Oźminkowski wrote: Hello, I recently cut my models.py into separate files and now I try to fix all the problems with imports that showed up. I hit

Re: Database operators for custom fields

2014-02-20 Thread Johannes Schneider
thnx, yea that's what I'm looking for. unfortunately I cannot use 1.7 ;( bg, Johannes On 19.02.2014 23:19, Anssi Kääriäinen wrote: If I am not mistaken you are trying to alter how .filter(customfield__eq=val) and friends work. In current Django versions you can't easily customize the SQL

Database operators for custom fields

2014-02-19 Thread Johannes Schneider
hey list, I have a custom Field implemented for one of my models. How do I implement the database operations (e.g. '==', '!=') for the custom field which are used to execute database queries? bg, Johannes -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel

Re: Exiting from a management command with a given exit status

2014-01-24 Thread Johannes Schneider
thnx, I thought there might be a more django-like way. On 23.01.2014 15:48, Erik Cederstrand wrote: import sys sys.exit(123) -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo Press GmbH Rheinwerkallee 4 - 53227 Bonn

Exiting from a management command with a given exit status

2014-01-23 Thread Johannes Schneider
Hi List, see the question in the subject. I want to return from a management command with a given exit code. How can this be done? bg, Johannes -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo Press GmbH Rheinwerkallee 4 - 53227 Bonn

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-21 Thread Johannes Schneider
thnx guys for all that input. On 21.01.2014 14:06, Erik Cederstrand wrote: Den 21/01/2014 kl. 10.55 skrev Johannes Schneider <johannes.schnei...@galileo-press.de>: yes, but the problem is that we manually give them a pk. Maye it's the best to reduce the question to the following:

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-21 Thread Johannes Schneider
yes, but the problem is that we manually give them a pk. Maye it's the best to reduce the question to the following: Which (undocumented) field is better for this case? * instance._state.db (checking if this is None) * instance_state.adding (checking for True) bg, Johannes On 21.01.2014 10:07

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-20 Thread Johannes Schneider
or same values for its attributes) in the database. bg, Johannes On 20.01.2014 18:21, Avraham Serour wrote: well you have a problem then, the database is the one holding the data, if you want to know if the data exists will would need to ask the one responsible for it, if not the DB then who

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-20 Thread Johannes Schneider
I don't do, because I don't want do to have a query against the database. On 20.01.2014 16:25, Kelly Nicholes wrote: Wait-- Why aren't you using exists()? Don't even check the pk. Model.query.exists() was made for this. -- Johannes Schneider Webentwicklung johannes.schnei...@galileo

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-20 Thread Johannes Schneider
thnx for this suggestion. we use '_state.adding' now. Is there an advantage of using '_state.database'? bg, Johannes On 17.01.2014 14:39, Tom Evans wrote: On Thu, Jan 16, 2014 at 5:23 PM, Johannes Schneider <johannes.schnei...@galileo-press.de> wrote: This could be a way to it, but w

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-16 Thread Johannes Schneider
No, just if you use auto generated PKs. Exactly this is the point. We use manually generated PKs, so can not use this check. On 16.01.2014 18:03, Javier Guerra Giraldez wrote: On Thu, Jan 16, 2014 at 11:50 AM, Johannes Schneider <johannes.schnei...@galileo-press.de> wrote: The point

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-16 Thread Johannes Schneider
This could be a way to it, but we need this information while handling the Pre_save singal. So this does not work too. On 16.01.2014 17:53, Martin Marrese wrote: On Thu, Jan 16, 2014 at 1:50 PM, Johannes Schneider <johannes.schnei...@galileo-press.de <mailto:johannes.schnei...@galileo-pr

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-16 Thread Johannes Schneider
The point is, I have to distinguish between an instance which is created, but its save method is not yet called. And an instance coming from the database via a manager. bg, Johannes On 16.01.2014 16:04, Erik Cederstrand wrote: Den 16/01/2014 kl. 14.27 skrev Johannes Schneider

Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-16 Thread Johannes Schneider
'InstanceModel.objects.exists(pk=self.pk)' generates too much queries, so this is not acceptable in my case. bg Johannes -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo Press GmbH Rheinwerkallee 4 - 53227 Bonn - Germany Tel

Re: Django - How to combine queries in to one and display it in the template?

2013-11-03 Thread Johannes
)| bg, Johannes On 03.11.2013 14:01, Robin Lery wrote: Suppose this is a model for an app Blog: |class Blog(models.Model): title= models.CharField(max_length=200) pub_date= models.DateTimeField(default=datetime.now) creator= models.ForeignKey(User) content= BleachField

Re: Introducing objpool: a generic object pooling library

2013-04-12 Thread Johannes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 sounds great. Thanx guys. On 12.04.2013 11:29, Stratos Psomadakis wrote: > Hi fellow Django users! > > We are pleased to introduce objpool [1] to the Django community. > > objpool provides a generic library for pooling resources as objects. > It's

Re: What is wrong with my template file and code?

2013-04-07 Thread Johannes
Hey, it would be nice to have some more details about the error or problem you have. bg, Johannes On 07.04.2013 22:40, Martin Charles wrote: > What is wrong with my code? I cant find this annoying problem. > > Here is a gist: > https://gist.github.com/caffinatedmonkey/f2283756

Re: Problems receiving data from DB (sqlite3)

2013-04-07 Thread Johannes
that this solves my problem (or other upcoming problems related to this). thank you guys. bg Johannes On 07.04.2013 22:31, Alexis Roda wrote: > Al 07/04/13 21:35, En/na Johannes ha escrit: >> I get again to different results. >> the shell accesses the settings.py while from the testserver the

Re: Problems receiving data from DB (sqlite3)

2013-04-07 Thread Johannes
I get again to different results. the shell accesses the settings.py while from the testserver the settings.pyc is accessed. After I deleted the pyc-file. the testserver uses the settings.py too. When and in which cases the pyc-file gets (re)-build? bg, Johannes On 07.04.2013 21:24, Alexis

Re: Problems receiving data from DB (sqlite3)

2013-04-07 Thread Johannes
databases {'default': {'ENGINE': 'django.db.backends.sqlite3', 'TEST_MIRROR': None, 'NAME': 'nacc.db', 'TEST_CHARSET': None, 'TIME_ZONE': 'UTC', 'TEST_COLLATION': None, 'OPTIONS': {}, 'HOST': '', 'USER': '', 'TEST_NAME': None, 'PASSWORD': '', 'PORT': ''}} so the name does not match. Do I miss some

Problems receiving data from DB (sqlite3)

2013-04-03 Thread Johannes
. Even more, If I create and save data from the testserver, it's only available until I restart the server. my configuration is Django 1.4 with sqlite3 on Ubuntu. bg, Johannes -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubs

ForeignKey save method admin panel

2012-09-23 Thread Johannes Frey
Hi! One question about the topic above. I'm just wandering what's going on in the admin panel when creating an instance of a ForeignKey in a special case. I've got two models. One regular one with the regular fields (like name, date etc.) an one who holds the ForeignKey to that class. the

Developers for Start Up

2011-04-14 Thread Johannes
Partner in a Start Up backed by one of Europe’s leading VCs. We’re developing a Social Commerce product with massive potential. The development takes place in Sweden and the initial roll out will be in the US. Now we’re building a team in Stockholm and California. I’m looking for developers to

Re: Django user registration email issues in dev enviroment

2010-11-17 Thread Johannes Nel
in case someone runs into this in the future, i had to set the default from email to get it to work. DEFAULT_FROM_EMAIL = 'sam...@domain.com' nicer error messages would have been, well nice. On Wed, Nov 17, 2010 at 9:52 AM, Johannes Nel <johannes@gmail.com> wrote: > ok, I decided

Re: Django user registration email issues in dev enviroment

2010-11-17 Thread Johannes Nel
TPRecipientsRefused(senderrs) Exception Type: SMTPRecipientsRefused at /accounts/register/ Exception Value: {u'xxx.x...@gmail.com': (451, 'Temporary local problem - please try later')} temporary local problem!!! SAY WHAT! this is not me using the postfix aliases I created. On Wed, Nov 17, 2010 a

Django user registration email issues in dev enviroment

2010-11-17 Thread Johannes Nel
Hi My dev enviroment is OS x 10.5 I grabbed the django registration application and configured it to email via my local host spooler. After which I setup postfix alias's for some dummy domains, these I tested from command line and my emails are coming through. Then i proceed to get the register

Re: CI

2010-11-16 Thread Johannes Nel
Nice. Kudos to the people who did virtualenv, neat tool. On Tue, Nov 16, 2010 at 9:07 AM, Nick Lo <nick.ingredie...@gmail.com> wrote: > Hi Johannes, > > You may be interested in this project: > > https://github.com/kmmbvnr/django-hudson > > Cheers, > > Nick >

Re: CI

2010-11-13 Thread Johannes Nel
for deployment, which looks pretty powerfull, but more investigation is needed. If anyone has got some experience in fabric and hudson integration or a good resource on propagation strategies will be much appreciated. On Sat, Nov 13, 2010 at 4:56 PM, Johannes Nel <johannes@gmail.com> wrote

CI

2010-11-13 Thread Johannes Nel
Hi All What do you guys use for CI servers? Also where can I get some detailed info on application propagation strategies (from dev, to qa, to uat to prod) for django As a side note, I think the getting started documentation should be updated to reflect the use of relative paths

Re: Converting plain string to dictionary

2010-11-12 Thread Johannes Nel
pyparsing is an incredibly (perhaps over in this case) powerful tool for parsing stuff into what ever your heart desires. On Fri, Nov 12, 2010 at 4:22 PM, Javier Guerra Giraldez wrote: > On Fri, Nov 12, 2010 at 3:40 AM, Pradnya wrote: >> Please let

Re: annotate over period of time

2009-04-22 Thread Johannes Wilm
I've changed that part now, but the output remains the same. On Apr 22, 5:12 pm, Johannes Wilm <johannesw...@gmail.com> wrote: > well, that's strange, because that part always worked and still works. > So this line here, to get the daily values: > > queryset=PrecioPrueba.objec

Re: annotate over period of time

2009-04-22 Thread Johannes Wilm
') works just fine. What I have problems with is the part about annotating/aggregating values for an entire month. On Apr 22, 5:06 pm, Randy Barlow <rbar...@americanri.com> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Johannes Wilm wrote: > > At first I trie

annotate over period of time

2009-04-22 Thread Johannes Wilm
Hey, I have a model which monitors the prices of certain items at certain markets daily. precios/models: ... class Prueba(Approvable): mercado = models.ForeignKey(Mercado) producto = models.ForeignKey(Producto) fecha = models.DateField() minimo =

Re: Can I loop over attributes in model.attribute?

2008-06-11 Thread Johannes Dollinger
You are looking for setattr(): http://docs.python.org/lib/built-in- funcs.html#l2h-66 for attr in ('groupon', 'companyon', 'addressfirst', 'extendnames', 'clubfieldson'): setattr(settings, attr, attr in data) Am 12.06.2008 um 00:48 schrieb Wim Feijen: > > Thanks Russell! > > I suppose

Re: order_by foreign key problem

2008-05-29 Thread Johannes Dollinger
Wah, nevermind .. Am 30.05.2008 um 01:27 schrieb Johannes Dollinger: > >> Should this work?? >> >> results = Gear.objects.select_related().order_by >> (generic_info__hits) > > Quotes are missing: > > Gear.objects.select

Re: order_by foreign key problem

2008-05-29 Thread Johannes Dollinger
> Should this work?? > > results = Gear.objects.select_related().order_by(generic_info__hits) Quotes are missing: Gear.objects.select_related().order_by('generic_info__hits') --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Use variables inside an 'include' tag (and/or: how to set a variable in a template)

2008-05-29 Thread Johannes Dollinger
You could use a filter: @register.filter(name='concat') def concat(value, arg): return "%s%s" % (value, arg) and then {% include dir|concat:"/tag.html" %}. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Django and XML-Files

2007-11-02 Thread johannes
Malcolm Tredinnick schrieb: > On Thu, 2007-11-01 at 09:56 -0700, johannes wrote: > > Hello, > > > > I'm planning to alter an existing hobby-project-site from php and xml/ > > xslt scripts into a python web-app. > > I just played around a little bit with django

Django and XML-Files

2007-11-01 Thread johannes
for this?) or puts me on the right track where to look. Thanks in advance, johannes --~--~-~--~~~---~--~~ 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@google

Re: newbie problem: no django.core.management

2007-10-24 Thread johannes
macports, so in the end there is quite a lot of stuff to write in your PATH when you do this. Anyway directly using the django from djangoproject seems to be less complicated. Cheers, johannes --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: newbie problem: no django.core.management

2007-10-22 Thread johannes
Well, which django revealed: no django in /opt/local/bin /opt/local/sbin /Library/Frameworks/ Python.framework/Versions/Current/bin /bin /sbin /usr/bin /usr/sbin / usr/texbin /usr/local/bin So there is something wrong with my django-macports-installation? In opt/local/bin there's only

Re: newbie problem: no django.core.management

2007-10-22 Thread johannes
> Can you successfully run this: > > [EMAIL PROTECTED] python > > >>> import django > > ? No. That doesn't work either. Well, but how do I figure out what's the right path to /path/to/django/bin? There are so many "djangos" in my opt/local/-directory. (mostly receipts or rsync-stuff from

Re: newbie problem: no django.core.management

2007-10-22 Thread johannes
Uhm. Yes I'm logged in as non-admin user. But even when I log in via terminal to my admin-account (su -l ...), the same error occurs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: newbie problem: no django.core.management

2007-10-22 Thread johannes
Ok. Adding export PYTHONPATH=$PYTHONPATH:/opt/local/lib/python2.5/sitepackages/ django/core to my .profile seemed to be the remedy. But no I get the error: /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/ Contents/MacOS/Python: can't open file 'manage.py': [Errno 2] No such

Re: newbie problem: no django.core.management

2007-10-22 Thread johannes
nyway, here's my .profile: export PATH=/opt/local/bin:/opt/local/sbin:$PATH What should I change? Cheers, Johannes --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

newbie problem: no django.core.management

2007-10-22 Thread johannes
(most recent call last): File "manage.py", line 2, in from django.core.management import execute_manager ImportError: No module named django.core.management computer:~/Sites/mysite user$ What went wrong here? Thanks for your help.

Sessions not storing anything

2007-09-24 Thread Johannes Dahlström
n packages. Any pointers? Thanks in advance, -Johannes The views: -- from django.http import HttpResponse, HttpResponseRedirect def test1(r): r.session.set_test_cookie() return HttpResponseRedirect('/kysely/test2/') def test2(r): return HttpResponse('W

postgresql views and django

2007-02-22 Thread Johannes Wolter
els I need have many attributes which are useless for the visualization. But if "inspectdb" is the easier and safer approach, it would be fine too. I'm glad for any hint! Cheers, Johannes --~--~-~--~~~---~--~~ You received this message becaus

Re: Mac vs. PC for Django work.

2006-09-14 Thread Johannes Beigel
brian corrigan schrieb: > The only problem I came across with the Mac (iBook) was that there is > no c compiler installed. You can download xcode tools (I think) from > the apple developer site which will give you gcc. The problem is that > xcode is about a 1GB (latest