Global access to request.user

2015-03-26 Thread guettli
I have a large legacy application which passes around the request to nearly every method. Reading this source is no fun. In about 95% of all cases "request" is not used, but "request.user" is needed for permission checking. Example: there is a drop down box with the list of possible actions

Re: Global access to request.user

2015-03-27 Thread guettli
Am Donnerstag, 26. März 2015 15:52:07 UTC+1 schrieb Anderson Resende: > > You can use middlewares!!! It is a way... > > > I don't understand how middleware can help here. The only way I see is that the middleware updates a global variable for the data. In my case request.user. Anderson, is

Serialize QuerySet Q (not the result)

2015-04-20 Thread guettli
We want to store the QuerySet query (not the result) some how. Background: users should be able to save a complex query as "my favorite query". Pickling querysets is possible, but version updates are not supported:

Re: Serialize QuerySet Q (not the result)

2015-04-21 Thread guettli
erwise it would be easy. I just need to store the input values of the form. I know that is very hard to make all filtering features available. But at least the basic filtering should be serializable. Regards, Thomas Güttler > On Mon, Apr 20, 2015 at 10:01 AM, guettli <h...@tbz-pariv.de &g

Re: Serialize QuerySet Q (not the result)

2015-04-22 Thread guettli
Up to now only Q objects. If you know how to serialize aggregation / annotations, this would be great :-) Am Dienstag, 21. April 2015 14:35:52 UTC+2 schrieb Vijay Khemlani: > > Do you only need to serialize Q objects? No aggregation / annotations? > > On Tue, Apr 21, 2015 at 8:00 AM

How to find a view in a complex web application

2015-04-28 Thread guettli
We have a complex intranet application. It has many view. The problem: How to find the view a user wants to use? A huge sitemap HTML does not help. Is there a way to search the matching view? Maybe even with auto complete? -- You received this message because you are subscribed to the

Re: How to find a view in a complex web application

2015-04-30 Thread guettli
Am Dienstag, 28. April 2015 16:49:18 UTC+2 schrieb Andrew Farrell: > > If you are asking this question as a developer who wants to know what view > to use to affect a page when you know the url, I recommend you install The > Silver Searcher , which lets you run > >

Re: How to find a view in a complex web application

2015-04-30 Thread guettli
table of course, but the data in it could > be changed dynamically (e.g. adding more categories and aliases) without > affecting the logic of your app. > > [Hey - this could even make a cool app on its own!] > > Hope these ideas help my project is a just a boring menu-driven one. > &

Re: How to find a view in a complex web application

