Queryset in settings.py?

2022-01-28 Thread sebasti...@gmail.com
Hello,

i want to import from a app models.py like this:

from app1.models import classname

then i get:

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

I want to get a queryset from app1.models.classname in settings.py. How is 
this possible?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/18ef496c-c9a1-40df-b251-7ce2cc2dad82n%40googlegroups.com.


Multiple Choices as Label

2022-02-02 Thread sebasti...@gmail.com
Hello,

I want in Listview on left side a filterform, where i can filter after 
sizes and/or colors. This are Multiple Choices Fields. I have attached a 
image where this fields are shown. For example XS has Key 1 and XL Key 2 
and Color Black have Key 1 then i want when user clicks on size XS,XL and 
Color Black that Post submit size=[1,2] and color=[1]

How is this possible?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4210761f-f5e1-4d72-b683-d3f5d5108f48n%40googlegroups.com.


Re:

2022-02-02 Thread sebasti...@gmail.com
You insert following in your base template:


 {% if messages %}



{% for message in messages %}
{{ message|safe }}

{% endfor %}
{% endif %}
{% if form.errors %}


{% for key, value in form.errors.items %}

{{ key }}:{{ value }}

{% endfor %}








{% endif %}


gautam...@gmail.com schrieb am Mittwoch, 2. Februar 2022 um 17:12:16 UTC+1:

> How to use fee due notifications in django something helpe
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a61fb3f8-ce19-4a6d-b522-a84eac16862dn%40googlegroups.com.


Django Oscar mobile device QR Code scan

2022-10-27 Thread sebasti...@gmail.com
Hello,

on a PC is Django Oscar in a Browser open with catalogue listview. Now i 
want to implement that i have on a mobile android device i have a QR Code 
Scanner how can send code to PC and in this QR Code is a article number and 
on PC this article number is automatical enter as keystrokes and then 
django oscar automatical recognize this article number and open detail view 
of this article.

Have anyone a idea how i can insert a javascript code that waiting for 
keystrokes? Have anyone experience with Android QR Code Scanner how sends 
content of QR Code as keystrokes to a pc and process it?

Have another developer interest to help me to implement this in django 
oscar?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b776dd7e-2e43-40a5-be27-36abd68cba15n%40googlegroups.com.


Multitenant App

2022-11-07 Thread sebasti...@gmail.com
Hello,

ich want sell my app on different companys. Now a part of apps all 
companys/templates use this but another apps/templates are customer 
specific. Now i want when i update code from apps/templates which all 
customer uses that i can update all customer on server as fast as possible.

Here are a example:

Customer 1
common app
customer invividual app #1

template
common app templates
customer individual app templates
Customer 2
common app
customer individual app #2

template
common app templates
customer individual app templates

How i can make this? Softlink or is there another better possibility?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/987d7c53-cd73-4937-9a5d-b9053a6570c4n%40googlegroups.com.


Complex Query

2022-11-20 Thread sebasti...@gmail.com
Hello Guys,

you find my question in attachment because tabs in tables are not shown 
when i send it in gmail.

Please help me on my question who make i a complex query.

Thanks in advance

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/935740cb-8289-4341-80c4-407b0100e3adn%40googlegroups.com.


Question
Description: Binary data


Django Left Outer Join

2023-04-25 Thread sebasti...@gmail.com
Hello Friends,

i have in models.py following:

class Money(Standard_Model_Mixin):
title = models.CharField(default="", max_length=120, blank=True, 
null=True)
amount = models.DecimalField(max_digits=6, decimal_places=2, 
blank=False, null=False) 

class Moneyreport(Standard_Model_Mixin,Mayan_DMS_Mixin):
date = models.DateField (default=now, blank=False, null=False)


class Moneyreport_Line(Standard_Model_Mixin):
moneyreport_link = models.ForeignKey(Moneyreport,default='', 
blank=False, null=False, on_delete=models.CASCADE, 
related_name="moneyreport_link")
money_link = models.ForeignKey(Money, 
on_delete=models.CASCADE,default='', blank=False, null=False, 
related_name="money_link")
quantity = models.PositiveIntegerField(default=0, blank=False, 
null=False)

Now i have in Money a entry like:

(id,title,amount) Values ((1,"50 $","50"),(2,"100 $","100"))

in Moneyreport:

(id,date) VALUES (1,'25.04.2023')

and Moneyreport_Line:

('moneyreport_link','money_link','quantity') VALUES ((1,1,3))

Now i want i left outer join so i get a table like:

|money_link.title|quantity|
|50 $|   |
|100 $  |3|

In SQL i would make a left join like:

SELECT Money.title,ml.quantity FROM Moneyreport_Line as ml LEFT OUTER JOIN 
Money ON Money.id = ml.money_link

How i make this in django without raw query?

Regards   


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/78dc9c7a-5acc-413b-8e12-3965ce9659ban%40googlegroups.com.


Postgres Fulltext Search IContains not work

2023-05-15 Thread sebasti...@gmail.com
I have in my Postgres Database a product with following tupple:

(description_de='Elegante Bluse',title_de='Elegante 
Bluse,slug='elegante-bluse')

Not i have a field for a fulltextsearch over this table. I try to filtering 
by:


When i now search after "Elegante" it works perfect but when i search after 
"bluse" no result.

Here are query with searchtext "Bluse":

SELECT description_de,title_de,slug, to_tsvector(german::regconfig, 
COALESCE("catalogue_product"."title_de", ) || ' ' || 
COALESCE("catalogue_product"."description_de", ) || ' ' || 
COALESCE("catalogue_product"."slug", )) AS "search" FROM 
"catalogue_product" WHERE UPPER(to_tsvector(german::regconfig, 
COALESCE("catalogue_product"."title_de", ) || ' ' || 
COALESCE("catalogue_product"."description_de", ) || ' ' || 
COALESCE("catalogue_product"."slug", ))::text) LIKE UPPER(%Bluse%) ORDER BY 
"catalogue_product"."date_created" DESC

