Re: setup.py for project?

2015-04-02 Thread Thomas Güttler
ecked my favourite book seller. There are many books about this topic. Which one do you recommend? Regards, Thomas Güttler -- -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

setup.py for project?

2015-04-01 Thread Thomas Güttler
make sense for the project? How do you manage your projects (not apps)? Regards, Thomas Güttler -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Global access to request.user

2015-04-01 Thread Thomas Güttler
Am 27.03.2015 um 19:05 schrieb Stephen J. Butler: On Fri, Mar 27, 2015 at 10:30 AM, Thomas Güttler <h...@tbz-pariv.de> wrote: You have an instance method to render one row of a search result (a custom paginator). One column of this row displays a link. Some users are allowed to

Re: Global access to request.user

2015-04-01 Thread Thomas Güttler
round being ugly", because the code is already architecturally flawed and inherently ugly to start with. Also, abusing globals starts to get real ugly when you introduce co-routines and overall makes for much less readable code (imho). Yes, I think co-routines make this worse. Regards, Thom

Re: Global access to request.user

2015-03-27 Thread Thomas Güttler
OP python code. The method needs to know which user is logged in to return the correct result. Of course I could always return a hyperlink. And users which don't have the permission will see the permission denied page. But this is not user friendly. Can you understand this use case? Regards, T

cache.set(key, timeout=0)

2015-02-10 Thread Thomas Güttler
-usage I don't want to put a lot of "if default_cache_timeout==0: " into my code. It would be nice if django would support this. This would make my code simpler. Does cache.set(key, timeout=0) do no caching at all? If yes, shouldn't this be stated in the docs explicitly? Regard

Re: App for storing ChangeLogs in database

2015-02-09 Thread Thomas Güttler
y a human. It can't be automated, and I think it is worth the effort. Regards, Thomas Güttler -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop r

App for storing ChangeLogs in database

2015-02-06 Thread Thomas Güttler
What do you think? How do you handle your ChangeLogs. PS: Our customers are normal (non programmers) people. They don't want to see diffs or commit messages they don't understand. -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Googl

Middleware + Transactions

2015-01-30 Thread Thomas Güttler
transaction? Regards, Thomas Güttler -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-user

Re: Config: DB or git?

2014-10-02 Thread Thomas Güttler
Am 02.10.2014 um 14:11 schrieb Tom Evans: On Thu, Oct 2, 2014 at 12:21 PM, Thomas Güttler <h...@tbz-pariv.de> wrote: Am 01.10.2014 um 14:56 schrieb Collin Anderson: If you're a programmer or sysadmin, configuration should be done in files. If you're not a programmer or sysadmin, it

Re: Config: DB or git?

2014-10-02 Thread Thomas Güttler
which gets configured here? I love git like most programmers love their version control system. But for most stuff config in DB is much better. example: INSTALLED_APPS Wouldn't it be really cool if you could add an app by pressing a button? Thomas -- Thomas Güttler http://thomas

Re: Including JS/CSS in reusable widget library

2014-10-02 Thread Thomas Güttler
But maybe some else does. Thomas -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr

Re: Exceptions in signal handlers pass silently

2014-10-02 Thread Thomas Güttler
s solution: {{{ from django.dispatch import Signal Signal.send_robust = Signal.send }}} Source: http://giovanni.bajo.it/post/47207612849/djangos-signal-send-robust-is-broken-by-design -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Goo

Including JS/CSS in reusable widget library

2014-09-30 Thread Thomas Güttler
pages are good. But it is even better if there is a common way how to handle this in the django world. Thomas -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

Exceptions in signal handlers pass silently

2014-09-30 Thread Thomas Güttler
I just discovered, that exceptions in signal handlers pass silently. Is there a way to not silently ignore errors? >>> import this -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Config: DB or git?

2014-09-30 Thread Thomas Güttler
ink. Unfortunately the feature "data store" is not evaluated up to now. But I created a feature request: https://github.com/pydanny/djangopackages/issues/293 Thomas -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Google Groups &

Config: DB or git?

2014-09-29 Thread Thomas Güttler
this, since version control is great for files, and not so good for databases, but I think it is the way to go. What do you think? Thomas -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: Install Django Apps via Admin Interface

2014-09-17 Thread Thomas Güttler
work without getting added to INSTALLED_APPS. It would be nice if such a sub architecture would be outside of django-cms, to make it more reusable. Thomas -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are subscribed to the Google Groups "Django

Re: Install Django Apps via Admin Interface

2014-09-12 Thread Thomas Güttler
ALLED_APPS, but also adding configurations to settings.py, running syncdb/migrate and reloading the instance. I guess django experts have a good solution for this small technical problem. Thomas -- Thomas Güttler http://thomas-guettler.de/ -- You received this message because you are

Warnings instead of only errors in Django Forms

2014-08-13 Thread Thomas Güttler
of the page won't help me. I need a python solution (without templates), since the form rendering is done by a third party library. [1] http://stackoverflow.com/questions/2270550/warnings-or-even-info-messages-instead-of-only-errors-in-django Regards, Thomas -- Thomas Güttler http://thomas

Re: URLs: mymodel_id vs object_id vs pk ....

2014-06-05 Thread Thomas Güttler
Thank you for answering my question. Unfortunately "slug" does not work in my context. My model does not have a "slug". It is like a ticket/issue system. There are several hundred of tickets each day. Thomas Güttler Am 04.06.2014 15:07, schrieb Thomas Güttler: What

URLs: mymodel_id vs object_id vs pk ....