2015-05-04 Thread guettli
> comment on what the rest of your database should contain. > > Derek > > On Thursday, 30 April 2015 13:26:25 UTC+2, guettli wrote: >> >> Hi Derek, >> >> yes, your idea looks good. >> >> Next question would be: How to lay out the database structure (

Choosing an auth module: Login via Facebook, Google, ...

2015-05-06 Thread guettli
I need a library to let users loging via Facebook, Google, ... I looked at this page: https://www.djangopackages.com/grids/g/authentication/ It's hard for me to decide which one to use. I have no special requirements except the end user experience should be good. The login for new users

Re: Choosing an auth module: Login via Facebook, Google, ...

2015-05-07 Thread guettli
can even check that support request for >> 1.8 is already closed at github ( >> https://github.com/pennersr/django-allauth/issues/858). >> >> -- >> wbr, >> rush. >> >> >> >> 06.05.2015, 09:17, "guettli" <h...@tbz-pari

Django model inheritance: create sub-instance of existing instance (downcast)?

2015-05-12 Thread guettli
Hi, this ticket is seven years old https://code.djangoproject.com/ticket/7623 {{{ As it exists now, multi-table inheritance does not allow for the creation of a child model instance that inherits from an existing parent model instance. For example: Parent Class- class

Re: Django model inheritance: create sub-instance of existing instance (downcast)?

2015-05-13 Thread guettli
a look at > http://django-model-utils.readthedocs.org/en/latest/managers.html#inheritancemanager? > > I'm not sure if it will help but it's kind of related to what you've posted. > > On 12 May 2015 at 23:10, guettli <h...@tbz-pariv.de > wrote: > >> Hi, >> >

Re: Django model inheritance: create sub-instance of existing instance (downcast)?

2015-05-18 Thread guettli
Thank you Simon. I did not know save_base(raw=True) before. Am Mittwoch, 13. Mai 2015 16:43:36 UTC+2 schrieb Simon Charette: > > Hi Guettli, > > This isn't part of the public API but you could rely on how Django loads > fixture internally > <https://github.c

Reuse jquery

2015-06-02 Thread guettli
I guess I am missing something. Is there no way to load jquery only once per page? Use case: I have two widgets which need jquery. I want to use these widgets inside the admin interface and on custom pages. The admin interface has its own jquery and in jquery.init.js this gets done: var django

Re: Reuse jquery

2015-06-02 Thread guettli
access it as django.jQuery ? > > On Tue, Jun 2, 2015 at 4:22 AM, guettli <h...@tbz-pariv.de > > wrote: > >> I guess I am missing something. >> >> Is there no way to load jquery only once per page? >> >> Use case: I have two widgets which need j

custom permission strings: Avoid magic strings ...

2015-08-05 Thread guettli
Hi, We define the permission like in the docs: https://docs.djangoproject.com/en/1.8/topics/auth/customizing/#custom-permissions To avoid the magic string 'fooapp.fooperm' in the code which uses the permission very often, I choose this solution: {{{ # file models.py class FooModel(Model):

ATOMIC_REQUESTS Middleware inside Transaction

2015-08-11 Thread guettli
I am not happy that settings.ATOMIC_REQUESTS=True isolates only the view, but not the middlewares in one transaction. For applications like reversion (app which records the changes of a model) it is very important, that the middleware runs inside the same transaction. If storing the changes

Re: ATOMIC_REQUESTS Middleware inside Transaction

2015-08-20 Thread guettli
Sad, not reply since nine days ... Is there something you don't understand? Please ask :-) Am Dienstag, 11. August 2015 09:24:37 UTC+2 schrieb guettli: > > I am not happy that settings.ATOMIC_REQUESTS=True isolates only the view, > but not the middlewares > in one

Django CMS or Wiki?

2015-08-24 Thread guettli
I am unsure which application I should use for my personal homepage. At work we use a wiki and I like it a lot, since you can edit the content very fast and linking between pages is very easy. On the other hand django cms seems to be a widespread application and it could be a solid ground for

Re: Django CMS or Wiki?

2015-08-24 Thread guettli
A static content generator is what I use up to now. I want to alter the site from every web enabled device (pc or tablet). Am Montag, 24. August 2015 14:30:07 UTC+2 schrieb Shawn Milochik: > > On Mon, Aug 24, 2015 at 2:49 AM, guettli <h...@tbz-pariv.de > > wrote: > >>

turn on "string_if_invalid" as a ‘development default’

2016-01-14 Thread guettli
I would like to do this: turn on "string_if_invalid" as a ‘development default’ The django docs say: While string_if_invalid can be a useful debugging tool, it is a bad idea to turn it on as a ‘development default’.

Re: turn on "string_if_invalid" as a ‘development default’

2016-01-18 Thread guettli
which have string_if_invalid enabled in the first run? What do you gain by running the tests twice? Regards, Thomas Güttler Am Donnerstag, 14. Januar 2016 18:33:13 UTC+1 schrieb James Schneider: > > On Jan 14, 2016 7:50 AM, "guettli" <guet...@thomas-guettler.de > > wr

Re: turn on "string_if_invalid" as a ‘development default’

2016-01-19 Thread guettli
Am Montag, 18. Januar 2016 12:02:15 UTC+1 schrieb James Schneider: > > A second batch of tests? >> >> I am unsure if I understood you: Do you mean new tests, or running the >> same >> tests again, with a different settings file? >> > > I meant the latter. Sorry for not being clear. > > >> >>

Polymorphic Inheritance

2014-05-13 Thread guettli
I search for a way to get polymorphic inheritance like in "Single table inheritance" [1] I have found this comparison site: https://www.djangopackages.com/grids/g/model-inheritance/ Before I try each, I want to ask here, if someone answer some questions: I have three classes: Parent,

Install Django Apps via Admin Interface

2014-09-10 Thread guettli
How can I install Django apps via admin interface? -- 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...@googlegroups.com. To post to this

Add model item with AJAX pop up

2016-02-06 Thread guettli
I use django-select2 for easy ForeignKey picking. Works nice. But how can I add a new item in the ForeignKey table? I would like to have a big [+] button near the select2 field and then a (ajax) modal dialog should open (like in the admin

Re: Add model item with AJAX pop up

2016-02-06 Thread guettli
f the data is not valid. I could code this myself. But I ask myself it is good to do so. I guess this has already been solved many times before. I most cases there is a library/reusable-app. But here I found none. Regards, Thomas Güttler Am Samstag, 6. Februar 2016 14:12:48 UTC+1 schrieb guettli: > &

Re: Add model item with AJAX pop up

2016-02-08 Thread guettli
elect field > > but I don't know any application which implement all this stack. I think > you should handle this modal by yourself > > On Saturday, February 6, 2016 at 4:12:48 PM UTC+3, guettli wrote: >> >> I use django-select2 <https://github.com/applegrew/django-s

Provide way to add an item during "Selecting a ForeignKey"

2016-02-27 Thread guettli
I use django-select2 for easy ForeignKey picking. Works nice. But how can I add a new item in the ForeignKey table? I would like to have a big [+] button and then a dialog should open. AFAIK django-select2 does not help here. Is there a

Re: Provide way to add an item during "Selecting a ForeignKey"

2016-03-02 Thread guettli
I found that django-autocomplete-light supports "Add another popup outside the admin": http://django-autocomplete-light.readthedocs.org/en/latest/addanother.html This is exactly what I was looking for :-) Am Samstag, 27. Februar 2016 14:28:27 UTC+1 schrieb guettli: > > I us

Re: Provide way to add an item during "Selecting a ForeignKey"

2016-03-02 Thread guettli
Just for the records: "add another" is one compared feature in this comparison grid: https://www.djangopackages.com/grids/g/auto-complete/ Am Mittwoch, 2. März 2016 13:12:02 UTC+1 schrieb guettli: > > I found that django-autocomplete-light supports "Add another popup

Re: Add model item with AJAX pop up

2016-03-03 Thread guettli
2016 21:12:47 UTC+1 schrieb guettli: > > There many auto-complete fields. Adding an item in a popup is needed very > often. The django-admin does it, too. > > For me it is strange that there is no reusable widget for this. > > Am Montag, 8. Februar 2016 09:17:48 UTC+1 schrieb p

More declarative way to tie permissins to CBV

2016-03-22 Thread guettli
My goal: If user "foo" comes to the me (playing the admin role) and says: I don't have permissions for URL "foo-url", then I want to enter the URL and the username into some admin interface and then the this should tell me why the user is allowed or not allowed to access the URL. Example

extend Media in custom template tag

2016-05-09 Thread guettli
I have a custom Django template tag which creates HTML. This HTML needs some JS and CSS. How can I extend the media list with my custom template tag? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: extend Media in custom template tag

2017-02-22 Thread guettli
I see replies. Now I am unsure what happened: - nobody read my question - someone read it, but did not understand it - someone read it, understood it, but had no solution. - ... other. Am Montag, 9. Mai 2016 10:25:49 UTC+2 schrieb guettli: > > I have a custom Django template tag

Re: extend Media in custom template tag

2017-02-22 Thread guettli
/41592766/django-include-media-css-js-in-class-based-views Am Montag, 9. Mai 2016 10:25:49 UTC+2 schrieb guettli: > > I have a custom Django template tag which creates HTML. > > > This HTML needs some JS and CSS. > > > How can I extend the media list with my custom template t

Re: good 404 vs bad 404

2017-03-01 Thread guettli
Am Mittwoch, 1. März 2017 10:42:44 UTC+1 schrieb Andréas Kühne: > > I think you should always report a 404 as a 404 regardless of the > situation. > > The application shouldn't have to know if it is a valid 404 or an > "invalid" - because from the applications point of view, the page (or

Re: good 404 vs bad 404

2017-03-01 Thread guettli
Am Mittwoch, 1. März 2017 10:54:38 UTC+1 schrieb Antonis Christofides: > > My gut feeling says you should treat this in monitoring, however here are > some questions: > > 1) Why do you monitor 404s at all? > > 2) Could you give some examples of 404s that are valid or should be > ignored? > > I

Re: good 404 vs bad 404

2017-03-01 Thread guettli
k you should always report a 404 as a 404 regardless of the >> situation. >> >> The application shouldn't have to know if it is a valid 404 or an >> "invalid" - because from the applications point of view, the page (or item) >> couldn't be found. >> &g

good 404 vs bad 404

2017-03-01 Thread guettli
In systems which are accessed only via intranet we used to monitor http 404 responses. Every time a 404 happens, an issue in our monitoring gets created. This worked well in the past. Now we have cases where a 404 is valid or should be ignored. No issue in the monitoring should be visible.

Re: Executing DB-Queries during import

2017-03-23 Thread guettli
/7JwWatLfP44/discussion > . > > On Wednesday, March 22, 2017 at 12:16:16 PM UTC-4, guettli wrote: >> >> If I recall correctly, then you should not execute db-queries during >> import. >> >> I think this can do a lot of trouble. For example during test-discove

Executing DB-Queries during import

2017-03-22 Thread guettli
If I recall correctly, then you should not execute db-queries during import. I think this can do a lot of trouble. For example during test-discovery db-queries get executed. Is it just me being paranoid, or is this a general advice? I tried to find something about this topic with my favorite

Re: No support for UNION (OUTER JOIN instead)

2017-03-24 Thread guettli
Just for the records. If you think further, then deprecating is_superuser, is_staff and is_active could be a solution. See: https://groups.google.com/forum/#!topic/django-developers/J9yttc7WmJU Am Mittwoch, 15. März 2017 10:44:22 UTC+1 schrieb guettli: > > > Just for the records, I a

Re: System check framework suiteable for monitoring?

2017-03-27 Thread guettli
Am Montag, 27. März 2017 11:31:22 UTC+2 schrieb Jani Tiainen: > > Hi, > > Checks framework is mainly built to prevent system starting management > commands in case of invalid state of the system. It's not meant for health > monitoring. > There exists several ways to run health checks - we use

System check framework suiteable for monitoring?

2017-03-27 Thread guettli
I guess a lot of people here are not only developers, they are operators, too. I mean they need to care for a production system and ensure it is up and healthy. I am unsure if the System Check Framework[1] inside Django is suited to do monitoring checks. With "monitoring checks" I mean these

Re: Executing DB-Queries during import

2017-03-29 Thread guettli
Am Mittwoch, 22. März 2017 19:20:43 UTC+1 schrieb Tim Graham: > > Correct, module level queries should be avoided. Django might try to add > some detection to warn about or prohibit that, see > https://groups.google.com/d/topic/django-developers/7JwWatLfP44/discussion > . > > I understand db

Re: No support for UNION (OUTER JOIN instead)

2017-03-15 Thread guettli
Just for the records, I added your work-around (until Django 1.11) to as comment on the issue tracker. Am Dienstag, 14. März 2017 10:37:07 UTC+1 schrieb guettli: > > Great, you and the django dev team are fast than light. Every time I spot > a basic missing part, you have alrea

superuser having all permissions makes perm checking messy

2017-03-16 Thread guettli
This is not a question, just a feeling. I want to know if you feel the same pain. Checking for permission in django is done in two steps: check1: check if user is superuser, then user is allowed. check2: check if user has the given permission. This OR is solvable. It's easy to code. It is

Re: superuser having all permissions makes perm checking messy

2017-03-20 Thread guettli
Am Samstag, 18. März 2017 06:00:14 UTC+1 schrieb Melvyn Sopacua: > > On Thursday 16 March 2017 02:29:21 guettli wrote: > > > > > In our custom code we already skip check1 and do only check2. > > > > Why do you even do these checks? > Good question.

Re: superuser having all permissions makes perm checking messy

2017-03-17 Thread guettli
citly Django does that when you > check does user have a permission and returns true for all perm checks. > So it's just simple check. > > Unless you meant something else, maybe giving a sample code would help > understand your problem better. > > On 16.03.2017 11:29, guettli

Re: Executing DB-Queries during import

2017-04-04 Thread guettli
Am Donnerstag, 30. März 2017 00:55:40 UTC+2 schrieb Simon Charette: > > > Is it advisable to execute db queries in my AppConfig ready signal > handler? > > AppConfig.ready() is still at module-level. > > ok. Good to know. > > Use case: I want to add URL patterns which get collected from db

ORM for structured Logs

2017-04-04 Thread guettli
In the past I was told: Don't store logs in the database. Time (and hardware) has changed. I think it is time to store logs where I have great tools for analyzing logs. Storing in a model which I can access via django orm is my current strategy. It seems no one has done this before. I could

Re: ORM for structured Logs

2017-04-07 Thread guettli
Am Donnerstag, 6. April 2017 10:42:17 UTC+2 schrieb Christian Ledermann: > > On 6 April 2017 at 09:15, guettli <guet...@gmail.com > > wrote: > > Hello Brick Wall, how are you doing? > > Hello Stonemason. > > What is your question? > > It was more

Re: ORM for structured Logs

2017-04-07 Thread guettli
Hi Marten, Am Donnerstag, 6. April 2017 14:10:58 UTC+2 schrieb knbk: > > Hi Thomas, > > The primary purpose of logging is to catch and examine errors. If > something went wrong, you want to know *when *and *why*. Logging to a > database increases the complexity and greatly increases the number

Re: ORM for structured Logs

2017-04-06 Thread guettli
Hello Brick Wall, how are you doing? Am Dienstag, 4. April 2017 14:18:42 UTC+2 schrieb guettli: > > In the past I was told: Don't store logs in the database. > > Time (and hardware) has changed. > > I think it is time to store logs where I have great tools for analyzing &

Re: ORM for structured Logs

2017-04-10 Thread guettli
it working. Again, thank you for sharing your solution. Regards, Thomas Am Samstag, 8. April 2017 18:58:59 UTC+2 schrieb Scot Hacker: > > On Tuesday, April 4, 2017 at 5:18:42 AM UTC-7, guettli wrote: >> >> In the past I was told: Don't store logs in the database. >> >

Alternative to celery

2017-04-20 Thread guettli
Some years ago I used celery for a project. Today I face roughly the same use case again. The last time I used it, celery felt to heavy weighted, too complicated. I found this alternative: http://python-rq.org/ There are two things which speak agains python-rq: - redis is a cache. I need a

Re: No support for UNION (OUTER JOIN instead)

2017-03-14 Thread guettli
t; Django 1.11. > > > https://github.com/django/django/commit/84c1826ded17b2d74f66717fb745fc36e37949fd > > On Monday, March 13, 2017 at 11:54:15 AM UTC-4, guettli wrote: >> >> We have performance issues on postgres because some SQL statements have >> up to six LEFT OU

No support for UNION (OUTER JOIN instead)

2017-03-13 Thread guettli
We have performance issues on postgres because some SQL statements have up to six LEFT OUTER joins. Union and intersection would be easier to read for me (human being) and maybe better to optimize for the postgres query planer. It seems that other people have this issue, too:

Row based permissions: In DB or App? ... farewell pain

2017-08-03 Thread guettli
First I asked a similar question on the postgresql-general list. The discussion[1] has settled there. Now I would love the hear what you think. I am thinking about rewriting an existing application which uses PostgreSQL via Django. Up to now the permission checks are done at the

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-16 Thread guettli
Am Donnerstag, 10. August 2017 14:30:31 UTC+2 schrieb Vijay Khemlani: > > It's still implemented like that in the background, but I'm not sure why > do you call it slow. > > Here are more docs about guardian being slow:

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-11 Thread guettli
Am Freitag, 11. August 2017 10:05:00 UTC+2 schrieb James Schneider: > > >> My concern is that this python code can't return a queryset with all > items where a given permission+user tuple match. > > > def has_perm(obj, user): > if user.is_superuser: > return True > > This means I

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-11 Thread guettli
Am Donnerstag, 10. August 2017 14:30:31 UTC+2 schrieb Vijay Khemlani: > > It's still implemented like that in the background, but I'm not sure why > do you call it slow. > > Did you run benchmarks? Profiling? > > Usually your own business logic will be the bottleneck of your > application, not

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-10 Thread guettli
Am Mittwoch, 9. August 2017 18:03:44 UTC+2 schrieb Vijay Khemlani: > > > https://django-guardian.readthedocs.io/en/stable/userguide/check.html#get-objects-for-user > > projects = get_objects_for_user(request.user, 'projects.view_project') > > > Thank you for providing this link. I guess it is

Re: Use one correspondig database user for each application user

2017-08-14 Thread guettli
Am Freitag, 21. Juli 2017 19:55:17 UTC+2 schrieb Fred Stluka: > > Answer: Connection pooling > > Sharing a single DB user for all/multiple Web app users allows > connection pooling. Otherwise, you have to create a new DB > connection for each HTTP request, or at least for each web app > user.

Re: Use one correspondig database user for each application user

2017-07-17 Thread guettli
Am Donnerstag, 13. Juli 2017 10:32:26 UTC+2 schrieb Antonis Christofides: > > BTW, > > another idea for "connecting" to PostgreSQL as different users would be to > actually have Django connect to PostgreSQL as a superuser and then > (probably in some early middleware) execute SET SESSION

Re: Use one correspondig database user for each application user

2017-07-11 Thread guettli
Am Dienstag, 11. Juli 2017 11:46:41 UTC+2 schrieb Avraham Serour: > > Where would you store the password hashes? > > I see several possible ways. 1. use django.contrib.auth for authentication like before. The initial connection to the db gets done via a database-superuser. After auth in

Use one correspondig database user for each application user

2017-07-11 Thread guettli
I guess most applications have exactly one database user. Why not use one database for each application user? Example: User "foo" in my web application has a corresponding database user "foo". This way you could use row level security from the database. PostgreSQL has a lot of interesting

Re: Use one correspondig database user for each application user

2017-07-11 Thread guettli
obably do things differently, and maybe there exist custom > database backends that would allow you to switch the database user on > login, but if there's no compelling reason you should really stick to the > canonical way. > > Regards, > > Antonis > > Antonis Christofidesht

Re: Use one correspondig database user for each application user

2017-07-13 Thread guettli
(current_setting('my.username') IN (message_from, message_to)) WITH CHECK (message_from = current_setting('my.username')) Regards, Thomas Güttler Am Dienstag, 11. Juli 2017 11:40:53 UTC+2 schrieb guettli: > > I guess most applications have exactly one database user. > > Why not use

Re: From old-school Post/Redirect/Get to modern web

2017-07-25 Thread guettli
nd Angular seem to be supported - nice. thank you for sharing this link. Regards, Thomas > HTH > > On 24 July 2017 at 11:36, guettli <guet...@gmail.com > > wrote: > > I use Post/Redirect/Get since several years. I use simple HTML forms > (via > > ModelForm)

From old-school Post/Redirect/Get to modern web

2017-07-24 Thread guettli
I use Post/Redirect/Get since several years. I use simple HTML forms (via ModelForm) with a plain old submit-button. Above pattern works. But I think the web of the future works different. Up to now my web application sends html to the web

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
a lot easier than working in raw > SQL :-) but you will of course need to adapt the queries to make them > faster (which can be done by prefetching for example). > > That's just my 2 cents. > > Regards, > > Andréas > > 2017-08-07 8:43 GMT+02:00 guettli <guettli...@thoma

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
Am Mittwoch, 9. August 2017 10:04:25 UTC+2 schrieb James Schneider: > > > > On Aug 3, 2017 1:08 AM, "guettli" <guet...@gmail.com > wrote: > > First I asked a similar question on the postgresql-general list. The > discussion[1] has settled there. > &g

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
ng python is more easy, but if you need the conditions in SQL WHERE to get a queryset, you don't have python. You have a nice ORM MyModel.objects.filter(...) which is nice and helps to create the needed SQL statements. > That's just my 2 cents. > > Regards, > > Andréas >

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
to the canonical way. The canonical way is more maintainable, >> because it's widely used. It will be easier for other programmers to >> understand what you are doing. Elegance of solution is not compelling >> enough. A compelling reason would be, for example, if you also have a &g

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
Am Mittwoch, 9. August 2017 10:46:10 UTC+2 schrieb James Schneider: > > Sorry for the duplicate, accidently hit send before I was done, finished > below. > > On Aug 3, 2017 1:08 AM, "guettli" <guet...@gmail.com > wrote: > > First I asked a similar qu

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-07 Thread guettli
; would make me happy. Thank you. Am Donnerstag, 3. August 2017 10:07:53 UTC+2 schrieb guettli: > > First I asked a similar question on the postgresql-general list. The > discussion[1] has settled there. > > Now I would love the hear what you think. > > > I am think

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-17 Thread guettli
Am Mittwoch, 16. August 2017 13:39:53 UTC+2 schrieb Vijay Khemlani: > > So, please share the specific numbers you got from your profiling. > > Why should I share the numbers? How would this help? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-18 Thread guettli
Am Donnerstag, 17. August 2017 16:09:42 UTC+2 schrieb Vijay Khemlani: > > How can we propose faster alternatives if we don't know how fast must it > be? > > Of course it is up to you in the end, but if you are seriously considering > exotic options such as using stored procedures at least I