I have no idea whats happen here. Have someone a idea?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8d8f5f14-3585-41a4-bb56-88b1c8305631n%40googlegroups.com.


Migration don't work

2023-05-17 Thread sebasti...@gmail.com
I get on migration following error:
Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 
419, in execute_from_command_line
utility.execute()
  File 
"/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 
413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", 
line 354, in run_from_argv
self.execute(*args, **cmd_options)
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", 
line 398, in execute
output = self.handle(*args, **options)
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", 
line 89, in wrapped
res = handle_func(*args, **kwargs)
  File 
"/usr/lib/python3.8/site-packages/django/core/management/commands/migrate.py", 
line 92, in handle
executor = MigrationExecutor(connection, 
self.migration_progress_callback)
  File "/usr/lib/python3.8/site-packages/django/db/migrations/executor.py", 
line 18, in __init__
self.loader = MigrationLoader(self.connection)
  File "/usr/lib/python3.8/site-packages/django/db/migrations/loader.py", 
line 53, in __init__
self.build_graph()
  File "/usr/lib/python3.8/site-packages/django/db/migrations/loader.py", 
line 259, in build_graph
self.graph.validate_consistency()
  File "/usr/lib/python3.8/site-packages/django/db/migrations/graph.py", 
line 195, in validate_consistency
[n.raise_error() for n in self.node_map.values() if isinstance(n, 
DummyNode)]
  File "/usr/lib/python3.8/site-packages/django/db/migrations/graph.py", 
line 195, in 
[n.raise_error() for n in self.node_map.values() if isinstance(n, 
DummyNode)]
  File "/usr/lib/python3.8/site-packages/django/db/migrations/graph.py", 
