generate string array XML like the format above?
Regards,
Sencer HAMARAT
--
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...@google
category = CategorySerializer()
class Meta:
model = Vendor
fields = ["vendor_id", "vendor_name", "vendor_location", "category"]
You can filter by category now.
Regards,
Sencer HAMARAT
On Wed, Dec 8, 2021 at 4:59 PM Gautam Ankul wrote:
Hi,
I think this is not related with apache
It seems like class object property is called as a method somehow.
Unfortunately the error does not reveal the property name.
Regards,
Sencer HAMARAT
On Wed, Dec 8, 2021 at 4:59 PM Kyle Paterson
wrote:
> Started a new project after not us
4.0, sphinx 4.2.0, sphinx 4.3.1
I also opened an issue at sphinx github but they said this has to do with
django admindocs instead of sphinx.
Is there anybody who has resolved the AttributeError exception thrown while
building documents via sphinx?
Regards,
Sencer HAMARAT
--
You received thi
I also opened an issue at sphinx github but they said this has to do with
>> django admindocs instead of sphinx.
>>
>> Is there anybody who has resolved the AttributeError exception thrown
>> while building documents via sphinx?
>>
>> Regards,
>> Sencer HAMARAT
&
)
class ModelB(models.Model):
image = ImageField(
verbose_name=_('Product Image'),
max_length=400,
default=static('images/default_thumbnail.png'),
)
Also, I need to figure out how to track any change in a single image field.
Regards,
Sencer
Thanks but, no.
I didn't mean the comparing content of the files.
19 Şub 2022 Cmt 21:55 tarihinde şunu yazdı:
> OpenCV
>
> - Tom
>
> On Feb 19, 2022, at 2:27 AM, Sencer Hamarat
> wrote:
>
>
> Hi,
>
> I have two different models which include image fiel
Hello people,
There are two models that are related to each other.
class Parent(models.Model):
name = models.CharField...
class Child(models.Model):
parent = models.ForeignKey(Parent)
value = models.CharField...
And there is a serializer built on "Child" model:
class ChildSerialize
ns all data instead of raising an error.
Is there a way to raise an error if the lookup expression is other than
specified in Meta class ('in', 'exact')?
At least preventing returning full data from the Model.
Kind regards,
Sencer HAMARAT
--
You received this message becau
exclude query with name
argument and "john" value.
Something like:
self.queryset.exclude(name="john")
Kind regards,
Sencer HAMARAT
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and
leted:
- who is taking this action (ForeignKey)
- what is the action (Choice)
- which applications model object affected (ContentType)
- affected object (Generic relation)
- current data in json format
- previous data in json format
Kind regards,
Sencer HAMARAT
--
You received this me
Hi Lalit,
Thanks for your reply.
Actually, It must cover all models. Not certain ones.
I thought middleware should be a much better place for this action, but I
can't imagine how to handle it.
Saygılarımla,
Sencer HAMARAT
On Fri, Jun 3, 2022 at 9:01 PM Lalit Suthar
wrote:
> H
Hi, Mukul
Never use a disk file for audit logging.
Use at least a DB. On the other hand, using logging facilities or
specialized tools are better options.
Jason's suggestion above might lead you to the right choice.
Kind Regards,
Sencer HAMARAT
On Mon, Jun 6, 2022 at 7:59 AM Mukul
27;example2.com',...])
]
)
Can I dynamically fetch domains from another model and assign to allowlist?
"allowlist" must be altered instantly if related domain list model records
are changed.
Regards,
Sencer HAMARAT
--
You received this message because you are subscribed to the Google Gr
it without iterating the object list?
Regards,
Sencer HAMARAT
--
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.co
Don use 'o' as a template variable in the template function
Use {% static 'poll/'|add:o %} instead.
16 Haz 2022 Per 14:09 tarihinde luca72.b...@gmail.com <
luca72.bertolo...@gmail.com> şunu yazdı:
> Hello i have a list like:
> mylist = ['1,png','2.png',3.jpj']
> in the template i do as follow:
rent object, too?
Is there any chance to make this happen in a transaction to roll back any
related record?
Kind regards,
Sencer HAMARAT
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receivi
Hi,
I tried that but, when child_serializer.save() throws an exception, the row
created by parent_serializer.save() at the database is not rolled back.
Kind regards,
Sencer HAMARAT
On Mon, Jul 4, 2022 at 7:59 PM Ryan Nowakowski wrote:
> You can use transaction.atomic:
>
&
ta
as a nested json,
wrote a create method in the serializer and pushed the data through a
single serializer to the db.
Thus, any bad request at the serializer validation level is avoided and
there is no need to go back.
Anyway, If you think that my claim above is false, I would like to hear
your opin
that maneuver ends up with raising complexity.
Can anybody help me to learn how to reduce cognitive complexity in code
blocks like this?
Kind regards,
Sencer HAMARAT
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this
1
Is that can be fetched by query like this?
AModel.objects.all(
).annotate(
c_count=Count(
Amodel.objects.filter(field_two=1).count()
)
)
Saygılarımla,
Sencer HAMARAT
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubs
e_level" @> (U0."book_id") "current_rejected_count",
"books"."id",
FROM "publisher"
INNER JOIN "books" ON ("publisher"."book_id" = "books"."id")
WHERE "publ
add explicit type casts.
Is there a way to handle this error? How can I cast the value into an array?
Regards,
Sencer HAMARAT
On Tue, Jul 26, 2022 at 6:34 PM Ross Meredith wrote:
>
> https://docs.djangoproject.com/en/4.0/ref/models/expressions/#django.db.models.OuterRef
>
>
I'm having a problem with this query:
I believe,
Q(bundle__contains=OuterRef("book_id"))
part of the query is expecting an array instead of single value.
I'm getting this error:
ProgrammingError: operator does not exist: jsonb @> bigint
LINE 1: ...lisher"."book_id") OR U0."bundle" @> ("publis
the user data has no email information.
This will return error like:
{"email":["This field may not be blank."], "email":["This field may not be
blank."], ...}
I want to add error related data or at least index number to error text
Is there a way to
Hello again,
For anyone interested, more detailed version was sent to stackoverflow:
https://stackoverflow.com/questions/73231297/proper-way-to-return-erroneous-data-with-serializer-error
Kind regards,
Sencer HAMARAT
On Wed, Aug 3, 2022 at 7:58 AM Sencer Hamarat
wrote:
> Hi,
>
>
last
childs like:
last_childs = list()
for parent in Parent.objects.filter(id__in=[1, 2, 3, 4]):
last_childs.append(parent.child_set.last())
Kind regards,
Sencer HAMARAT
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe
Hi,
I need to pass an arbitrary argument from the serializer.save() method to
model.save() method?
Such as:
serialized_data = AModelSerializer(instance, data=adata_dict)
if serialized_data.is_valid():
serialized_data.save(an_arg="value")
class Amodel(models.Model)
def save(*args, **kwar
Hello,
The project I'm working on has it's custom template context_processor.
And when unavailable URL request arrives to Django (Eg. "/wp-login.php"),
the context_processor is throwing AttributeError.
Which way should I use to prevent from context processor from throwing
errors?
Is it ok to w
Thank you for your suggestion. And sorry fro delayed answer.
My hunch is saying same thing but I want to be sure about it.
Kind Regards,
Sencer Hamarat
3 Mart 2020 Salı 12:24:34 UTC+3 tarihinde Naveen Arora yazdı:
>
> Hi,
>
> Can't the error be resolved ? Still, if error has
I need to filter data by it's value length of a field.
I can do it in a for loop, but I'm curious about if the Length method can
be applicable to any type of field besides CharField
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscrib
I thought select_related works for only FK/M2M and prefetch_related works
for only reverse relations, doesn't it?
Saygılarımla,
Sencer HAMARAT
On Fri, May 29, 2020 at 7:32 AM אורי wrote:
> Hi Soumen,
>
> Sometimes prefetch_related is much faster and more efficient than
&g
ygılarımla,
Sencer HAMARAT
On Fri, May 29, 2020 at 7:11 AM אורי wrote:
> Django users,
>
> There was a discussion in Stack Overflow related to an answer of mine -
> how to access settings from templates in Django [
> https://stackoverflow.com/a/53953578/1412564]. And I wou
I believe, the method "get_query*set*" name is explains what you want to
know.
If you filter or fetch every thing with django query, it returns queryset.
The .get() query on the other hand, returns a single object.
Saygılarımla,
Sencer HAMARAT
On Fri, May 29, 2020 at 4:43 AM dja
tion.message
notification.date
{% endfor %}
Saygılarımla,
Sencer HAMARAT
On Fri, May 29, 2020 at 1:59 PM meera gangani
wrote:
> i want to fetch last 3 records for notification!!
> But I only fetch last 1 record.
>
> Can you please help me out!!!
> Can i use filters??
>
> A
"local()" method
call.
You have to check data types where the "+" operator used.
And also according to the error itself, the one of that value is not a
string.
I think the "ModelBase" model has no '__str__'.
Saygılarımla,
Sencer HAMARAT
On Wed, Jul 1, 2020
Would you please checkout this StackOverflow link:
https://stackoverflow.com/questions/68160839/python-zeep-xml-factory-exception-with-no-namespace-defined-for-the-prefix
Regards,
Sencer HAMARAT
--
You received this message because you are subscribed to the Google Groups
"Django users&q
Using django pglock
I want to check if lock is acquired by another process
How can I do 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
't
acquire the lock.
Please mind the lock id is the same for all processes.
Regards,
Sencer HAMARAT
On Wed, Sep 22, 2021 at 4:59 PM Sencer Hamarat
wrote:
> Using django pglock
> I want to check if lock is acquired by another process
> How can I do it?
>
>
>
--
You rece
Thanks for reply,
Afterwards, I figured out it was like in your comment.
Solution:
lock_id = "non_unique_lock"
with advisory_lock(lock_id, wait=False) as acquired:
if acquired:
# things to do
else:
raise Exception() # or whatever you want.
Regards,
Senc
can I achieve this?
Regards,
Sencer HAMARAT
--
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 di
unique_key_object =
simpleformmodel.objects.filter(id=unique_key).last()
You can get only one object like as querying with .get(), but lack of
object is return None instead throwing exception.
BTW, you don't need to use .all() if you have to use .filter() or other
query methods.
Regards,
Sencer HAMARAT
Check request.user.is_superuser. If it return True, the role of the user
signed in is Admin.
Saygılarımla,
Sencer HAMARAT
On Fri, Nov 29, 2019 at 3:41 PM Fruity Code wrote:
> I have an updated user model and added two fields to it, mobile_number and
> role. The field role has two o
Your timedelta import is correct but usage of the timedelta is not.
Replace "datetime.timedelta(days=1)" with "timedelta(days=1)"
Saygılarımla,
Sencer HAMARAT
On Mon, Dec 9, 2019 at 11:24 AM Bruckner de Villiers
wrote:
> Running Django 3.0 & Python 3.7.3
&
Would you please replace url name with 'polls:detail', as described at
https://docs.djangoproject.com/en/3.0/topics/http/urls/#id5
Saygılarımla,
Sencer HAMARAT
On Tue, Dec 10, 2019 at 1:58 PM Bruckner de Villiers <
bruckner.devilli...@gmail.com> wrote:
> Running Django
o ISP.
Saygılarımla,
Sencer HAMARAT
On Wed, Dec 11, 2019 at 8:52 AM Rupam Hazra wrote:
>
> Exception happened during processing of request from ('47.11.53.147',
> 47572)
> Traceback (most recent call last):
> File "/usr/local/lib/python3.7/socketserver.py"
Hi,
That could be a behavior of a template tag or a "for" block in the template.
You may consider to use ".select_related" and ".prefetch_related" in view.
Saygılarımla,
Sencer HAMARAT
On Fri, Dec 27, 2019 at 4:59 AM Raja Sekar Sambath
wrote:
> Hi,
>
IMO this should be done in view if it's just for display purposes in
rendered page.
Although, the best method is doing it in a template tag.
Regards,
Sencer HAMARAT
On Tue, Jan 21, 2020 at 3:30 PM Mario Bisiani
wrote:
> Good morning,
>
> first post here!
>
> I have a que
48 matches
Mail list logo