Re: vs {{ form }}

2017-05-17 Thread guettli
Hi Russell Keith-Magee, which version do you use? With or without table? {{ form }} vs {{ form }} Regards, Thomas Am Dienstag, 16. Mai 2017 17:52:19 UTC+2 schrieb Russell Keith-Magee: > > > On 16 May 2017, 12:51 AM -0700, guettli <guettli...@thomas-guettler.de > >, w

Re: vs {{ form }}

2017-05-16 Thread guettli
Am Mittwoch, 10. Mai 2017 10:56:56 UTC+2 schrieb Melvyn Sopacua: > > On Tuesday 09 May 2017 14:08:44 Jani Tiainen wrote: > > > > > And to use bootstrap you don't need any special package, you can do it > > > without it just fine. > > > > To render a webpage, you don't need Django you can do

Re: vs {{ form }}

2017-05-18 Thread guettli
Am Mittwoch, 17. Mai 2017 23:14:04 UTC+2 schrieb James Schneider: > > > > On May 17, 2017 6:31 AM, "guettli" <guettli...@thomas-guettler.de > > wrote: > > Hi Russell Keith-Magee, > > which version do you use? With or without table?

Re: vs {{ form }}

2017-05-19 Thread guettli
Am Freitag, 19. Mai 2017 10:46:02 UTC+2 schrieb James Schneider: > > > > On Thu, May 18, 2017 at 8:14 AM, guettli <guettli...@thomas-guettler.de > > wrote: > >> >> >> >> Am Mittwoch, 17. Mai 2017 23:14:04 UTC+2 schrieb James Schneider: >>>