2014-06-04 Thread Thomas Güttler
What is the best practice for named URL parameter which refer to a primary key of a model? I have seen many ways: - object_id - mymodel_id - pk - id - . example: urlpatterns = [ url(r'^article/(?P\d+)/$', 'article.view'), ... ] Up to now we used "mymodel_id" but it gets

Re: editable models (db schema) for admin (no developer)

2014-06-04 Thread Thomas Güttler
I found several solution here: http://stackoverflow.com/a/7934577/633961 Am 03.06.2014 15:57, schrieb Thomas Güttler: Hi, I am a software developer and like the way django ORM defines the database (via models.py) very much. Unfortunately for a new project, we have the constraint

Re: editable models (db schema) for admin (no developer)

2014-06-03 Thread Thomas Güttler
Am 03.06.2014 16:27, schrieb Erik Cederstrand: Den 03/06/2014 kl. 15.57 skrev Thomas Güttler <h...@tbz-pariv.de>: I am a software developer and like the way django ORM defines the database (via models.py) very much. Unfortunately for a new project, we have the constraint, that the

editable models (db schema) for admin (no developer)

2014-06-03 Thread Thomas Güttler
Hi, I am a software developer and like the way django ORM defines the database (via models.py) very much. Unfortunately for a new project, we have the constraint, that the admin must be able to add some columns. The admin is not a developer, and he only uses a web interface. I don't want to

True Model Inheritance

2014-04-11 Thread Thomas Güttler
I know that there are several model inheritance extensions available: https://www.djangopackages.com/grids/g/model-inheritance/ But it is hard for me to decide which one to take. The most common solutions seem to be: django-model-utils django-polymorphic My use case is simple: This

Deploying CSS/JS with pip

2013-05-21 Thread Thomas Güttler
fanstatic together with django? My goal is to easy the automated deployment. How do you handle the dependency on external resources like jquery libraries? Do you store a tgz file inside your source code repository? Regards, Thomas Güttler [1] http://www.fanstatic.org/en/latest/ -- Yo

SCGI (or other) graceful restart

2007-11-30 Thread Thomas Güttler
to support graceful restart. Thomas -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917 TBZ-PARIV GmbH Geschäftsführer: Dr. Reiner Wohlgemuth Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543

Re: Out of range value

2007-11-26 Thread Thomas Güttler
column 'poolMaskID' at row 1! There is a patch which works for me (postgres): http://code.djangoproject.com/ticket/399 -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917 TBZ-PARIV GmbH Geschäftsführer: Dr. Reiner Wohlgemuth Sitz der Gese

Re: validating fields with newforms - part 2

2007-11-26 Thread Thomas Güttler
ield() end = IntegerField() def clean(self): start, end = self.cleaned_data.get('start'), self.cleaned_data.get('end') if start!=None and end!=None and start>end: self.errors.append('start', u'start must be smaller than end') return self.cl

settings.py gets imported twice

2007-11-05 Thread Thomas Güttler
rt__(self.SETTINGS_MODULE, {}, {}, ['']) File "/localhome/user/myproject/settings.py", line 147, in ? This shnippet has a workaround: http://www.djangosnippets.org/snippets/16/ (I have not tested it yet) I think it would be better to avoid a second import. Any hints? Thomas --

Get all related instances

2007-10-22 Thread Thomas Güttler
_object in meta.get_all_related_objects()+meta.get_all_related_many_to_many_objects(): attr = getattr(instance, related_object.get_accessor_name()) related.extend(attr.all()) return related -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347

No tests for newforms

2007-10-04 Thread Thomas Güttler
Hi, I was told to include a test in my newforms patch: http://code.djangoproject.com/ticket/5335 I couldn't find any tests for newforms. Am I blind? Thomas -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917 TBZ-PARIV GmbH

Traceback of endless loop

2007-07-26 Thread Thomas Güttler
Hi, how can you get a traceback if the script is inside a endless loop. Standalone python apps give you this by sending SIGINT. But this does not work with mod_python or the builtin webserver. Any hints? Thomas -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126

newforms: I18N (Date und Decimal)

2007-07-06 Thread Thomas Güttler
orking on this? Thomas -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917 TBZ-PARIV GmbH Geschäftsführer: Dr. Reiner Wohlgemuth Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HR

Re: CharField vs. CharField

2007-07-06 Thread Thomas Güttler
Am Freitag, 6. Juli 2007 10:41 schrieb Malcolm Tredinnick: > On Fri, 2007-07-06 at 10:35 +0200, Thomas Güttler wrote: > > Hi, > > > > I think it is bad, that there are two CharField classes. ... > Any particular reason you only want to change CharField? Or any > tec

Attributes for ManyToMany

2007-07-06 Thread Thomas Güttler
Hi, How can you add attributes to ManyToMany Relations? Given the example: http://www.djangoproject.com/documentation/models/many_to_many/ Publication -- N:M -- Article How can you store the page number of the published article? Thomas -- Thomas Güttler, http://www.tbz-pariv.de

CharField vs. CharField

2007-07-06 Thread Thomas Güttler
Hi, I think it is bad, that there are two CharField classes. One for OR-Mapping and one for HTML (new)forms. Why not change the HTML classes to ...InputField? Thomas -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917 TBZ-PARIV GmbH

FileField: id of row (like strftime)

2007-05-25 Thread Thomas Güttler
y(MyObject) This way all attachments of one MyObjects are in the same directory. This would be very nice. Thomas -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917 TBZ-PARIV GmbH Geschäftsführer: Dr. Reiner Wohlgemuth Sitz der Gesellschaft