Re: Decorator function argument woes

2018-04-29 Thread Mike Dewhirst
On 30/04/2018 4:30 PM, Stephen J. Butler wrote: Yes. I don't see it in the documentation for login_required, but I believe it's so that you can do something like this in your urls.py: urlpatterns = [     url(r'^example$', login_required(views.example)), ] That might be an older way of using th

Re: Decorator function argument woes

2018-04-29 Thread Stephen J. Butler
Yes. I don't see it in the documentation for login_required, but I believe it's so that you can do something like this in your urls.py: urlpatterns = [ url(r'^example$', login_required(views.example)), ] That might be an older way of using the decorator? IDK for sure. But you can see from the

Re: Decorator function argument woes

2018-04-29 Thread Mike Dewhirst
On 30/04/2018 3:35 PM, Stephen J. Butler wrote: @login_required doesn't take a test function. You need to use @user_passes_test directly. Thank you Stephen. I thought I'd start another thread to ask about my use case of being able to require login or not depending on whether the content neede

Re: Decorator function argument woes

2018-04-29 Thread Stephen J. Butler
@login_required doesn't take a test function. You need to use @user_passes_test directly. On Mon, Apr 30, 2018 at 12:26 AM, Mike Dewhirst wrote: > I'm pretty sure this is a not-understanding-python problem rather than a > Django problem but here goes ... > > In a (FBV) view I'm trying to pass a

Decorator function argument woes

2018-04-29 Thread Mike Dewhirst
I'm pretty sure this is a not-understanding-python problem rather than a Django problem but here goes ... In a (FBV) view I'm trying to pass a function in to the login_required decorator. My function is called 'is_login_needed' and I want the login_required

Re: Re-using CreateView, UpdateView & friendship

2018-04-29 Thread Mikkel Kromann
Hmmm. It might be my question 3 after all. After a good night's sleep, I re-read the Figure 8.1 on Function vs Class Based Views in Two Scoops of Django ... 1) No generic view match closely what I have in mind (I think?) 2) I don't think I need to subclass my view 3) I suspect my CBV will need to

Re: Broken?

2018-04-29 Thread George Lubaretsi
File "/raid3/build/comprosloco/oil/models.py", line 172, in __str__ self.accepted What is inside this __str__ method? `self.accepted` field name sounds like it could be a date. Return type of __str__ must be a string. -- You received this message because you are subscribed to the Google G

updating model breaks admin

2018-04-29 Thread George Lubaretsi
If the data is not important, try to delete migration files from `migrations` package, drop the database tables and reference M2M relationship using strings: tags = models.ManyToManyField('Tag') Or if the Tag model is in another app: tags = models.ManyToManyField('app_name.Tag') Then run `make

Re: updating model breaks admin

2018-04-29 Thread George Lubaretsi
If the data is not important, try to delete migration files from `migrations` package, drop the database tables and reference M2M relationship using strings like so: tags = models.ManyToManyField(`Tag`) Or if the Tag model is in another app, like so: tags = models.ManyToManyField(`app_name.Tag`)

updating model breaks admin

2018-04-29 Thread Gloria Elena
Hi all, I want to request your help and I am sure you can guess by the question that I am fairly new to Django and THANK YOU IN ADVANCE, I would like to, someday, publish this portfolio website. I am sure I am making such a rookie mistake and will have to kick myself for making such a silly error

Re: subhani_Django subject

2018-04-29 Thread lakshitha kumara
Hello Subhani Please look at this Example on github, https://github.com/search?utf8=%E2%9C%93&q=django+example+&type= Thanks On Sunday, April 29, 2018 at 10:24:03 PM UTC+5:30, subhani shaik wrote: > > Hi friends... > > Can you please help me how to design web application using Django. can you

New language adding error('Unknown language code si.')

2018-04-29 Thread lakshitha kumara
Hello Guys I added new language to django . language called Sinhala. My code is look like this. On settings page LANGUAGE_CODE = 'en' LANGUAGES = [ ('si', _('Sinhala')), ('en', _('English')), ] TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True LOCALE_PATHS = ( os

Re: model permission assignment via groups requires further config at model level?

2018-04-29 Thread George Lubaretsi
Django permissions are only enforced in Admin interface by default. You have to enforce them in your views by using `has_perm` method of `user` instance - `user.has_perm('.')` Here's the documentation for permissions - https://docs.djangoproject.com/en/dev/topics/auth/default/#permissions-and-

model permission assignment via groups requires further config at model level?

2018-04-29 Thread rsbaxter
I'm trying to confirm if this is correct: I create a group with no permissions in it, and assign this group to a user. This user is not "staff status" nor is the user "superuser status" - they are only active. The user is not a member of any other groups - just the one with no permissions. U

Beginning Django.

2018-04-29 Thread George Lubaretsi
Changes in 2.0 that are backwards incompatible are mostly low-level things. As a beginner, you won't have to deal with them for some time. So you can grab any book that is relevant for 1.11 and you'll be fine. I would actually advise to start your training project using Django 1.11 instead of 2

Re: Django Interview Questions

2018-04-29 Thread Online Interview Questions
30+ Latest Django interview questions Q1. Is Django free? Yes, Django is free open source web framework for Python Q2. Django is based on which design pattern. Django closely follows the MVC (Model View Controller) design pat

Re-using CreateView, UpdateView & friendship

2018-04-29 Thread Mikkel Kromann
Dear Django users. I'm testing whether Django is a good choice for a web based application that I need to handle (create, read, update, delete) a lot of data tables. I've discovered the built-in Class Based View, which are going to save me from a lot of repetitive code lines - yay! Now, I've g

subhani_Django subject

2018-04-29 Thread subhani shaik
Hi friends... Can you please help me how to design web application using Django. can you suggest me. i am soo may time trying to prepare.but errors are occured.so plz give me sum example templates. Thank you subhani shaik -- You received this message because you are subscribed to the

Re: Beginning Django.

2018-04-29 Thread James Farris
This is a great online book. Although written for Django 1.11 a lot still applies. https://djangobook.com/ Sent from my mobile device > On Apr 28, 2018, at 6:39 AM, Gerardo Palazuelos Guerrero > wrote: > > Hi > A quick online tutorial? The Django girls tutorial is very good, use Django >

EDX Django

2018-04-29 Thread Sergen Ucar
Hello guys, I am using edx bitnami and I have a problem. As you know for login page, actually when I click to button of login page, I don't wanna change my main page. I wanna create modal for my login. This was created with django and I don't know how can I update it. Please if you can help me,

3 Django errors

2018-04-29 Thread Gerald Brown
I have 3 laptops set up supposedly running the same code but each one gives me a different error message. See attached file for an explanation of the problems. Each of the 3 systems are supposedly running the same code. Thanks for any thoughts, ideas, or *SOLUTIONS* for the listed problems.