Generic Search for any Django Model

2017-06-02 Thread guettli
There are several libraries which enable you to do fancy pagination of django queryset. See this grid: https://djangopackages.org/grids/g/pagination/ I have not look at all libraries, but the one I saw needed a queryset as input. I search a solution for the step before this: How to get to

Re: SingleObjectMixin docs Typo?

2017-06-07 Thread guettli
456af6c84. > > Thanks. > > On Tuesday, June 6, 2017 at 8:44:31 AM UTC-4, guettli wrote: >> >> Current docs of SingleObjectMixin.get_context_data(): >> >> >> *> Returns context data for displaying the list of objects.* >> Source: >> https://

Re: Generic Search for any Django Model

2017-06-06 Thread guettli
Thank you Melvyn Sopacua, I was blind :-) Am Freitag, 2. Juni 2017 16:19:10 UTC+2 schrieb Melvyn Sopacua: > > On Friday 02 June 2017 07:10:15 guettli wrote: > > > There are several libraries which enable you to do fancy pagination of > > > django queryset. > >

{{ form }} vs {{ form }}

2017-05-04 Thread guettli
I am unsure how to render a form. I see these ways - {{ form }} - {{ form }} If I use a model form, then the first way is the correct one. How to you solve this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: {{ form }} vs {{ form }}

