How to allow users tag a post when making new post

2020-06-09 Thread sunday honesty
Hello Django devs! It's been a while and I hope you all are fine?

In the forum (blog) am making, I want a functionnlaity to allow users who want 
to make a post to tag other posts they created before or others created that is 
similar to the ones they're making.
I learnt about the Django taggit but am only able to use it in the admin panel. 
What I do is tag post by title, Post I have created before that I know it's 
title and id but I have no idea how to allow users do this. Can anyone help me 
out please...
I'll really be grateful.

-- 
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/3ad9cb82-0d98-46d4-85b0-b2114883dc57o%40googlegroups.com.


Bridge between two users

2020-06-09 Thread Soumen Khatua
Hi Folks,

I have one Follower system and here I want to check  those are following to
me,   we have a mutual connection or not. If they are following to me and
I'm not following to them, I want to set in frontend follow back. Inside
the views I'm fetching the data and sending them to serializer but I don't
,How I can check it?
My models and views are in below:

models.py
-







*class Follow(models.Model):follower = models.ForeignKey(User,on_delete
= models.CASCADE,related_name = 'following')followee =
models.ForeignKey(User,on_delete = models.CASCADE,related_name =
'followers')created_at = models.DateTimeField(auto_now_add = True, null
= True)updated_at = models.DateTimeField(auto_now = True, null = True)
  class Meta:   unique_together = ("follower", "followee")
 ordering  = ('-created_at',)*

views.py:
---










*class FollowerAPIView(APIView,PaginationHandlerMixin):pagination_class
= BasicPaginationserializer_class = UserFollowerSerializerdef
get(self,request,*args,**kwargs):follower_qs =
Follow.objects.filter(followee = request.user).select_related('follower')
  page = self.paginate_queryset(follower_qs)if page is not
None:serializer =
self.get_paginated_response(self.serializer_class(page, many=True).data)
else:serializer = self.serializer_class(follower_qs,
many=True)return
Response(serializer.data,status=status.HTTP_200_OK)*

Please help me

Thank You

Regards,
Soumen

-- 
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/CAPUw6WaE33pNOug_XSrX4guKFFCpnRtv3kdq2FYh8OHhf2CYrQ%40mail.gmail.com.


Demande d'aide

2020-06-09 Thread Dino P.Russe
ValueError at /cart/

Field 'id' expected a number but got 'product_id'.


cart.py 


from decimal import Decimal
from django.conf import settings
from shop.models import Product


class Cart(object):

def __init__(self, request):
"""
Initialize the cart.
"""
self.session = request.session
cart = self.session.get(settings.CART_SESSION_ID)
if not cart:
# save an empty cart in the session
cart = self.session[settings.CART_SESSION_ID] = {}
self.cart = cart

def __iter__(self):
"""
Iterate over the items in the cart and get the products
from the database.
"""
product_ids = self.cart.keys()
# get the product objects and add them to the cart
products = Product.objects.filter(id__in=product_ids)

cart = self.cart.copy()
for product in products:
cart[str(product.id)]['product'] = product

for item in cart.values():
item['price'] = Decimal(item['price'])
item['total_price'] = item['price'] * item['quantity']
yield item

def __len__(self):
"""
Count all items in the cart.
"""
return sum(item['quantity'] for item in self.cart.values())

def add(self, product, quantity=1, override_quantity=False):
"""
Add a product to the cart or update its quantity.
"""
product_id = str(product.id)
if product_id not in self.cart:
self.cart[product_id] = {'quantity': 0,
  'price': str(product.price)}
if override_quantity:
self.cart[product_id]['quantity'] = quantity
else:
self.cart[product_id]['quantity'] += quantity
self.save()

def save(self):
# mark the session as "modified" to make sure it gets saved
self.session.modified = True

def remove(self, product):
"""
Remove a product from the cart.
"""
product_id = str(product.id)
if product_id in self.cart:
del self.cart[product_id]
self.save()

def clear(self):
# remove cart from session
del self.session[settings.CART_SESSION_ID]
self.save()

def get_total_price(self):
return sum(Decimal(item['price']) * item['quantity'] for item in 
self.cart.values())

-- 
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/bb700544-fede-4a55-b5a1-f94d88ae5b19o%40googlegroups.com.


Re: I need help

2020-06-09 Thread Devender Kumar
For that you need to create a api and use ajax on javascript side to. Use
this api to push that variable either periodically or as per req


On Tue, 9 Jun, 2020, 10:24 am meera gangani, 
wrote:

> I have a html file in which i have implementing stopwatch and i have to
> that variable stored in django
>
> Here is my script.txt file is a js file, i don't know how to store js
> variables in django and stored into the database,
>  please help me out
>
> Thanking You in advance
> -Meera Gangani
>
> --
> 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/CANaPPPLYTdqUFxoDL8eTUGtMpsqdsptZKAPC6RR6h_-HuF9TdA%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/CALZ%3DbELFgWSwmH3nmYfb%3D_0adi1dgbTazPvHWfuPnKZa%3DXzFyw%40mail.gmail.com.


