It is possible to somehow fill the database data as soon as all applications will be loaded?

2016-07-26 Thread Seti Volkylany
It is possible to somehow fill the database data as soon as all applications will be loaded. I explain the problem. It is necessary that the default database was an urgent data for the entire project, in my case, tags, level of accounts and professions. To resolve this problem, I created the nec

Re: When it make sense to use a different name for a custom manager of the Django`s model?

2016-07-23 Thread Seti Volkylany
queryset (called > "objects" by Django) vs creating your own - in the example shown, it is > called "dahl_objects" (but of course should be a name that makes sense > for your app). > > On Saturday, 23 July 2016 12:32:32 UTC+2, Seti Volkylany wrote: >> >

When it make sense to use a different name for a custom manager of the Django`s model?

2016-07-23 Thread Seti Volkylany
If why know good article about it, send me link, I will resolve of itself. -- 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.

Is it possible to the ReportLab applying the Django utils function's "localtime" to an all date/datetime objects?

2016-07-22 Thread Seti Volkylany
The ReportLab does not have a support for a current timezone, as usual internal Django`s objects. -- 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+u

How reconcile date/datetime`s formats the Python and the Django?

2016-07-22 Thread Seti Volkylany
The Python has next formaters for a date/datetime objects https://docs.python.org/3.0/library/datetime.html#id1 The Django has next - https://docs.djangoproject.com/en/1.9/ref/templates/builtins/#date. As you can see it has many differences and it is a problem. Question is next. How to reconcile

Question has mediated relation to the Django.

2016-07-21 Thread Seti Volkylany
How get a total count pages in PDF file, created with using ReportLab, without third-party apps and hardcode (or violation DRY)? -- 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, s

How make testing for a generated PDF file?

2016-07-21 Thread Seti Volkylany
-- 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 post to this group, send email to django-users@googlegroups.com.

How to made import a js file with my function as pytonic method "from module_name import function_name"?

2016-07-10 Thread Seti Volkylany
After googling in the Web, I don`t found clean solution for 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 pos

Re: When need return the HttpResponseBadRequest and why?

2016-07-05 Thread Seti Volkylany
may send 400 if the > HTTP request is malformed. Applications, such as a Django app, may send 400 > if the request cannot be processed, e.g. when a required header is missing > or (with REST APIs) if a JSON field is not present or contains an invalid > value. > > Best, > Gergely

Re: How I can access to the jQuery, it is build-in Django-Admin, in my custom views?

2016-07-05 Thread Seti Volkylany
admin template? > Where are your Jquery call? in the header ? > > A template example could be useful. > > 2016-07-03 12:20 GMT-06:00 Seti Volkylany : > >> It is not worked even the main admin page >> >> django.jQuery('body') >> Uncaught Reference

Preferable JS's coding style for the Django.

2016-07-04 Thread Seti Volkylany
In the Web have many a variants for JS style coding. The Django give less detail about good JS coding (see https://docs.djangoproject.com/en/1.9/internals/contributing/writing-code/javascript/#code-style). Here is what I found: https://github.com/madrobby/pragmatic.js, https://github.com/rwaldro

When need return the HttpResponseBadRequest and why?

2016-07-04 Thread Seti Volkylany
. -- 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 post to this group, send email to django-users@googlegroups.com.

How get used AdminSite in a Django-project (custom or standart)?

2016-07-04 Thread Seti Volkylany
if I have my custom adminsite http://dpaste.com/0ZJ77EH To get used the adminsite I simple imported it. from conf.admin import ProgrammerHelperAdminSite But may exists build-in Django method, for getting used AdminSite For example Django has useful method for getting AUTH_USER_MODEL from dj

How manually, in Django 1.9, determinate all urls in a project without the django-extension`s command show_urls?

2016-07-03 Thread Seti Volkylany
I don`t found answer for Django 1.9 there http://stackoverflow.com/questions/1275486/django-how-can-i-see-a-list-of-urlpatterns and there http://stackoverflow.com/questions/1828187/determine-complete-django-url-configuration. -- You received this message because you are subscribed to the Go

Re: How I can access to the jQuery, it is build-in Django-Admin, in my custom views?

2016-07-03 Thread Seti Volkylany
ote: > Replace $ by django.jQuery > > For example django.jQuery('body') > > > > El domingo, 3 de julio de 2016, Seti Volkylany > escribió: > > > > The Django`s docs tell next: > > To avoid conflicts with user-supplied scripts or libraries, Djang