2017-05-05 Thread guettli
Am Donnerstag, 4. Mai 2017 16:03:25 UTC+2 schrieb Todor Velichkov: > > Take a look at: > 1) Form rendering options > > 2) Outputting forms as HTML >

SingleObjectMixin docs Typo?

2017-06-06 Thread guettli
Current docs of SingleObjectMixin.get_context_data(): *> Returns context data for displaying the list of objects.* Source: https://docs.djangoproject.com/en/1.11/ref/class-based-views/mixins-single-object/#django.views.generic.detail.SingleObjectMixin.get_context_data I don't understand "the

How to clean a form which receives multiple files

2017-09-22 Thread guettli
I am not happy with this snippet from the django docs: from django.views.generic.edit import FormViewfrom .forms import FileFieldForm class FileFieldView(FormView): form_class = FileFieldForm template_name = 'upload.html' # Replace with your template. success_url = '...' #

Re: How to clean a form which receives multiple files

2017-09-25 Thread guettli
thank you very much for your Feedback! Am Freitag, 22. September 2017 18:24:23 UTC+2 schrieb mike: > > I do it this way too and agree that it feels dirty. Curious to hear what > others have to say about this! > > On Fri, Sep 22, 2017 at 9:18 AM, guettli <guet...@gmail.com >