line 58, in raise_error
raise NodeNotFoundError(self.error_message, self.key, 
origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration 
communication.0002_reset_table_names dependencies reference nonexistent 
parent node ('order', '0008_auto_20190301_1035')


Now i grep after grep -r "0002_reset_table_names" . and nothing are find in 
my project dir or in venv. I look in django_migrations table and there 
aren't such a entity. I have feeling that is cached entry because in 
history i have such a venv with this file but i delete complete venv and 
load right venv where this file don't exists

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/38278863-2272-49ab-9b5f-38ea15a18d0fn%40googlegroups.com.


Django Translation won't work

2023-05-21 Thread sebasti...@gmail.com
I use django translation. Normal works perfect but now i have a problem. 
All verbose name are in english in django code. I setting.py i have as 
second language DE configure. Then i have in models.py:

condition_link = models.ForeignKey(related, null=True, blank=True, 
default=None, on_delete=models.CASCADE,verbose_name=_('Condition'),
   related_name="condition_link")

in django.po in DE Language i don't find anything with 

msgid "Condition"

in form.py i have:

evalfield = self.Meta.model._meta.get_field('condition_link')
self.fields['condition_link'] = 
forms.MultipleChoiceField(choices=evalfield.choices,
widget=SelectMultiple(),
label=evalfield.verbose_name)

and i get in evalfield.verbose_name a translation which are don't exists in 
django.po file. I also delete django.mo file and make django-admin 
compilemessages --locale DE so .mo file is new created.

Same thing.

Then next problem on django translation i have a translation:

#: catalogue/models.py:81
msgid "Gender"
msgstr "Geschlecht"

in frontend msgstr Geschlecht are shown both in english and in german 
language...

99% other translation works right...

Have anyone a idea what it could be? This is absolut strange

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/09d0d1cb-875c-45ce-a9d8-716d7fe08175n%40googlegroups.com.


Own documentation in django

2023-07-14 Thread sebasti...@gmail.com
Hello,

i use regular markdown and asciidoc. Problem is that both have to less 
feature. For example i want to reuse html templates with different content.

In asciidoc i can do this following:

i declare variables

:varibale1: Teststring
:variable2: Second String

include::buttontemplate.adoc[]

This is not good in reading such source code. Second thing include i can't 
use inline only in new line and i have problems to make include in tables. 

Asciidoc have no multilanguage suppport. And further more problems

So i think for very small documumentation asciidoc is wunderfull but for 
greater docus with several levels in TOC and multilanguage this tool is to 
unflexible. Does anyone knows a package in django where i have a syntax 
like asciidoc/markdown but the felxibility like in django where a can use 
jinja2 and can use templating and multilanguage works?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a2c07298-a2e7-4a8f-ab2e-79367a2b5dcdn%40googlegroups.com.


django-filters many to many

2021-02-14 Thread sebasti...@gmail.com
Hello,

i have installed per pip django-filters. 

Models.py:

class Productinterests(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=255, default="", blank=False, null=
False)

class Address(models.Model):
   productinterests = models.ManyToManyField(Productinterests,blank=True, 
default=0)
   lastname = models.CharField(max_length=255, default="", )
   firstname = models.CharField(max_length=255, default="", blank=True, null
=True)

filters.py:
   class AddressFilter(django_filters.FilterSet):
lastname = django_filters.CharFilter(lookup_expr='icontains',label=
"Nachname")
firstname = django_filters.CharFilter(lookup_expr='icontains', label=
"Vorname")

productinterests = django_filters.ModelMultipleChoiceFilter(
to_field_name='name',queryset=Productinterests.objects.all(),
widget=forms.CheckboxSelectMultiple, label="Produktinteresse")

class Meta:
   model = Address
   fields = ['lastname','firstname','productinterests' ]

views.py:
   def search(request):
 liste = Address.objects.all()

 address = AddressFilter(request.GET, queryset=liste)
return render(request, 'search/address_list.html', {'filter': user_filter})


*Problem: Website shows in Multiselect Productinterest only as Output:*
* "Productinterests object (1)" instead of name from object. How can i 
output name?*

Regards  

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/636ab5c4-d24e-42ab-bec2-be2eab833bdbn%40googlegroups.com.


Multiselect List with Collapse Widget

2021-02-19 Thread sebasti...@gmail.com
Hello,

i need a new model with parent child nested relations. The final aim was 
this:

https://www.freakyjolly.com/wp-content/uploads/2020/10/Pasted-into-Angular-109-Tree-View-List-with-Expand-Collapse-and-Checkboxes-using-ngx-treeview.png

i want a mulltiselect field with subcategories. Also in widget when childs 
then parents are collapse. I want a new modelclass and when i insert this 
in model then in template the widget ist present. Please make me a offer to 
implement it.

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9a8f6c5a-a66f-4c89-8fc0-f1ac29ee2562n%40googlegroups.com.


Class Base View Foreign key

2021-02-27 Thread sebasti...@gmail.com
Hello,

I have a CBV with Createview. Now i have a Foreign Key from Box to Tabs 
model. When i submit request then i get error:* Cannot assign "1": 
"Box.tabs_link" must be a "Tabs" instance*. This happens on form.is_valid

I understand this error but i don't know how can i fix this. 

*Models.py*:
class Box(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=200, default="", blank=False, 
null=False) #Überschrift der Box
tabs_link = models.ForeignKey(Tabs, on_delete=models.CASCADE, 
null=False,blank=False,choices=[
(c.id, c.name) for c in Tabs.objects.all()]
   )

column = 
models.PositiveIntegerField(choices=column_choices,blank=False, 
null=False,default=0) #linke oder rechte Seite
position = models.PositiveIntegerField(default=1,blank=False, 
null=False) #position auf der linken/rechten Seite
modul = models.PositiveIntegerField(choices=Modul_Auswahl,
default=0)  

class Meta:
ordering = ["position","column"]
def __str__(self):
return self.name

*Views.py:*
class BoxCreateView(CreateView):
model = Box
template_name = 'marketing/boxcreate.html'
form_class = Boxform
success_url = reverse_lazy('boxlist')

def post(self, request, *args, **kwargs):
formbox = Boxform(self.request.POST)
if (*formbox.is_valid()*):
   pass

*Forms.py*
class Boxform(forms.ModelForm):
class Meta:
model = Box
exclude = ('',)

labels = {
'tabs_link': 'Tabulator',
'column': 'Spalte',
}
widgets = {
'name': textinputfeld,
'position': integerfeld,
'column': integerfeld,
'modul': selectfield,
'tabs_link': selectfield,
}

Regards


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/67b99b82-bc79-4cc5-9f8f-a17731e3ed0fn%40googlegroups.com.


Re: Class Base View Foreign key

2021-02-27 Thread sebasti...@gmail.com
Hey,

thanks for you response. Before i save i want to make is_valid() and there 
came this exception.

Regards

wilkycon...@gmail.com schrieb am Samstag, 27. Februar 2021 um 16:36:35 
UTC+1:

> I had similar issues, I found this helpful:
>
> https://groups.google.com/g/django-users/c/PcSDKZhPVmc
>
>
>
> On Sat, Feb 27, 2021 at 9:19 AM Ryan Nowakowski  
> wrote:
>
>> I think choices is causing the problem. Try limit_choices_to instead:
>>
>>
>> https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.limit_choices_to
>>
>> On February 27, 2021 8:06:26 AM CST, "sebasti...@gmail.com" <
>> sebasti...@gmail.com> wrote:
>>>
>>> Hello,
>>>
>>> I have a CBV with Createview. Now i have a Foreign Key from Box to Tabs 
>>> model. When i submit request then i get error:* Cannot assign "1": 
>>> "Box.tabs_link" must be a "Tabs" instance*. This happens on 
>>> form.is_valid
>>>
>>> I understand this error but i don't know how can i fix this. 
>>>
>>> *Models.py*:
>>> class Box(models.Model):
>>> id = models.AutoField(primary_key=True)
>>> name = models.CharField(max_length=200, default="", blank=False, 
>>> null=False) #Überschrift der Box
>>> tabs_link = models.ForeignKey(Tabs, on_delete=models.CASCADE, 
>>> null=False,blank=False,choices=[
>>> (c.id, c.name) for c in 
>>> Tabs.objects.all()]
>>>)
>>>
>>> column = 
>>> models.PositiveIntegerField(choices=column_choices,blank=False, 
>>> null=False,default=0) #linke oder rechte Seite
>>> position = models.PositiveIntegerField(default=1,blank=False, 
>>> null=False) #position auf der linken/rechten Seite
>>> modul = models.PositiveIntegerField(choices=Modul_Auswahl,
>>> default=0)  
>>>
>>> class Meta:
>>> ordering = ["position","column"]
>>> def __str__(self):
>>> return self.name
>>>
>>> *Views.py:*
>>> class BoxCreateView(CreateView):
>>> model = Box
>>> template_name = 'marketing/boxcreate.html'
>>> form_class = Boxform
>>> success_url = reverse_lazy('boxlist')
>>>
>>> def post(self, request, *args, **kwargs):
>>> formbox = Boxform(self.request.POST)
>>> if (*formbox.is_valid()*):
>>>pass
>>>
>>> *Forms.py*
>>> class Boxform(forms.ModelForm):
>>> class Meta:
>>> model = Box
>>> exclude = ('',)
>>>
>>> labels = {
>>> 'tabs_link': 'Tabulator',
>>> 'column': 'Spalte',
>>> }
>>> widgets = {
>>> 'name': textinputfeld,
>>> 'position': integerfeld,
>>> 'column': integerfeld,
>>> 'modul': selectfield,
>>> 'tabs_link': selectfield,
>>> }
>>>
>>> Regards
>>>
>>>
>>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/C48208D2-7C9F-4F99-B664-20269F331FD2%40fattuba.com
>>  
>> <https://groups.google.com/d/msgid/django-users/C48208D2-7C9F-4F99-B664-20269F331FD2%40fattuba.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3a53be95-069b-434c-bdfa-b71c0d5fd9c5n%40googlegroups.com.


Smaller project that would be payed

2021-03-05 Thread sebasti...@gmail.com
Hello,

 i need a freelancer that implement me a new widget bzw. modelclass that 
can represent a select with hierarichal structure like this:

http://embed.plnkr.co/BRQtUKbxZdZItLslHflM/

i know that a implementation like django-mptt can store this in database. I 
am beginner so i want in my existing model: 

class adress(model.Model):
  name = model.CharField()

insert a new field with a new model class and then django render in 
template a new widget like: http://embed.plnkr.co/BRQtUKbxZdZItLslHflM/ and 
when i save it also the tree ist stored. When i open update view then the 
widget is filled.

Please make me an offer to give me this implementation inkl. new widget.

Thanks


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1e75a653-a24f-46c2-bb89-38f9bcb2aef2n%40googlegroups.com.


load standard user settings per view

2021-03-19 Thread sebasti...@gmail.com
Hello,

i have a addresslistview that also take parameter like pagingsize and 
ordering over url. For example 
https://localhost:8000/addresslist?pagingsize=25&ordering=Id

Now when a user get a request like 
https://localhost:8000/addresslist?pagingsize=25&ordering=Id then parameter 
?pagingsize=25&ordering=Id is stored in a user settings cache and when next 
time user call https://localhost:8000/addresslist without parameter then 
the settings from cache is set.

How can i make this without many querys on database...

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8c917ea9-ff34-403f-8697-ff3fa81316b0n%40googlegroups.com.


'WSGIRequest' object has no attribute

2021-04-01 Thread sebasti...@gmail.com
Hello,

model.py:

class UserSettings(models.Model):
user_link = models.OneToOneField(
User,
on_delete=models.CASCADE,
related_name="usersettings_address",primary_key=True,)

and i have a mixin:

class ListviewMixin():

def get_queryset(self):
print("Order "+str(self.request.usersettings_address.list_orderby))

now i get a exception:

AttributeError at /
'WSGIRequest' object has no attribute 'usersettings_address'
Request Method: GET
Request URL: http://127.0.0.1:8001/
Django Version: 3.1.7
Exception Type: AttributeError
Exception Value: 
'WSGIRequest' object has no attribute 'usersettings_address'
Exception Location: 
/home/sebastian/PycharmProjects/verwaltung/emailmarketing/Mixins.py, 
line 15, in get_queryset
Python Executable: /usr/bin/python3
Python Version: 3.8.5
Python Path: 
['/home/sebastian/PycharmProjects/verwaltung',
 '/usr/lib/python38.zip',
 '/usr/lib/python3.8',
 '/usr/lib/python3.8/lib-dynload',
 '/home/sebastian/.local/lib/python3.8/site-packages',
 '/home/sebastian/PycharmProjects/helpdesk/django-helpdesk',
 '/home/sebastian/PycharmProjects/helpdesk/django-helpdesk/demo',
 '/usr/local/lib/python3.8/dist-packages',
 '/usr/lib/python3/dist-packages',
 '/usr/lib/python3.8/dist-packages']
Server time: Thu, 01 Apr 2021 15:55:29 +
Traceback Switch to copy-and-paste view
/home/sebastian/.local/lib/python3.8/site-packages/django/core/handlers/exception.py,
 
line 47, in inner
response = get_response(request) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/core/handlers/base.py,
 
line 181, in _get_response
response = wrapped_callback(request, *callback_args, 
**callback_kwargs) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/views/generic/base.py,
 
line 70, in view
return self.dispatch(request, *args, **kwargs) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/utils/decorators.py, 
line 43, in _wrapper
return bound_method(*args, **kwargs) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/contrib/auth/decorators.py,
 
line 21, in _wrapped_view
return view_func(request, *args, **kwargs) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/views/generic/base.py,
 
line 98, in dispatch
return handler(request, *args, **kwargs) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
line 78, in get
self.filterset = self.get_filterset(filterset_class) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
line 44, in get_filterset
kwargs = self.get_filterset_kwargs(filterset_class) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
line 57, in get_filterset_kwargs
'queryset': self.get_queryset(), …
▶ Local vars
/home/sebastian/PycharmProjects/verwaltung/emailmarketing/Mixins.py, line 
15, in get_queryset
print("Order "+str(self.request.usersettings_address.list_orderby)) 
…
▶ Local vars
Request information
USER
root

GET
No GET data

POST
No POST data

FILES
No FILES data

COOKIES
Variable Value
csrftoken 
'15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIMWWnf7p5tHdkRkYvOKKtM8c6jwGrA'
sessionid 
'm4julix8y4zyczcuq2tlnf6zzwjlkluc'
META
Variable Value
CINNAMON_VERSION 
'4.8.6'
COLORTERM 
'truecolor'
CONTENT_LENGTH 
''
CONTENT_TYPE 
'text/plain'
CSRF_COOKIE 
'15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIMWWnf7p5tHdkRkYvOKKtM8c6jwGrA'
DBUS_SESSION_BUS_ADDRESS 
'unix:path=/run/user/1000/bus'
DESKTOP_SESSION 
'cinnamon'
DISPLAY 
':0'
DJANGO_SETTINGS_MODULE 
'emailmarketing.settings'
GATEWAY_INTERFACE 
'CGI/1.1'
GDMSESSION 
'cinnamon'
GDM_LANG 
'de_DE'
GJS_DEBUG_OUTPUT 
'stderr'
GJS_DEBUG_TOPICS 
'JS ERROR;JS LOG'
GNOME_DESKTOP_SESSION_ID 
'this-is-deprecated'
GNOME_TERMINAL_SCREEN 
'/org/gnome/Terminal/screen/0493dca5_c60d_4d79_a657_8d6130e31a36'
GNOME_TERMINAL_SERVICE 
':1.74'
GPG_AGENT_INFO 
'/run/user/1000/gnupg/S.gpg-agent:0:1'
GTK3_MODULES 
'xapp-gtk3-module'
GTK_MODULES 
'gail:atk-bridge'
GTK_OVERLAY_SCROLLING 
'1'
HOME 
'/home/sebastian'
HTTP_ACCEPT 
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
HTTP_ACCEPT_ENCODING 
'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE 
'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7'
HTTP_CACHE_CONTROL 
'max-age=0'
HTTP_CONNECTION 
'keep-alive'
HTTP_COOKIE 
('csrftoken=15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIMWWnf7p5tHdkRkYvOKKtM8c6jwGrA; 
'
 'sessionid=m4julix8y4zyczcuq2tlnf6zzwjlkluc')
HTTP_HOST 
'127.0.0.1:8001'
HTTP_SEC_FETCH_DEST 
'document'
HTTP_SEC_FETCH_MODE 
'navigate'
HTTP_SEC_FETCH_SITE 
'none'
HTTP_SEC_FETCH_USER 
'?1'
HTTP_UPGRADE_INSECURE_REQUESTS 
'1'
HTTP_USER_AGENT 
('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) '
 'Chrome/89.0.4389.82 Safari/537.36')
LANG 
'de_DE.UTF-8'
LANGUAGE 
'de_DE'
LESSCLOSE 
'/

Re: 'WSGIRequest' object has no attribute

2021-04-01 Thread sebasti...@gmail.com
I have found my failure. Thanks

sebasti...@gmail.com schrieb am Donnerstag, 1. April 2021 um 18:00:57 UTC+2:

> Hello,
>
> model.py:
>
> class UserSettings(models.Model):
> user_link = models.OneToOneField(
> User,
> on_delete=models.CASCADE,
> related_name="usersettings_address",primary_key=True,)
>
> and i have a mixin:
>
> class ListviewMixin():
>
> def get_queryset(self):
> print("Order "+str(self.request.usersettings_address.list_orderby))
>
> now i get a exception:
>
> AttributeError at /
> 'WSGIRequest' object has no attribute 'usersettings_address'
> Request Method: GET
> Request URL: http://127.0.0.1:8001/
> Django Version: 3.1.7
> Exception Type: AttributeError
> Exception Value: 
> 'WSGIRequest' object has no attribute 'usersettings_address'
> Exception Location: 
> /home/sebastian/PycharmProjects/verwaltung/emailmarketing/Mixins.py, 
> line 15, in get_queryset
> Python Executable: /usr/bin/python3
> Python Version: 3.8.5
> Python Path: 
> ['/home/sebastian/PycharmProjects/verwaltung',
>  '/usr/lib/python38.zip',
>  '/usr/lib/python3.8',
>  '/usr/lib/python3.8/lib-dynload',
>  '/home/sebastian/.local/lib/python3.8/site-packages',
>  '/home/sebastian/PycharmProjects/helpdesk/django-helpdesk',
>  '/home/sebastian/PycharmProjects/helpdesk/django-helpdesk/demo',
>  '/usr/local/lib/python3.8/dist-packages',
>  '/usr/lib/python3/dist-packages',
>  '/usr/lib/python3.8/dist-packages']
> Server time: Thu, 01 Apr 2021 15:55:29 +
> Traceback Switch to copy-and-paste view
> /home/sebastian/.local/lib/python3.8/site-packages/django/core/handlers/exception.py,
>  
> line 47, in inner
> response = get_response(request) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django/core/handlers/base.py,
>  
> line 181, in _get_response
> response = wrapped_callback(request, *callback_args, 
> **callback_kwargs) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django/views/generic/base.py,
>  
> line 70, in view
> return self.dispatch(request, *args, **kwargs) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django/utils/decorators.py,
>  
> line 43, in _wrapper
> return bound_method(*args, **kwargs) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django/contrib/auth/decorators.py,
>  
> line 21, in _wrapped_view
> return view_func(request, *args, **kwargs) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django/views/generic/base.py,
>  
> line 98, in dispatch
> return handler(request, *args, **kwargs) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
> line 78, in get
> self.filterset = self.get_filterset(filterset_class) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
> line 44, in get_filterset
> kwargs = self.get_filterset_kwargs(filterset_class) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
> line 57, in get_filterset_kwargs
> 'queryset': self.get_queryset(), …
> ▶ Local vars
> /home/sebastian/PycharmProjects/verwaltung/emailmarketing/Mixins.py, line 
> 15, in get_queryset
> print("Order 
> "+str(self.request.usersettings_address.list_orderby)) …
> ▶ Local vars
> Request information
> USER
> root
>
> GET
> No GET data
>
> POST
> No POST data
>
> FILES
> No FILES data
>
> COOKIES
> Variable Value
> csrftoken 
> '15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIMWWnf7p5tHdkRkYvOKKtM8c6jwGrA'
> sessionid 
> 'm4julix8y4zyczcuq2tlnf6zzwjlkluc'
> META
> Variable Value
> CINNAMON_VERSION 
> '4.8.6'
> COLORTERM 
> 'truecolor'
> CONTENT_LENGTH 
> ''
> CONTENT_TYPE 
> 'text/plain'
> CSRF_COOKIE 
> '15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIMWWnf7p5tHdkRkYvOKKtM8c6jwGrA'
> DBUS_SESSION_BUS_ADDRESS 
> 'unix:path=/run/user/1000/bus'
> DESKTOP_SESSION 
> 'cinnamon'
> DISPLAY 
> ':0'
> DJANGO_SETTINGS_MODULE 
> 'emailmarketing.settings'
> GATEWAY_INTERFACE 
> 'CGI/1.1'
> GDMSESSION 
> 'cinnamon'
> GDM_LANG 
> 'de_DE'
> GJS_DEBUG_OUTPUT 
> 'stderr'
> GJS_DEBUG_TOPICS 
&g

Re: AttributeError: 'customer' object has no attribute 'is_authenticated'

2021-04-01 Thread sebasti...@gmail.com
I think this must be wrong. Only User instance have a method 
is_authenticated. Here a example for views:

if request.user.is_authenticated:
   pass

sali...@rohteksolutions.com schrieb am Donnerstag, 1. April 2021 um 
19:03:36 UTC+2:

> Hi all,
>
> How to solve this errors
> ```
> AttributeError: 'customer' object has no attribute 'is_authenticated'
> ```
>
> ```
>   AttributeError: 'customer' object has no attribute 'is_anonymous'  
> ```
>
> How can I solve this above errors. Help me.
>
> Thanks
> ~Salima
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3e9ee7e0-0616-4150-a778-75e9660b5fb1n%40googlegroups.com.


Listview Iterate over List

2021-04-07 Thread sebasti...@gmail.com
Hello,

i want to create a Listview like this:

class HistorieListView(ListView):
model = Address
template_name = 'marketing/liststandardtemplate.html'
fieldlist = ('id', 'lastname', 'firstname')

now i want in liststandardtemplate.html that i iterate in tablebody over 
fieldlist:


{%for element in object_list%}

   {% for field in fieldlist %}

{{ element.field }}

   {% endfor %}

{% endfor %}


but   {{ element.field }} won't work. This is absolut clear why but i have 
no idea how i can create such a template

I want a flexible Listview Template that i can use with every model and can 
set in fieldlist which columns are shown in listview. When field ist a 
foreignkey field then __str__ from related model is shown...

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/57cdad08-09d3-41c3-ae3a-32fff0ae6678n%40googlegroups.com.


Dashboard Drag and Drop with individual filtering

2021-04-10 Thread sebasti...@gmail.com
Hello,

i want a dashboard view. At beginning there are view standard widget but 
user can self insert new widgets for example a listwidget. Then user can 
change position per drag and drop. When user change position then position 
are stored in database per ajax. And next get request on dashboard this 
setting is also loaded. Also i want that user can make settings like when a 
listview is created then a small settings icon in widget is shown and user 
make settings like which model ist shown and also filtering like createdate 
last 14 days.

Have anyone a idea how can i create such dashbaord or  is there are a ready 
app?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1378ea3a-ea36-4d30-b19b-5a20684d8f41n%40googlegroups.com.


getattr on related not possible?

2021-04-15 Thread sebasti...@gmail.com
Hello,

i have following:

models.py:

from django.db import models

class Tabs(models.Model):
id = models.AutoField(primary_key=True)
def __str__(self):
return self.name

class Box(models.Model):
id = models.AutoField(primary_key=True)
tabslink = models.ForeignKey(Tabs, on_delete=models.CASCADE, 
null=False,blank=False)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
print([field.name for field in self._meta.get_fields()])
for field in [field.name for field in self._meta.get_fields()]:
getattr(self, field)

views.py:

from django.views.generic.edit import (
CreateView,

)
from django.urls import reverse, reverse_lazy
from django import forms

class Boxform(forms.ModelForm):
class Meta:
model = Box
fields = ['tabslink']

class test(CreateView):
model = Box
template_name = 'test.html'
form_class = Boxform
success_url = reverse_lazy('Boxlistview')

Now i get a Exception:

Exception Value: Box has no tabslink.

/home/sebastian/PycharmProjects/test3/test4/models.py, line 22, in __init__
getattr(self, field) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py,
 
line 197, in __get__
raise self.RelatedObjectDoesNotExist( …
▶ Local vars


This happens only on fields that have a  models.ForeignKey entry...

Please help me that i can also get related with getattr.

Regards


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b672baf2-4e87-49a2-ac17-ba6daff0cb9bn%40googlegroups.com.


Mixin add field to fields in forms

2021-04-18 Thread sebasti...@gmail.com
Hello,


*forms.py:*

class Newsletterform(StandardMixin):
class Meta:
model = Newsletter
fields = ['newslettername', 'from_link', 'to_list', 
'email_subject', 'text_message', 'html_message' ]

*Mixins.py:*
class StandardMixin(forms.ModelForm):
class Meta:
abstract = True

def __init__(self, *args, **kwargs):

self.Meta.fields.append('owner')
super(StandardMixin, self).__init__(*args, **kwargs)


*i would append in Meta.Fields owner and after this super. But in Template 
this field are not shown. *

*Why?*

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bb10dfa0-ed1e-459c-8e06-46af264a3b7en%40googlegroups.com.


Re: Mixin add field to fields in forms

2021-04-18 Thread sebasti...@gmail.com
Hello,

Thanks for your fast response. But i don't know how i can 
use  self.declared_fields and why this would help me...

Regards

shahee...@gmail.com schrieb am Sonntag, 18. April 2021 um 15:14:03 UTC+2:

> Try updating self.declared_fields instead. 
>
> On Sun, 18 Apr 2021, 13:47 sebasti...@gmail.com,  
> wrote:
>
>> Hello,
>>
>>
>> *forms.py:*
>>
>> class Newsletterform(StandardMixin):
>> class Meta:
>> model = Newsletter
>> fields = ['newslettername', 'from_link', 'to_list', 
>> 'email_subject', 'text_message', 'html_message' ]
>>
>> *Mixins.py:*
>> class StandardMixin(forms.ModelForm):
>> class Meta:
>> abstract = True
>>
>> def __init__(self, *args, **kwargs):
>>
>> self.Meta.fields.append('owner')
>> super(StandardMixin, self).__init__(*args, **kwargs)
>>
>>
>> *i would append in Meta.Fields owner and after this super. But in 
>> Template this field are not shown. *
>>
>> *Why?*
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/bb10dfa0-ed1e-459c-8e06-46af264a3b7en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/bb10dfa0-ed1e-459c-8e06-46af264a3b7en%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f16d610f-acce-4eef-8940-8a80ff1d36a3n%40googlegroups.com.


Re: module not found

2021-04-28 Thread sebasti...@gmail.com
Install pip3:

sudo apt install python3-pip

then install django:

pip3 install django

rabi...@gmail.com schrieb am Mittwoch, 28. April 2021 um 09:12:41 UTC+2:

> Go to settings from your pc and add python to your variable path.
>
> On Tue, 27 Apr 2021, 23:10 Sebastian Jung,  wrote:
>
>> Hello,
>>
>> You Install Django package with pip Install but you need with python3 
>> pip3 instead of pip.
>>
>> Regards
>>
>> Théodore KOSSI  schrieb am Mo., 26. Apr. 2021, 
>> 13:40:
>>
>>> can you help me for this problem?
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAKiMjQG3F-qktrhRd3mF-ucK2fn8ph55r_sKD8ue5HakuWc%3DRQ%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> 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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAKGT9myD4dVKoPh-MgyTGfLfz9DMU_mSdGBq%2BVNOVpS%3DKGkztg%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a33cb17f-23aa-43fa-9319-6a40085708fen%40googlegroups.com.


Django Select Filter Widget

2021-05-18 Thread sebasti...@gmail.com
Hi, i need i new widget for Select fields. 

 I have in my models 2 classes: 

class address(models.Model): 
   lastname = models.CharField(max_length=255, default="", ) 
   firstname = models.CharField(max_length=255, default="", blank=True, 
null=True) 

and a second   class: 

class emailaddress(models.Model): 
   address_link = models.ForeignKey(Address, on_delete=models.CASCADE, 
blank=False,  null=False, default=None,) Now i want define 

in my forms.py: 
  class Emailsform(forms.ModelForm): 
 class Meta: 
 model = emailaddress fields = ["address_link"] 
 widgets = {'address_link':multiselectfilterview()} 

Now in frontend i want a normal multiselect field. When user click on this 
input field then a modal open with a Adress view. This Adress view should 
get all adresses with ajax. In this Adress View Paging and Filtering must 
be possible. In this modal in left column checkboxes are shown and user can 
select multiple adresses with this checkbox. In Modal View there must be a 
submit button and when user click on submit all adresses which is checked 
is submit to original multiselect field. This widget must be modular so i 
can use it for another foreingkey relations. 

Have anyone a idea how i can implement such a widget or have already done 
this?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9debba1c-e5ea-44be-90a4-32c7e71228adn%40googlegroups.com.


Re: Help me

2021-05-21 Thread sebasti...@gmail.com
Here are a tutorial for django with explanations how you can use forms in 
django

https://tutorial.djangogirls.org/en/django_forms/

gabriels...@gmail.com schrieb am Freitag, 21. Mai 2021 um 12:32:51 UTC+2:

> From django import forms 
> Class Feedback(forms.form):
>  name = forms.CharField(widget=forms.TextInput)
>
> Just like that and you import it into your views
> If you want more information you can read the django documentation too 
>
> On Fri, 21 May 2021 at 09:44 Théodore KOSSI  wrote:
>
>> okay I understand. So , I want to create A general form. What can I use?
>>
>>
>> Le ven. 21 mai 2021 à 10:33, 712189512  a écrit :
>>
>>> Both forms are pretty easy to use
>>> Model form makes it more simpler because it takes your model and creates 
>>> a form out of your model for you whereas general form you have to do 
>>> everything from scratch 
>>>
>>> On Fri, 21 May 2021 at 09:29 Théodore KOSSI  wrote:
>>>
 general usage form. Tell me what the importance of model form?


 Le ven. 21 mai 2021 à 10:27, 712189512  a 
 écrit :

> It depends on what you want to do
> Are creating the form from a model or a general usage form 
>
> On Fri, 21 May 2021 at 09:24 Théodore KOSSI  
> wrote:
>
>>
>> Hellooo guys, I need your help. I want to create a form in django and 
>> I don't know exactly what i can use to create it. 
>>
>> -- 
>> theodoros17@python-developer
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAKiMjQENmpGCoMuE3zmuaFaYkD8t7v7Kc0OWz7G_BdQegVXSNw%40mail.gmail.com
>>  
>> 
>> .
>>
> -- 
> Gabrielstone😎
>
> -- 
> 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...@googlegroups.com.
>
 To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAL-5MpUi4ZvrGfN20MrsFN4dTtD57Z0Ae5vWeCybBBZb-Afn6g%40mail.gmail.com
>  
> 
> .
>


 -- 
 theodoros17@python-developer

 -- 
 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...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/CAKiMjQFO3ssc-J4hgzc_7%2Bw_VjU88uwSBeVC-Bmupyh4mDxNKQ%40mail.gmail.com
  
 
 .

>>> -- 
>>> Gabrielstone😎
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAL-5MpXX_884cpG7de%2BHoMH1t1tuk1PJmT7%3DTEjhqZEVHD%2BEfA%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> theodoros17@python-developer
>>
>> -- 
>> 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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAKiMjQFaU2RVAf-rV%3DCx3c6jFO9fn9koUX%3DUu20GhBygouAXcQ%40mail.gmail.com
>>  
>> 
>> .
>>
> -- 
> Gabrielstone😎
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0e093d46-bb7f-463b-b575-ddd791be2634n%40googlegr

Base Template per User

2021-05-24 Thread sebasti...@gmail.com
Hello,

i want that every user from website can upload a base html file that are 
then used on every views as base template. Every User have then his own 
layout... 

Have anyone experience with such a thing?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/22701bf0-c5ad-48c5-a4e7-5bce4bc337f4n%40googlegroups.com.


Models Mixin Inherit Many to Many

2021-06-04 Thread sebasti...@gmail.com
Hello,

i need a mixin where i can inherit many to many like this:

mixin.py:

class RightsModelRelation(models.Model):

user_link = models.ForeignKey(User, on_delete=models.CASCADE, 
blank=False, null=False, default=None,
related_name="%(class)s_rights_user")
right_to_view = models.BooleanField(default=True)
right_to_change = models.BooleanField(default=False)
right_to_delete = models.BooleanField(default=False)


class RightsModelMixin(models.Model):
owner = models.ForeignKey(User, on_delete=models.CASCADE, null=False, 
default=None,
  related_name="%(class)s_owner", )
rights_link = models.ManyToManyField(RightsModelRelation, default=None,

 related_name="%(class)s_rights_link")

and in my normal model.py i want:

class Address(RightsModelMixin,models.Model):
lastname = models.CharField(max_length=255, default="", )
firstname = models.CharField(max_length=255, default="", blank=True, 
null=True)


On migrations i get:

You are trying to add a non-nullable field 'rightsmodelmixin_ptr' to 
address without a default; we can't do that (the database needs something 
to populate existing rows).

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5ae24367-e341-4ecc-9d7e-d204d866de6dn%40googlegroups.com.


Email Form with attachments

2021-07-04 Thread sebasti...@gmail.com
Hello,

i need a form where i have normal email fields like:

to_address, from_address, subject, message and also i drag and drop zone 
where i can drop attachments. I have allready implement a normal drag and 
drop zone in another form where i can drag and drop files and it is upload 
und stored.

But when i create a new email email is not stored so i can't linked new 
files with this new email. 

How does it work? That i store attachments and when user then click submit 
from email form then all attachments are linked with new email?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d3d67ab1-b7a5-46e5-8f05-af331ca08fben%40googlegroups.com.


Own Widget as Stadard

2021-08-01 Thread sebasti...@gmail.com
Hello,

i have a own widget that replace TextInput widget. Now i want everytime 
when i have in model.py a declaration models.TextField() that these new 
widget is automatical used in forms.py without everytime manual declared it 
in forms.py.

Have anyone an idea?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ab7213ef-2e67-4084-b587-a5002db2ed63n%40googlegroups.com.


Django Get model related class from many to many

2021-08-04 Thread sebasti...@gmail.com
Hello,

i have in my models.py:

class Estates(LoggerModelMixin,Standard_Model_Mixin):
contactperson = 
models.ManyToManyField(Address,default=None,related_name='estates_contactperson')

Now i want in my views.py i have my fieldname contactperson and now i want 
to get related class name  from this field in this case "Address"

I know that i can get field per:

self.Meta.model._meta.get_field('contactperson') but i have no idea how a 
can get related class Name "Address"

Can someone help me please?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2a679319-b1ec-4a43-aa73-0c349728862en%40googlegroups.com.


Django Resolve Choices Class

2023-08-30 Thread sebasti...@gmail.com
I have in my 

model.py:

class GendersChoices(models.IntegerChoices):
M = 0, _('Male')
F = 1, _('Female')
N = 2, _('Gender Neutral')

class Address(models.Model):
gender = models.PositiveSmallIntegerField(choices=GendersChoices.choices, 
blank=True, default=GendersChoices.F, null=True,verbose_name=_('Gender'))

Now i have a entity from Address and when i make entity.gender i get a 
number from database. But i want when in entity are insert 2 then i want to 
get _('Gender Neutral') instead of 2 

How i can do that?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53c122e7-0448-4d67-9cd4-ce11ffa2ef5cn%40googlegroups.com.


Change data in DB before migrating

2023-09-03 Thread sebasti...@gmail.com
Hallo,

sometimes it exists the problem that i change a field to another fieldtype 
then i want for example to move existing data in column to another column 
before migration of this field are running. Is there a possibility to 
execute a script before a field through migration are running?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ec295628-aea3-4fb0-83d9-c5efda400729n%40googlegroups.com.


Pip proxy no proxy

2023-10-27 Thread sebasti...@gmail.com
Hello Guys,

i have no proxy in my network. Suddenly when i use pip install then i get:

pip3 install django
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'ProxyError('Cannot connect to 
proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication 
Required'))': /simple/django/

But i think i don't set anything with proxy in pip or in my environment.

Have someone a idea?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e0ad77dd-5078-45a6-ab25-2d6da72bc438n%40googlegroups.com.


Python Database Migration Tool

2024-02-29 Thread sebasti...@gmail.com
Hey,

i have 2 different database systems. In source postgresql and target MS 
SQL. Now i have on source DBMS a database with a complete different schema 
like in target DBMS. Now i search a solution where i can connect to 
different DBMS Systems and can make a mapping between different source 
tables/columns to target/columns. I would prefer a ORM if such a solution 
exists.

Does anyone have a good tip for me?

Regards

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/435da4f9-d0ec-42cc-b281-84d826692a82n%40googlegroups.com.