How I can access to the jQuery, it is build-in Django-Admin, in my custom views?

2016-07-03 Thread Seti Volkylany
The Django`s docs tell next: To avoid conflicts with user-supplied scripts or libraries, Django’s jQuery (version 2.1.4) is namespaced as django.jQuery. If you want to use jQuery in your own admin JavaScript without including a second copy, you can use the django.jQuery object on changelist a

Additional magic with methods of a classes

2016-07-03 Thread Seti Volkylany
Django`s methods may can only method_name.short_description, method_name.boolean and method_name.admin_order_field an attributes or exists yet? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

How generate for the Django pictures as in users of the stackoverflow.com?

2016-07-01 Thread Seti Volkylany
Examples: -- 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 post to this group, send email to django-users@googl

What is the full testing toolkit any Python/Djang/JS developer?

2016-06-29 Thread Seti Volkylany
Now, I am using: factory-boy, selenium, nose, pytest and unittests. I have a plan use in future QUnit and Continuous Integration. May be it is enough? Who using yet tools? -- You received this message because you are subscribed to the Google Groups "Django users" group. T

How by help Python generate random image with vector figures.

2016-06-28 Thread Seti Volkylany
I need a pure python module from PyPI without additional packages on my OS. -- 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

Who than uses for view RSS or Atom?

2016-06-19 Thread Seti Volkylany
Django have a good docs about create RSS or Atom. But no mentions of good solution for human-read this RSS(Atom). Give me advise for good and free choice to solve this the problem. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscrib

How is best solution for builing chars in django (in admin too)?

2016-06-19 Thread Seti Volkylany
I visit https://www.djangopackages.com/grids/g/charts/ and could not found production/stable good solution for Django project. Who has some expirience builing a real project, please be so kind give me advice. Google Charts do not offer (not offline) -- You received this message because you are

I need an expert Postgresql.

2016-06-19 Thread Seti Volkylany
I am try to conver from numberic to string a result of annotated field (created by a annotation). I am wrote my Func as next: class ToStr(Func): """ """ function = 'CAST' template = '%(function)s(%(expressions)s as TEXT)' class ToChar(Func): """ """ funct

How to proceed with the parametr "limit_choice_to"?

2016-06-19 Thread Seti Volkylany
On the one hand it is restriction choice in admin, but on the onther hand if limit_choice_to is {'is_active': True} on model Article, then user posted its article in past and all right. In case if user now is not active, he does not cease to be author of the article but in admin now is not displ

Where you use the field JSONField?

2016-06-18 Thread Seti Volkylany
Just wondering -- 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 post to this group, send email to django-users@googl

How change returned value after annotation queryset of model?

2016-06-16 Thread Seti Volkylany
If I used annotation for get rating an object, I had new field 'rating' (is number). How change values field rating through SQl for return: if rating = 0 return '0' if rating = 1 return '+1' if rating = -1 return '-1' -- You received this message because you are subscribed to the Google Groups

How to execute annotation from one model on second, for get new fied?

2016-06-15 Thread Seti Volkylany
I have two models: Book and Reply *the model Book* class Book(models.Model): """ Model for books """ # other fields replies = GenericRelation(Reply, related_query_name='books') # managers objects = models.Manager() objects = BookManager.from_queryset(BookQuer

Why not working exampe from Django docs

2016-05-18 Thread Seti Volkylany
https://docs.djangoproject.com/en/1.9/topics/http/sessions/#example from django.contrib.sessions.backends.db import SessionStore as DBStorefrom django.contrib.sessions.base_session import AbstractBaseSessionfrom django.db import models class CustomSession(AbstractBaseSession): account_id = m

How to create new field in queryset instead of usign annotation?

