Search found 9 matches

by rosario.dandrea
Tue Apr 07, 2020 10:38 am
Forum: Under the hood
Topic: Help needed when writing new app, when retrieve data from another wizard_step class
Replies: 0
Views: 1898

Help needed when writing new app, when retrieve data from another wizard_step class

Hi Rosario, I'm trying to get a selection from the previous wizard step (an id, in this case) using the URL function with the following code: @classmethod def get_form_kwargs(self, wizard): id_company_list = URL(query_string=None).args.getlist('companies') for id in id_company_list: company_id = id ...
by rosario.dandrea
Tue Feb 25, 2020 2:04 pm
Forum: Under the hood
Topic: Help needed when writing new app, when retrieve data from foreign key no len() exception occurred
Replies: 4
Views: 3487

Re: Help needed when writing new app, when retrieve data from foreign key no len() exception occurred

Hi, I solved the problem in this way: def get_companies(self, user): return AccessControlList.objects.restrict_queryset( permission=permission_companies_view, queryset=Company.objects.filter(pk=self.company.id), user=user ) I'm posting it here in case someone has my same issue. Thank you very much f...
by rosario.dandrea
Thu Feb 13, 2020 4:10 pm
Forum: Under the hood
Topic: Internal server error when allow_multiple is set to False
Replies: 2
Views: 2349

Re: Internal server error when allow_multiple is set to False

Hi Rosario,

Thanks as usual - everything is working now.

Now I just need to get this other thing working...
by rosario.dandrea
Mon Feb 10, 2020 9:38 am
Forum: Under the hood
Topic: Internal server error when allow_multiple is set to False
Replies: 2
Views: 2349

Internal server error when allow_multiple is set to False

Hi, I'm trying to add a new step in the "upload new document" wizard. I get the following exception: wizard_step.py", line 121, in done force_text(order.pk) for order in cleaned_data['orders'] TypeError: 'Order' object is not iterable The code for wizard_step is the following: @classm...
by rosario.dandrea
Fri Feb 07, 2020 11:22 am
Forum: Under the hood
Topic: Help needed when writing new app, when retrieve data from foreign key no len() exception occurred
Replies: 4
Views: 3487

Re: Help needed when writing new app, when retrieve data from foreign key no len() exception occurred

Hi, i already did it, but the following exception occurred: in get_company_queryset get_companies permission=permission_companies_view, queryset=self.company.all(), AttributeError: 'NoneType' object has no attribute 'all'. company field is: company = models.ForeignKey(Company, blank=True, null=True,...
by rosario.dandrea
Mon Feb 03, 2020 4:58 pm
Forum: Under the hood
Topic: Help needed when writing new app, when retrieve data from foreign key no len() exception occurred
Replies: 4
Views: 3487

Help needed when writing new app, when retrieve data from foreign key no len() exception occurred

Hi everyone, I'm having the following issue happen in the app I'm writing. I'm looking at the tag app to understand what I'm doing wrong, but everything seems to be okay. I get the following error: Error retrieving X list: object of type 'X' has no len(). View: def get_company_queryset(self): return...
by rosario.dandrea
Fri Jan 31, 2020 9:43 am
Forum: Under the hood
Topic: Help needed when writing new app, DecimalField shows up as editable in SingleObjectDetailView
Replies: 5
Views: 3431

Help needed when writing new app, DecimalField shows up as editable in SingleObjectDetailView

Hi, I'm currently trying to write a new app and I'm having the following issue: When specifying a new field using DecimalField in models, and displaying it with SingleObjectDetailView in views, the field appears as editable - I have tried with the "Editable=False" option in models, but the...