Re: Possible Django bug I am considering raising

2020-06-09 Thread 'OwlHoot' via Django users


On Thursday, 4 June 2020 16:25:09 UTC+1, OwlHoot wrote:
>
>
> I believe the issue I have enquired about on the following Stack Exchange 
> page :
>
>
> https://stackoverflow.com/questions/62162288/baffling-error-filtering-django-objects-of-derived-class-by-values-in-foreign-ke
>

By adding some debug code in 
/usr/lib/python3.6/site-packages/django/db/backends/base/creation.py I have 
made some progress with this "bug" (which I am no longer convinced it is).

The issue relates to a load of derived classes, as follows :

class DataSet(models.Model)

class PSessionDataSet(DataSet)
   :::
class FilteredDataSet(DataSet)
class AggregateDataSet(DataSet)

   class SurveyRunDataSet(DataSet)

   class RestrictedDataSet(SurveyRunDataSet)

These all have the same app_label value ("dataset") in their Meta class, 
and are thus in the same "group" of models.

However, the debug logging line reveals that Django thinks all these 
classes share the same default manager (_default_manager), namely 
dataset.AggregateDataSet.objects:

Model   
 Default Manager
 :::
app.survey.models.grid.GridRow   
survey.GridRow.objects
app.analysis.models.Analysis 
analysis.Analysis.objects
app.analysis.report.models.AnalysisReport   
 report.AnalysisReport.objects
app.analysis.dataset.models.dataset.DataSet 
 dataset.AggregateDataSet.objects
app.analysis.dataset.models.survey_run.SurveyRunDataSet 
 dataset.AggregateDataSet.objects
app.analysis.dataset.models.filtered.FilteredDataSet 
dataset.AggregateDataSet.objects
app.analysis.dataset.models.restricted.RestrictedDataSet 
dataset.AggregateDataSet.objects

Now I know the documentation says the default manager is chosen as the 
first it happens to come across in the model group. But that sounds 
absolutely barking mad. Shouldn't each of these models have their own 
model-specific default manager, as all the models preceding the "dataset" 
models do in the above table?!

Otherwise surely the manager will have trouble finding various 
columns/values in a model table other than the one on which it is based, 
which is exactly the error I am seeing!

So now my problem becomes how to tweak each of these "dataset" models so 
their default managers will become as follows :

Model   
 Default Manager
 :::
app.survey.models.grid.GridRow   
survey.GridRow.objects
app.analysis.models.Analysis 
analysis.Analysis.objects
app.analysis.report.models.AnalysisReport   
 report.AnalysisReport.objects
app.analysis.dataset.models.dataset.DataSet 
 dataset.DataSet.objects
app.analysis.dataset.models.survey_run.SurveyRunDataSet 
 dataset.SurveyRunDataSet.objects
app.analysis.dataset.models.filtered.FilteredDataSet 
dataset.FilteredDataSet.objects
app.analysis.dataset.models.restricted.RestrictedDataSet 
dataset.RestrictedDataSet.objects

Would that just be a matter of adding lines as follows (typically in the 
FilteredDataSet class) :

  objects = FilteredDataSet.Manager()

or does one need a more elaborate overriding of get_queryset() ?

Any ideas gratefully received.

?

-- 
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/961761ab-10d8-4f7d-bc24-961200f54e5co%40googlegroups.com.


Re: FilterSelectMultiple Widget's right list box does not render

2020-06-09 Thread Zanii Mirzaa
i have same problem i cant figure out the solution i am new to django and 
web programming also
My console error is  :
VM328 SelectFilter2.js:246 Uncaught ReferenceError: grp is not defined
at VM328 SelectFilter2.js:246
(anonymous) @ VM328 SelectFilter2.js:246
SelectBox.js:144 Uncaught ReferenceError: grp is not defined
at VM327 SelectBox.js:144
(anonymous) @ SelectBox.js:144
SelectFilter2.js:246 Uncaught ReferenceError: grp is not defined
at VM328 SelectFilter2.js:246

Cant get rid of it someone aware of this problem plz help.. i am a student 
a this is my final year project.


On Wednesday, July 3, 2019 at 6:34:30 AM UTC+5, Yeashin Rabbi wrote:
>
> Hello,
> I tried to use Django's FilterSelectMultiple Widget. But it does not 
> render the right list box. Any help would be appreciated.
>
> Thanks 
>
> Here is my code:
>
> forms.py
>
> class appForm(ModelForm):
> port = forms.ModelMultipleChoiceField(internalapp.objects.all(),widget=
> FilteredSelectMultiple("Port",False,attrs={'rows':'10'}))
> class Meta:
> model = internalapp
> fields = '__all__'
> class Media:
> css = {'all': ('/static/admin/css/widgets.css',), }
> js = ('/admin/jsi18n/',)
>
> views.py
> def testhome(request):
> submitted = False
> if request.method == 'POST' :
> form = appForm(request.POST)
> if form.is_valid():
> form.save()
> return HttpResponseRedirect('/testhome/?submitted=True')
> else:
> form = appForm()
>
> if 'submitted' in request.GET:
> submitted = True
> return render(request, 'tryout/testhome.html', {'form': form, 'submitted': 
> submitted})
>
> templates
> {% load static %}
> 
> 
> 
> 
> 
>  
> Document
> 
> 
> {{ form.media }}
> 
> 
> {{form.ports }}
> 
> 
> 
> 
>
>