2016-05-15 Thread Seti Volkylany
Next code not working right def get_queryset(self, request): qs = super(QuestionAdmin, self).get_queryset(request) qs = qs.annotate( count_answers=models.Count('answers', distinct=True), count_tags=models.Count('tags', distinct=True), count_o

Re: How made worked models.Sum() together with models.Count in Django annotations?

2016-05-15 Thread Seti Volkylany
gt; > As documented this will yield the wrong results in most cases until > subqueries > are used instead of JOINs[1]. > > Cheers, > Simon > > [1] > https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#combining-multiple-aggregations > > Le dimanche 15 mai 2016

How made worked models.Sum() together with models.Count in Django annotations?

2016-05-15 Thread Seti Volkylany
For working models.Count() I am using distinct=True. It is right worked if not models.Sum(). next code right worked. def get_queryset(self, request): qs = super(AnswerAdmin, self).get_queryset(request) qs = qs.annotate( count_likes=models.Count('likes', distinct=Tr

Re: Why server Heroky add random symbols between filename and his extension?

2016-05-13 Thread Seti Volkylany
I solved problem when removed STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' from my deployment settings. воскресенье, 8 мая 2016 г., 14:32:43 UTC+3 пользователь Seti Volkylany написал: > > > > Website here https://personal-dicts.herokuapp.co

Why server Heroky add random symbols between filename and his extension?

2016-05-08 Thread Seti Volkylany
Website here https://personal-dicts.herokuapp.com . Not working static. -- You received this message because you a

How in Django, made count objects in through model by condition, for using in the admin as sortable field?

2016-04-30 Thread Seti Volkylany
I need will create two sortable fields in Django admin by values in Though-Model. - My models.py from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.db import models from dj

Re: What is completed listing all formaters (fakers, providers) in FactoryBoy?

2016-04-30 Thread Seti Volkylany
ntation. What exactly do > you want to achieve? Are you sure it’s FactoryBoy you are looking for? > > > > Gergely Polonkai > [image: https://]about.me/gergely.polonkai > > <https://about.me/gergely.polonkai?promo=email_sig&utm_source=email_sig&utm_medium=email_

What is completed listing all formaters (fakers, providers) in FactoryBoy?

2016-04-30 Thread Seti Volkylany
I mean the factory.Faker('*name*', locale='en'), and I found slug, name, first_name, last_name, time, date, url, but I am don`t found all list in Web and factoryboy`s documentation. May anyone known? Thanks. -- You received this message because you are subscribed to the Google Groups "Djan

How, in django, using mock for mocking Image file and non-image file with creating real files?

2016-04-10 Thread Seti Volkylany
I do not want to pollute the system temporary files for testing, maybe someone knows how to create a mock object for testing field ImageField -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emai

Why I can not run my test, namely my custom apps with django-nose?

2016-04-07 Thread Seti Volkylany
*Project structure:* apps ├── app_accounts │ ├── admin.py │ ├── apps.py │ ├── backends.py │ ├── forms.py │ ├── __init__.py │ ├── managers.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20160407_0938.py │ │ ├── __init__.py │ │ └── __pycache__ │ │

How delete """ from HTML?

2016-03-27 Thread Seti Volkylany
How delete """ from my text in html element for code with pysegments (style monokai) class UpdateAccountInfo(LoginRequiredMixin, View): """ View for update information about account of user """ def post(self, request, *args, **kwargs): if request.is_ajax():

How displaying text as code?

2016-03-25 Thread Seti Volkylany
I had text in database on TextField. I am using this field in my template applying tag *linebreaksbr* but text displaying simple plain. In console I have next result: Out[60]: 'class UpdateAccountInfo(LoginRequiredMixin, View):\n"""\n View for update information about account of user\n

Right displaying Pie chart in Django with help django-chartjs

2016-03-23 Thread Seti Volkylany
Details of question here http://stackoverflow.com/questions/36179624/right-displaying-pie-chart-in-django-with-help-django-chartjs -- 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 i

Re: How force DJANGo choice MEDIA_URL or STATIC_URL in template?

2016-03-01 Thread Seti Volkylany
it does not help, because I am image by default class AccountUserInfo(models.Model): MAN = 'man' WOMAN = 'woman' VAGUE = 'vague' GENDER_CHOICES = [ (VAGUE, 'Vague'), (MAN, 'Male'), (WOMAN, 'Female'), ] def dispatch_account_media_files(instance, f

Re: Invoke not right worked

2016-02-22 Thread Seti Volkylany
Almost all worked http://eugenelysenko.pythonanywhere.com/ Thank you very much On Sun, Feb 21, 2016 at 10:55 PM, James Schneider wrote: > On Sun, Feb 21, 2016 at 12:25 PM, wrote: > >> >> *my file with invoke-task (tasks.py)* >> . >> from