custom permission strings: Avoid magic strings ...

2017-12-15 Thread guettli
Hi, We define the permission like in the docs: https://docs.djangoproject.com/en/1.11/topics/auth/customizing/#custom-permissions To avoid the magic string 'fooapp.fooperm' in the code which uses the permission very often, I choose this solution: {{{ # file models.py class FooModel(Model):

Re: WSGI Steps and Sequence ... django.setup() reduces latency?

2017-11-10 Thread guettli
ee43d72de2%2Flib%2Fnotmm%2Fcontrollers%2Fwsgi.pyx%3Fat%3D0.8-devel%26fileviewer%3Dfile-view-default=D=1=AFQjCNHYxgjPBcU31r96OObm4-IX-GtP0g> > > > I confess, I don't understand what you want to tell me with above link. How does django-hotsouce relate to this question? > Etien

WSGI Steps and Sequence ... django.setup() reduces latency?

2017-11-07 Thread guettli
I guess wsgi uses these steps: 1. WSGI Process starts (Up to now no single request comes in) 2. HTTP Requests comes in. You can get this timestamp via X-Request-Start. See https://docs.newrelic.com/docs/apm/applications-menu/features/request-queue-server-configuration-examples 3. Django gets

Simple file uploading app

2017-10-25 Thread guettli
I need a simple file uploading app. Every user should be able to upload files to his own area. This is the basic feature. You could think of additional goodies, but the first step is above feature. I tried to find an application which implements this, but failed. I tried this and other

Re: Crazy Idea: OOP for "Hyperlink"

2018-05-04 Thread guettli
gt; -- > -- > Anthony Flury > email : *anthon...@btinternet.com * > Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>* > > On 30/04/18 08:24, guettli wrote: > > > > > > Am Donnerstag, 26. April 2018 15:54:31 UTC+2 schrieb Matthew Pava: > > >

Re: Crazy Idea: OOP for "Hyperlink"

2018-04-30 Thread guettli
Am Donnerstag, 26. April 2018 15:54:31 UTC+2 schrieb Matthew Pava: > > I’ve been thinking about your idea, and I wonder if there could instead be > some kind of widget for URL objects (or views). > > > A widget ... Let me think about it. A widget is a libray, is source code. The code needs

Re: Simple file uploading app

2017-10-27 Thread guettli
I am unsure. I want to upload excel and pdf mostly, and there are no docs. Am Mittwoch, 25. Oktober 2017 17:16:35 UTC+2 schrieb Jani Tiainen: > > Hi. > > I did simple pic uploader while ago. > > Source code is available at https://github.com/jtiai/picpaster > > 25.1

  1   2   >