-- 
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/0c2fc354-c1d9-4fe8-8a47-e384ba865d1fo%40googlegroups.com.


Two models one form, or use generic CreateView

2020-06-09 Thread The Sha
Hi 

I hava a problem in django, i have to models one is a CustomUser Model and 
the other is a Address model. 

The problem is that when i create a generic CreateView for the Address 
model and use a pk: url the address form wont get the instance of the users 
PK for adding a new address.

my models look like this, Even though i pass the PK in the URL the 
CreateView does not understand that i want to add a address to user with 
id: 42 in this example. How can i solve this problem?







The URL
 path('/address', views.AddressCreateView.as_view(), name
='Address-add'),


*This is my view*
class AddressCreateView(CreateView):
model = Address
template_name = 'members/address_form.html'
success_url = reverse_lazy('MemberIndex')
fields = ('CustomUser', 'address', 'zip_code', 'city', 'state','active')


*The model*
class CustomUser(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(_('email address'), unique=True)
personal_Id = models.CharField(max_length=12, blank=False)
first_name = models.CharField(_('first name'), max_length=30, blank=True
)
middle_name = models.CharField('middle name', max_length=30, blank=True)
last_name = models.CharField(_('last name'), max_length=30, blank=True)
is_staff = models.BooleanField(default=False)
is_active = models.BooleanField(default=True)
date_joined = models.DateTimeField(default=timezone.now)
avatar = models.ImageField(upload_to='images', blank=True)

def __str__(self):
return self.email

def full_name(self):
return '%s %s %s' % (self.first_name, self.middle_name, self
.last_name)

USERNAME_FIELD = 'email'
REQUIRED_FIELDS = []


objects = CustomUserManager()

class Address(models.Model):
CustomUser = models.ForeignKey(CustomUser, on_delete=models.CASCADE)
address = models.CharField(max_length=60, blank=False)
zip_code = models.CharField(max_length=8, blank=False)
city = models.CharField(max_length=30, blank=False)
state = models.CharField(max_length=30, blank=False)
active = models.BooleanField(name='active', default=True, editable=True)
address_reg_date = models.DateTimeField(default=timezone.now)
class Meta:
verbose_name_plural = "Address"
 
def __str__(self):
 return self.address +', '+ str(self.zip_code) + ', ' + self.city





-- 
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/d0d3596f-6c0e-4928-8e57-7eb5476821d3o%40googlegroups.com.


Re: Custom template tags - instance.templatetag

2020-06-09 Thread The Sha


Den tisdag 2 juni 2020 kl. 22:53:06 UTC+2 skrev Jan Gregorczyk:
>
> Hi! How to change my template tag?
> from django import template
>
> register = template.Library()
>
> @register.simple_tag
> def votes_up_exists(answer, user_id):
> pass
>
> how I use it - {% votes_up_exists answer request.user.id %}
> how I would like to use it - {% answer.votes_up_exists user_id %}
>
>

-- 
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/7f9a51cf-4762-4b16-99ec-6ced288ade5fo%40googlegroups.com.


Re: How to get a full path of web page to my views.py?

2020-06-09 Thread Sergei Sokov
I would like to use a current url path in my views.py

понедельник, 8 июня 2020 г., 14:25:25 UTC+2 пользователь Rupesh Dahal 
написал:
>
> Can you please elaborate your problem.
>
> On Monday, June 8, 2020 at 12:26:12 AM UTC+5:45, Sergei Sokov wrote:
>>
>> I have the path in the web browser like this
>>
>> http://192.168.0.178:8000/customers-orders/37/customers-orders-date/?datefilter=06%2F14%2F2020+-+06%2F26%2F2020
>>
>> How to get this path to my views.py for to work with it?
>>
>

-- 
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/d6fe7979-a895-4797-98b1-ea4fdbdc8c34o%40googlegroups.com.


Re: How to get a full path of web page to my views.py?

2020-06-09 Thread Chetan Ganji
https://docs.djangoproject.com/en/3.0/ref/request-response/


On Tue, Jun 9, 2020, 6:41 PM Sergei Sokov  wrote:

> I would like to use a current url path in my views.py
>
> понедельник, 8 июня 2020 г., 14:25:25 UTC+2 пользователь Rupesh Dahal
> написал:
>>
>> Can you please elaborate your problem.
>>
>> On Monday, June 8, 2020 at 12:26:12 AM UTC+5:45, Sergei Sokov wrote:
>>>
>>> I have the path in the web browser like this
>>>
>>> http://192.168.0.178:8000/customers-orders/37/customers-orders-date/?datefilter=06%2F14%2F2020+-+06%2F26%2F2020
>>>
>>> How to get this path to my views.py for to work with it?
>>>
>> --
> 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/d6fe7979-a895-4797-98b1-ea4fdbdc8c34o%40googlegroups.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/CAMKMUjv3z1X9YRBwjcSP2MP9c1y5SaoFUzmJn6bCb5ift91oEA%40mail.gmail.com.


Re: Two models one form, or use generic CreateView

2020-06-09 Thread Yamen Gamal Eldin
There's many ways to solve it. My favorable approach will be to override
the save method in the targeted form.

Le mar. 9 juin 2020 à 14:35, The Sha  a écrit :

> Hi
>
> I hava a problem in django, i have to models one is a CustomUser Model and
> the other is a Address model.
>
> The problem is that when i create a generic CreateView for the Address
> model and use a pk: url the address form wont get the instance of the users
> PK for adding a new address.
>
> my models look like this, Even though i pass the PK in the URL the
> CreateView does not understand that i want to add a address to user with
> id: 42 in this example. How can i solve this problem?
>
>
>
>
>
>
>
> The URL
>  path('/address', views.AddressCreateView.as_view(),
> name='Address-add'),
>
>
> *This is my view*
> class AddressCreateView(CreateView):
> model = Address
> template_name = 'members/address_form.html'
> success_url = reverse_lazy('MemberIndex')
> fields = ('CustomUser', 'address', 'zip_code', 'city', 'state',
> 'active')
>
>
> *The model*
> class CustomUser(AbstractBaseUser, PermissionsMixin):
> email = models.EmailField(_('email address'), unique=True)
> personal_Id = models.CharField(max_length=12, blank=False)
> first_name = models.CharField(_('first name'), max_length=30, blank=
> True)
> middle_name = models.CharField('middle name', max_length=30, blank=
> True)
> last_name = models.CharField(_('last name'), max_length=30, blank=True
> )
> is_staff = models.BooleanField(default=False)
> is_active = models.BooleanField(default=True)
> date_joined = models.DateTimeField(default=timezone.now)
> avatar = models.ImageField(upload_to='images', blank=True)
>
> def __str__(self):
> return self.email
>
> def full_name(self):
> return '%s %s %s' % (self.first_name, self.middle_name, self
> .last_name)
>
> USERNAME_FIELD = 'email'
> REQUIRED_FIELDS = []
>
>
> objects = CustomUserManager()
>
> class Address(models.Model):
> CustomUser = models.ForeignKey(CustomUser, on_delete=models.CASCADE)
> address = models.CharField(max_length=60, blank=False)
> zip_code = models.CharField(max_length=8, blank=False)
> city = models.CharField(max_length=30, blank=False)
> state = models.CharField(max_length=30, blank=False)
> active = models.BooleanField(name='active', default=True, editable=
> True)
> address_reg_date = models.DateTimeField(default=timezone.now)
> class Meta:
> verbose_name_plural = "Address"
>
> def __str__(self):
>  return self.address +', '+ str(self.zip_code) + ', ' + self.city
>
>
>
>
>
> --
> 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/d0d3596f-6c0e-4928-8e57-7eb5476821d3o%40googlegroups.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/CAOwHV69AZvtkpK8g%3Dvbo16Lri%3Dh83MkD6Uch8e66sOio6OdB-w%40mail.gmail.com.


Re: Two models one form, or use generic CreateView

2020-06-09 Thread The Sha
Ok intressant, i cant find any good exemplen. Thank you for the reply. Im new 
to django can you maybe be more specific with som examples or point me in the 
right direktion? thank you

-- 
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/c484bbef-d743-48c4-b13f-1a1e5f122976o%40googlegroups.com.


Django 1.11 security backports

2020-06-09 Thread Nikolas J. Nyby
Is anyone maintaining an unofficial Django 1.11 security backports branch?

I'm migrating to Django 2.2 as soon as possible, but I was just curious if 
anyone has a branch with the recent security fixes ported in to Django 1.11.

-- 
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/04422a43-c652-496a-b932-7f08f49f2915o%40googlegroups.com.


Understanding timezone with queryset day lookups

2020-06-09 Thread Ryan Causey
I ran into what I consider somewhat surprising behavior the other day when 
using the `__date` lookup to compare a datetime to a date in a queryset.

It appears according to these docs that the Queryset will convert the 
datetime value in the DateTimeField to the current timezone before 
comparing.
https://docs.djangoproject.com/en/dev/ref/models/querysets/#date

The reason I found this surprising is that `timezone.now()` always returns 
the time in UTC and in this contrived instance I was wanting to compare 
against UTC "today". I know this contrived example doesn't make sense, but 
the longer answer is I had other models' fields being set to UTC "today" 
using `timezone.now().date()`, and was using those fields' values to 
compare against a DateTimeField. The queryset behavior (I believe) doesn't 
work the way I expected in this context. Maybe this is pointing to UTC 
"today" is the "wrong" way to do it?

Is this queryset behavior due to the way timezone aware inputs in forms 
works? I.E. Naive datetime in form -> made aware in currently active 
timezone -> converted to UTC and stored in database if I understand 
correctly?

Thanks,
-Ryan Causey


-- 
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/46be92f6-aca9-4b32-a0ce-799467f73e30o%40googlegroups.com.


Changing name of file in FileField field

2020-06-09 Thread Matthew Pava
Good day,
I have been struggling with this issue for weeks, and I can't figure out 
what I'm doing wrong.
I have a model with a FileField with a custom upload_to function. It seems 
to work fine when I'm doing runserver.
Problems arise during my tests.

My assertion error fails:

AssertionError: 'Rev0_2020-06-09_L123_My_Document_63ExUTF.docx' != 
'Rev0_2020-06-09_L123_My_Document.docx'
- Rev0_2020-06-09_L123_My_Document_63ExUTF.docx
? 
+ Rev0_2020-06-09_L123_My_Document.docx


You see, it keeps adding these extra random characters to the filename, 
which is not at all in my upload_to function.

class DocumentTestCase(TestCase):
def create_document(self, **kwargs):
if 'file' not in kwargs:
kwargs['file'] = self.get_test_file()
return Document.objects.create(**kwargs)

 def _create_file(self):
f = tempfile.NamedTemporaryFile(suffix=self.TEST_FILE_EXTENSION, 
delete=False)
with open(f.name, mode='wb'):

f.write(b"NA")

return open(f.name, mode='rb')


TEST_FILE_EXTENSION = ".docx"

def setUp(self):
super().setUp()

settings.MEDIA_ROOT = MEDIA_ROOT

def get_test_file(self):
file = self._create_file()

return File(file, name=file.name)

def test_rename_file_after_upload(self):
d1 = self.create_document(title="My Document", number="L123")

title = d1.title.replace(" ", "_")
extension = Path(d1.file.path).suffix

new_name = 
f"Rev{d1.revision}_{d1.revision_date}_{d1.number}_{title}{extension}"
self.assertEqual(Path(d1.file.name).name, new_name)



-- 
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/cbc812fc-6d5e-4afb-ab64-6bc0fad303a3o%40googlegroups.com.


Re: How to get a full path of web page to my views.py?

2020-06-09 Thread Sergei Sokov
Thank you

вторник, 9 июня 2020 г., 15:37:39 UTC+2 пользователь RyuCoder написал:
>
> https://docs.djangoproject.com/en/3.0/ref/request-response/ 
> 
>
> On Tue, Jun 9, 2020, 6:41 PM Sergei Sokov > 
> wrote:
>
>> I would like to use a current url path in my views.py
>>
>> понедельник, 8 июня 2020 г., 14:25:25 UTC+2 пользователь Rupesh Dahal 
>> написал:
>>>
>>> Can you please elaborate your problem.
>>>
>>> On Monday, June 8, 2020 at 12:26:12 AM UTC+5:45, Sergei Sokov wrote:

 I have the path in the web browser like this

 http://192.168.0.178:8000/customers-orders/37/customers-orders-date/?datefilter=06%2F14%2F2020+-+06%2F26%2F2020

 How to get this path to my views.py for to work with it?

>>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d6fe7979-a895-4797-98b1-ea4fdbdc8c34o%40googlegroups.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/c529f1ea-d1e0-4e1b-b942-a578a174359co%40googlegroups.com.


Re: Python 3.8 Installed, yet Django 1.11 is Automatically Being Installed on Mac

2020-06-09 Thread Clive Bruton

You have to use the correct python install:

python3 -m pip install django

You can test your versions and locations:

which python3
which python

python3 -V
python -V

When you are running the development server:

python3 manage.py runserver

You can have multiple python versions installed, you just need to  
understand which one you are addressing/using.



-- Clive

On 9 Jun 2020, at 03:37, arhoon io wrote:


Hello,

I have installed and successfully confirmed that Python 3.8 works  
on my Mac.  However, when I pip installed the latest version of  
Django, it automatically installed Django 1.11 even though I have  
Python 3.8.


When typing in "python" into terminal, it runs Python 2.7 - so that  
is my guess.


If that is true, how do I get the actual latest version of Django  
(3.0)?


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/d02c23bd-0c04-47c1-8602-63c74e35e144o% 
40googlegroups.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/842AFD7C-4F75-4F68-84AC-B86E4C98ED0F%40indx.co.uk.


Re: Changing name of file in FileField field

2020-06-09 Thread Chetan Ganji
Hi,
I had come across a similar issue last year. Filename would change after
the upload.
It been time and I am not sure why it happened then. But, i think it
happened
because a file with the same name was already present the given location.
And the django/drf code would make the name of the file unique by appending
random text like above.
You can check if this is the case.

You can try a couple of things.

1. Print the name of the file being generated as soon as it gets generated.

2. Print the name of the file and Path(d1.file.name).name just before the
assertion.
3. Check if a document with the same name already exists in the db and
media root folder, and make sure that it doesnt.

I hope it helps.

Cheers


Regards,
Chetan Ganji
+91-900-483-4183
ganji.che...@gmail.com
http://ryucoder.in


On Wed, Jun 10, 2020 at 12:31 AM Matthew Pava 
wrote:

> Good day,
> I have been struggling with this issue for weeks, and I can't figure out
> what I'm doing wrong.
> I have a model with a FileField with a custom upload_to function. It
> seems to work fine when I'm doing runserver.
> Problems arise during my tests.
>
> My assertion error fails:
>
> AssertionError: 'Rev0_2020-06-09_L123_My_Document_63ExUTF.docx' !=
> 'Rev0_2020-06-09_L123_My_Document.docx'
> - Rev0_2020-06-09_L123_My_Document_63ExUTF.docx
> ? 
> + Rev0_2020-06-09_L123_My_Document.docx
>
>
> You see, it keeps adding these extra random characters to the filename,
> which is not at all in my upload_to function.
>
> class DocumentTestCase(TestCase):
> def create_document(self, **kwargs):
> if 'file' not in kwargs:
> kwargs['file'] = self.get_test_file()
> return Document.objects.create(**kwargs)
>
>  def _create_file(self):
> f = tempfile.NamedTemporaryFile(suffix=self.TEST_FILE_EXTENSION, 
> delete=False)
> with open(f.name, mode='wb'):
>
> f.write(b"NA")
>
> return open(f.name, mode='rb')
>
>
> TEST_FILE_EXTENSION = ".docx"
>
> def setUp(self):
> super().setUp()
>
> settings.MEDIA_ROOT = MEDIA_ROOT
>
> def get_test_file(self):
> file = self._create_file()
>
> return File(file, name=file.name)
>
> def test_rename_file_after_upload(self):
> d1 = self.create_document(title="My Document", number="L123")
>
> title = d1.title.replace(" ", "_")
> extension = Path(d1.file.path).suffix
>
> new_name = 
> f"Rev{d1.revision}_{d1.revision_date}_{d1.number}_{title}{extension}"
> self.assertEqual(Path(d1.file.name).name, new_name)
>
>
>
> --
> 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/cbc812fc-6d5e-4afb-ab64-6bc0fad303a3o%40googlegroups.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/CAMKMUjsSKYU3FyD4SL%3DxumDc3spfM74KmnFhpRBbFniNe5ex2w%40mail.gmail.com.


Re: Python 3.8 Installed, yet Django 1.11 is Automatically Being Installed on Mac

2020-06-09 Thread arhoon io
Thank you all - I downloaded Django 3.0 using Anaconda.

On Tuesday, June 9, 2020 at 2:35:04 PM UTC-5, Clive Bruton wrote:
>
> You have to use the correct python install: 
>
> python3 -m pip install django 
>
> You can test your versions and locations: 
>
> which python3 
> which python 
>
> python3 -V 
> python -V 
>
> When you are running the development server: 
>
> python3 manage.py runserver 
>
> You can have multiple python versions installed, you just need to   
> understand which one you are addressing/using. 
>
>
> -- Clive 
>
> On 9 Jun 2020, at 03:37, arhoon io wrote: 
>
> > Hello, 
> > 
> > I have installed and successfully confirmed that Python 3.8 works   
> > on my Mac.  However, when I pip installed the latest version of   
> > Django, it automatically installed Django 1.11 even though I have   
> > Python 3.8. 
> > 
> > When typing in "python" into terminal, it runs Python 2.7 - so that   
> > is my guess. 
> > 
> > If that is true, how do I get the actual latest version of Django   
> > (3.0)? 
> > 
> > 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...@googlegroups.com . 
> > To view this discussion on the web visit https://groups.google.com/ 
> > d/msgid/django-users/d02c23bd-0c04-47c1-8602-63c74e35e144o% 
> > 40googlegroups.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/2d4b0971-4748-4bd2-bb21-a240a6dc3667o%40googlegroups.com.


Re: Two models one form, or use generic CreateView

2020-06-09 Thread Yamen Gamal Eldin
It's pretty straight forward, just search about overload save function for
update view, that will make u create a save function in your form, do the
necessary actions on your instance, and voula

Le mar. 9 juin 2020 à 16:24, The Sha  a écrit :

> Ok intressant, i cant find any good exemplen. Thank you for the reply. Im
> new to django can you maybe be more specific with som examples or point me
> in the right direktion? thank you
>
> --
> 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/c484bbef-d743-48c4-b13f-1a1e5f122976o%40googlegroups.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/CAOwHV6-xNyap9KJ6YirraEmwZYSR-S%3DTrQn7-LrJzHa_BB-cQA%40mail.gmail.com.


Re: Django 1.11 security backports

2020-06-09 Thread carlos
i think no!

On Tue, Jun 9, 2020 at 10:21 AM Nikolas J. Nyby 
wrote:

> Is anyone maintaining an unofficial Django 1.11 security backports branch?
>
> I'm migrating to Django 2.2 as soon as possible, but I was just curious if
> anyone has a branch with the recent security fixes ported in to Django 1.11.
>
> --
> 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/04422a43-c652-496a-b932-7f08f49f2915o%40googlegroups.com
> 
> .
>


-- 
att.
Carlos Rocha

-- 
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/CAM-7rO3RO7NLXo4mon8xXbdWwPvSrgd0bB4EGP0neKDdh1iqcw%40mail.gmail.com.


Django-Firebase cloudstore ORM

2020-06-09 Thread sparsh goil
Hey, 
Does anyone know how to perfectly use Firebase with Django?

I am using Django-Firebase-ORM which automatically maps my models to cloud 
firestore database but I am getting error.
Model.py
from firebase_orm import models
# Create your models here.

class Article(models.Model):
headline = models.TextField()
type_article = models.TextField(db_column='type')

class Meta:
db_table = 'medications'

def __str__(self):
return self.headline

>python3 manage.py makemigrations

Error:
Traceback (most recent call last):
  File "manage.py", line 21, in 
main()
  File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
  File "/home/spaggy/Documents/Summer Internship 
2020/venv/lib/python3.6/site-packages/django/core/management/__init__.py", 
line 401, in execute_from_command_line
utility.execute()
  File "/home/spaggy/Documents/Summer Internship 
2020/venv/lib/python3.6/site-packages/django/core/management/__init__.py", 
line 377, in execute
django.setup()
  File "/home/spaggy/Documents/Summer Internship 
2020/venv/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
  File "/home/spaggy/Documents/Summer Internship 
2020/venv/lib/python3.6/site-packages/django/apps/registry.py", line 122, 
in populate
app_config.ready()
  File "/home/spaggy/Documents/Summer Internship 
2020/venv/lib/python3.6/site-packages/django/contrib/admin/apps.py", line 
24, in ready
self.module.autodiscover()
  File "/home/spaggy/Documents/Summer Internship 
2020/venv/lib/python3.6/site-packages/django/contrib/admin/__init__.py", 
line 26, in autodiscover
autodiscover_modules('admin', register_to=site)
  File "/home/spaggy/Documents/Summer Internship 
2020/venv/lib/python3.6/site-packages/django/utils/module_loading.py", line 
47, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 994, in _gcd_import
  File "", line 971, in _find_and_load
  File "", line 955, in _find_and_load_unlocked
  File "", line 665, in _load_unlocked
  File "", line 678, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File "/home/spaggy/Documents/Summer Internship 
2020/AI_legal/AI_legal/case_archives/admin.py", line 4, in 
admin.site.register(Article)
  File "/home/spaggy/Documents/Summer Internship 
2020/venv/lib/python3.6/site-packages/django/contrib/admin/sites.py", line 
103, in register
for model in model_or_iterable:
TypeError: 'ModelBase' object is not iterable



-- 
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/2208da1b-3469-4a30-ab7e-4fda4016fe8bo%40googlegroups.com.


autocomplete django in visual studio code

2020-06-09 Thread cosmos multi
I am having a problem and it is that since I have a new laptop I 
reinstalled arch linux and visual studio code, but when I reinstalled the 
software the visual studio code autocomplete for django does not work for 
me, for python it does without problems but When working with django, the 
framework options do not work, that is, when I work with views based on 
classes, autocompletion does not generate for me, such as template_name, 
form_class, etc., likewise with models it does not generate the help of 
max_length , and those other things of the framework, I have selected the 
interpreter but it doesn't work for me and also python: build workspace 
symbols and nothing. in advance I appreciate the help.

-- 
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/8df9e8ea-8de9-4df0-943d-0f5d55b611b0o%40googlegroups.com.


autocomplete django in visual studio code

2020-06-09 Thread THAKUR SINGH
INSTALL WINDOWS 10 THEN  INSTALL YOUR SOFTWARES

-- 
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/60cd712f-07ed-471c-887a-f5e77b4402dfo%40googlegroups.com.


Re: Django CSRF protection and AJAX calls

2020-06-09 Thread Allan Rafael
Você pode criar um arquivo js chamado *ajax_post_config.js* e nele inserir
o seguinte código:


function csrfSafeMethod(method) {
// these HTTP methods do not require CSRF protection
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
}
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie !== '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i].trim();
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) === (name + '=')) {
cookieValue =
decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
let csrftoken = getCookie('csrftoken');


E no template html, você deve inserir beforeSend assim:


 
$.ajax({
url: url,
type: 'POST',
data: {'data1': data1},
dataType: 'json',
beforeSend: function(xhr, settings) {
if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
xhr.setRequestHeader("X-CSRFToken", csrftoken);
}
},
...



É isso, espero ter ajudado



Atenciosamente,

*Allan Rafael Ferreira de Oliveira*

*Bacharel em Ciência da Computação • Universidade Estadual da
ParaíbaEstagiário de TI • PrestContas*


Em ter., 26 de mai. de 2020 às 15:20, Kevin  escreveu:

> Hi,
>
> I'm not able to POST to django without having a csrf_token cookie sent
> with the request, though the documentation says you can set an X-CSRFToken
> header - it appears to be entirely ignored.
>
> The behaviour has been pointed out a couple of times before:
>
> https://code.djangoproject.com/ticket/26904
>
> https://code.djangoproject.com/ticket/30514
>
> but it doesn't appear to have ever been triaged by a project member or
> looked into in any way.
>
> I'm trying to find a definitive answer - should a POST request to a CSRF
> protected endpoint work without the cookie if the header is set?
>
> Thanks
>
> -Kevin
>
> --
> 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/1e318fcd-32bc-448b-bd4d-05b92f4a8afc%40googlegroups.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/CAFTj3EQn2c_QwO3GCdP7Kycuqtd%3DNS43P_DU8VcyuDTKc69_DQ%40mail.gmail.com.


Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-09 Thread chaitanya orakala
sure, I will do it by tomorrow


On Tue, Jun 9, 2020 at 2:35 AM Balaji Shetty  wrote:

> Nice
>
> Can you please share sample code on git link.
>
> This is very common requirement in every project
>
>
>
> On Tuesday, June 9, 2020, chaitanya orakala 
> wrote:
>
>> Thank You, Amine Aziz. I tried jquery and it worked. its so simple once
>> we know jquery.
>> do help others like you did to me.
>>
>> On Sun, Jun 7, 2020 at 1:18 PM AMINE AZIZ  wrote:
>>
>>> I will share with you my iwn code used in admin , but it still the same
>>> as the front end
>>>
>>> withe jQuery i can show input or hide it , so you will do the same with
>>> popup , by default it will be display none, and with Jquery you can show it
>>> if user change value to yes dropdown (select)
>>>
>>> you will use id div of pupup to show it or hide it
>>>
>>>
>>> if (!$) {
>>> // Need this line because Django also provided jQuery and namespaced as 
>>> django.jQuery
>>> $ = django.jQuery;
>>> }
>>>
>>>
>>>
>>> $(document).ready(function() {
>>>
>>> $("#id_paysPartenaires").change(function()
>>> {
>>>
>>>
>>>
>>>  var 
>>> total_partenaire=$("#id_multipartenairecooperationbilaterale_set-TOTAL_FORMS").val()
>>> var SelectNumber =  i
>>>  
>>> SelectedValuePartenaire=$("#id_multipartenairecooperationbilaterale_set-"+SelectNumber+"-multiPartenairePP").val()
>>>  //alert(SelectNumber)
>>>
>>>
>>>
>>> 
>>> $("[id=div-2-multiAdefinir]:eq("+SelectNumber+")").hide();
>>> 
>>> $("[id=div-2-multiGouvernementPP]:eq("+SelectNumber+")").hide();
>>>
>>> $("[id=div-2-multiGouvernementPP]:eq("+SelectNumber+")").hide();
>>> 
>>> $("[id=div-2-multiPaysPP]:eq("+SelectNumber+")").show();
>>>   }
>>>
>>>
>>> });
>>>
>>>
>>> Le dimanche 7 juin 2020 07:34:00 UTC+1, Sai a écrit :

 Hi guys,
 I am working on a* Django project,* which involves submission form and
 saving the data in the database using model form.  I am stuck with one of
 the functionalities of form which should work like for example "do you want
 benefit plan: *YES,* *next Field options should pop up*. if click* NO,
 nothing should happen* and move to the next question."

 I went through all over the internet and found the dependent drop-down
 select option but not like field pop up as we click through te form.

 Please let me know how to achieve this in a clear way as I am new to
 Django and programming as well.

 Thank You so much 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/3f3bf262-7fac-4818-836e-dc8532dae707o%40googlegroups.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/CAPcTzRabB90jUEuYj1v-9JWdOMqqsM4fjN-TEq1CwOcwEPX1zA%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Mr Shetty Balaji
> Asst. Prof.
> IT Department
> SGGS I&T
> Nanded. My. India
>
> --
> 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/CAECSbOt4OiS_WLAucNWQtwpWuZ_LZe1hXyM4%3DFXZzmm6mSVGHw%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/CAPcTzRZb4y8yGrf%3DM%3DX4cEhGaf_TWmMnszknWd13Zen_uxfMHw%40mail.gmail.com.


Re: Two models one form, or use generic CreateView

2020-06-09 Thread chaitanya orakala
Hi Sha,
I like your template CSS styling and formatting.
Could you please post your index HTML and CSS style if you don't mind.
Thanks in Advance

On Tue, Jun 9, 2020 at 4:18 PM Yamen Gamal Eldin  wrote:

> It's pretty straight forward, just search about overload save function for
> update view, that will make u create a save function in your form, do the
> necessary actions on your instance, and voula
>
> Le mar. 9 juin 2020 à 16:24, The Sha  a écrit :
>
>> Ok intressant, i cant find any good exemplen. Thank you for the reply. Im
>> new to django can you maybe be more specific with som examples or point me
>> in the right direktion? thank you
>>
>> --
>> 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/c484bbef-d743-48c4-b13f-1a1e5f122976o%40googlegroups.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/CAOwHV6-xNyap9KJ6YirraEmwZYSR-S%3DTrQn7-LrJzHa_BB-cQA%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/CAPcTzRa%3D2P5WTpzgXwFdPwnWpY75p%2BJhw9zDyasNHdgJ1DQwrg%40mail.gmail.com.