Re: Managing links on static files from a static file

2019-10-13 Thread Михаил Брунман
сб, 12 окт. 2019 г. в 14:42, Михаил Брунман : > I've found the solution (if anyone ever will be in need). > There are 2 situations: > 1. Development. > For development this problem can be solved using static function. > Import it in your app's urls.py: > from django.conf.

Re: Managing links on static files from a static file

2019-10-12 Thread Михаил Брунман
019 г., 21:57:31 UTC+3 пользователь Михаил Брунман написал: > > Good daytime. > I've spent some time trying to find a solution to my problem, but I still > can't. > Here is my problem. > One of my html templates has a link on a javascript file, looking similar > to this:

Managing links on static files from a static file

2019-09-08 Thread Михаил Брунман
Good daytime. I've spent some time trying to find a solution to my problem, but I still can't. Here is my problem. One of my html templates has a link on a javascript file, looking similar to this: The page is returned, when asking the next url: http://127.0.0.1:8000/app_name/page_name/ The

Re: import error: no module named viewflow.frontend

2017-02-24 Thread Михаил Подгурский
It looks that you are using an outdated version of the viewflow. viewflow.frontend was added to the open-source version since 0.12+ Please consider upgrade to the latest 0.12.2 You can check out the viewflow cookbook helloword sample, and get it running with few commands.

Not working query_set.query.group_by = [..] in v1.8

2015-09-24 Thread Михаил Митрофанов
I am upgrade from Django v 1.6 to v1.8. I use this code: query_set = Rubrica.objects.filter(...).annotate(count=Count('..')).order_by ('user', '-pub_date') query_set.query.group_by = ['user_id'] On Django version 1.6 this is works fine, but on version 1.8 results is not grouped by user_id

Not working query_set.query.group_by = [..] in v1.8

2015-09-24 Thread Михаил Митрофанов
I am upgrade from Django v 1.6 to v1.8. I use this code: query_set = Rubrica.objects.filter(...).annotate(count=Count('..')).order_by ('user', '-pub_date') query_set.query.group_by = ['user_id'] On Django version 1.6 this is works fine, but on version 1.8 results is not grouped by user_id

Re: Question about customizing Django's session backend.

2014-01-20 Thread Начаров Михаил
Hi Chen. There are several session backends in django: database, cached, file-based. You can read about them on this page . But I didn't see obstacles for using default django configuration. You can use django models for django

Re: ImproperlyConfigured: Error loading psycopg2 module: No module named _psycopg

2014-01-17 Thread Начаров Михаил
: On Fri, Jan 17, 2014 at 1:52 AM, Начаров Михаил <michael.nacha...@gmail.com <mailto:michael.nacha...@gmail.com>> wrote: Hi Timothy, Note that your mod_wsgi module compiled for using python2.7. So what you need now is install(compile) mod_wsgi for python3 instead of the

Re: ImproperlyConfigured: Error loading psycopg2 module: No module named _psycopg

2014-01-16 Thread Начаров Михаил
Hi Timothy, Note that your mod_wsgi module compiled for using python2.7. So what you need now is install(compile) mod_wsgi for python3 instead of the same module compiled for python2.7. On Debian you can do it by this command: $ sudo apt-get install libapache2-mod-wsgi-py3 16.01.2014

Pycharm professtional can't create django project in linux mint 16

2013-12-30 Thread Михаил Доронин
Here is my 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,

Re: Filtering by month doesn't work

2013-11-25 Thread Начаров Михаил
Hi Tranta. In my projects this functionality works fine. What version of django did you used? Do you sure that field end in Event table contains November dates? Also, you can use *today.month* instead of *int(today.strftime('%m')*) and* today.year *instead of *int(today.strftime('%Y')).* And

Min requirements for running django?

2012-05-06 Thread Начаров Михаил
o-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Всего доброго! Начаров Михаил -- You received this messag

Re: Sampling of the two models by matching fields.

2011-09-29 Thread Михаил
:dance: On 29 сен, 13:56, Satan Study Django wrote: > Anybody? > > On 27 сен, 18:53, Satan Study Django > > > > > > > > wrote: > > Good day. > > To the case. > > There are some models (simplified

Re: Anything like RoR's render :partial?

2009-11-15 Thread Михаил Лукин
There is also "with" tag, it may be useful for such thing 2009/11/15 apramanik > Awesome! Thanks for the clarification. > > Abhik > > On Nov 15, 10:48 am, Dennis Kaarsemaker > wrote: > > On zo, 2009-11-15 at 10:08 -0800, apramanik wrote: > > > > > Sure

Re: Triggen after insert on auth_user, crash the add new user with this error: InternalError at /operators/ current transaction is aborted, commands ignored until end of transaction block

2009-11-11 Thread Михаил Лукин
Why don't you use Django signals [1] for this? [1] http://docs.djangoproject.com/en/dev/topics/signals/ 2009/11/11 NMarcu > > Hello all, > > I have a section for adding new user, on auth_user table (default > django auth method), and work just fine. I added a trigger

Re: annotation with filter issue (left join needed)

2009-11-10 Thread Михаил Лукин
It seems that you're right :( raw SQL takes away most of benefits of ORM 2009/11/10 akaariai <akaar...@gmail.com> > > > > On Nov 10, 8:29 am, Михаил Лукин <mihail.lu...@googlemail.com> wrote: > > Well, I didn't find solution yet. Except that filter condition must be

Re: annotation with filter issue (left join needed)

2009-11-09 Thread Михаил Лукин
suggestions? 2009/11/6 Михаил Лукин <mihail.lu...@googlemail.com> > Hi Djangoers > > There is two models: task and report on this task. > > class Task(models.Model): > # some task fields here > > class Report(models.Model): > task = model

Re: render_to_response taking 50 seconds!

2009-11-03 Thread Михаил Лукин
I strongly suggest you to use pagination here. 2009/11/3 Low Kian Seong > > I have about 3k plus record in my db table and am trying to do a > simple render_to_response of a template sending it the results of a > query. I debugged this and found that the total time taken

Re: Apache2+mod_wsgi autoreload?

2009-10-21 Thread Михаил Лукин
Thanks a lot, it works perfect :) 2009/10/21 Graham Dumpleton <graham.dumple...@gmail.com> > > > > On Oct 21, 5:07 pm, Graham Dumpleton <graham.dumple...@gmail.com> > wrote: > > On Oct 21, 4:00 pm, Михаил Лукин <mihail.lu...@googlemail.com> wrote: > >

Apache2+mod_wsgi autoreload?

2009-10-20 Thread Михаил Лукин
./manage runserver is OK for debugging purposes... unless you use server-specific features, in my case - NTLM authentication. When deploying Django project with Apache2+mod_wsgi, I need to `rcapache2 reload` to apply changes in Python modules (while `manage runserver` does this automaticaly). This

Re: DRY (or how can I stop repeating myself)

2009-10-20 Thread Михаил Лукин
Actually, I told about server-side form processing, not client-side. When client posts data, I always check permissions in a VIEW that receives it. 2009/10/20 Mike Ramirez <gufym...@gmail.com> > On Tuesday 20 October 2009 11:47:51 Михаил Лукин wrote: > > > Next, we don't want

Re: DRY (or how can I stop repeating myself)

2009-10-20 Thread Михаил Лукин
Good idea, thanks Javier. 2009/10/20 Javier Guerra <jav...@guerrag.com> > > On Tue, Oct 20, 2009 at 1:47 PM, Михаил Лукин > <mihail.lu...@googlemail.com> wrote: > > What is your best practice in such situations? > > write a custom tag > > --

DRY (or how can I stop repeating myself)

2009-10-20 Thread Михаил Лукин
There is a couple of models in auth application to check user permissions in Django. But sometimes we need to grant permissions per instance, not per model. Example: *class Employee(django.contrib.auth.models.User): pass class Task(models.Model): summary = models.CharField(max_length=50)

Re: "...where field is NULL" in Django ORM

2009-10-20 Thread Михаил Лукин
As I said in my first post, I understand that all three ways are correct. I just wanted to know "the best", which means that it should always give the same results and should not be deprecated in the future. If I understand you correctly, "=None" is most recent implementation of "is null" and (for

Re: "...where field is NULL" in Django ORM

2009-10-20 Thread Михаил Лукин
For some reason, __exact and __isnull are described in documentation [1], while =None is not. So which of them are historical? [1] http://docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries 2009/10/20 Russell Keith-Magee > > These three queries are all

Re: ManyToMany lookups

2009-10-20 Thread Михаил Лукин
As I know, each category has attribute product_set 2009/10/20 ausi1972 > > I am trying to work out how to construct a queryset that contains > multiple records for a ManyToMany field. > > The models are like this: > class products(models.Model) >name =

"...where field is NULL" in Django ORM

2009-10-20 Thread Михаил Лукин
There is three ways to select NULL records from table with Django ORM: 1. Model.objects.filter(field=None) 2. Model.objects.filter(field__exact=None) 3. Model.objects.filter(field__isnull=True) They all seem to work. Which is the best way and why? -- regards, Mihail

Re: Join .Net Community

2009-10-20 Thread Михаил Лукин
burn in hell 2009/10/20 Shawon_ > > Join .Net Community > > This group represents the Microsoft .Net community. All .net > programmers all around the world are welcome here. In this group > you'll find the latest releases of .Net related products, frameworks, > Upgradation,

Re: Best way to generate a local file from a models + views ?

2009-10-19 Thread Михаил Лукин
For purpose of generating apache config files I would recommend to use management commands [1], so that you could generate config like this: ./manage genconf --server apache2 > /etc/apache2/vhosts.d/myapp.conf where genconf is your custom management command. [1]

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-19 Thread Михаил Лукин
/10/19 tezro <tezro...@gmail.com> > > Surely I could use the list_detail.object_list, but the use of date > based generics though )) > > > On Oct 18, 11:45 pm, Михаил Лукин <mihail.lu...@googlemail.com> wrote: > > Sorry, didn't look at condition well...:( > &

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-18 Thread Михаил Лукин
Sorry, didn't look at condition well...:( So, you see the source and you see that there's no way to get all the records with this view. Why don't you use list_detail.object_list view? If you need just to order list by date, you can use ordering on the model level:

Re: Django production set up woes [Please Help]

2009-10-18 Thread Михаил Лукин
http://docs.djangoproject.com/en/dev/howto/deployment/ Choose your deployment method and you'll find the answer 2009/10/18 DjangoRocks <ye.eug...@gmail.com> > > hi, how do i put the project's path in my server pyhton path ? > > On Oct 19, 2:36 am, Михаил Лукин <mihail.lu...@

Re: Django production set up woes [Please Help]

2009-10-18 Thread Михаил Лукин
Seems that you didn't put your project's path in your server python path. 2009/10/18 DjangoRocks > > Hi yes, i restarted apache after uploading my files. > > Just in case, here is the error message i received: > ViewDoesNotExist at /user/eugene/ > > Could not import

Re: How to enforce uniqueness based on two model fields

2009-10-18 Thread Михаил Лукин
http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together why don't you like to read docs first. Django docs are amazing! 2009/10/18 Guillermo > > Ok I've done the following: > > def save(self): >r =

Re: Linking items from the same model

2009-10-18 Thread Михаил Лукин
Look at how list of permissions is filtered in admin interface when adding/editind user. You may use such javascript in your form for dynamic filtering. 2009/10/17 Oleg Oltar > I would really want to add some sort of filtering to that >

Unable to serialize database: User matching query does not exist.

2009-10-18 Thread Михаил Лукин
In application `tasks` there is model `Employee` which is subclass of django.contrib.auth.models.User. I can `dumpdata tasks`, but when I try to dump whole project or `auth` application, I get this: django.contrib.auth.models.DoesNotExist: User matching query does not exist. > I checked twice if

Re: Help to choose web-template

2009-10-16 Thread Михаил Лукин
t; > Or try these following sites: > > > http://www.456bereastreet.com/lab/developing_with_web_standards/csslayout/2-col/ > http://www.alistapart.com/articles/holygrail/ > http://www.webmonkey.com/codelibrary/tag/html > > Cheers > > _Mario > > On Oc

Re: Good News !! A mate found for your dog ...

2009-10-16 Thread Михаил Лукин
It's the dog. The dog is the one who uses Django. All the time. On Fri, Oct 16, 2009 at 9:18 PM, jc wrote: > > Finally. I wonder if their site uses django? > > On Fri, Oct 16, 2009 at 7:36 AM, turk970 wrote: > > > > You love your dog and your dog love’s

Help to choose web-template

2009-10-16 Thread Михаил Лукин
Not really Django question, so i'm sorry :) I'm Python programmer, not a web-designer. I wasted a whole day by reinventing the wheel. First, I made base template myself. Then I dumped HTML and CSS from some favorite sites and tried to apply them to my app. Then I googled for free web-templates

Re: Django default date formatting changes

2009-10-16 Thread Михаил Лукин
Try this http://docs.djangoproject.com/en/dev/ref/settings/#date-format On Fri, Oct 16, 2009 at 2:21 PM, vishak wrote: > > Hi Django users, > > I have one question in django for which details are given below > > 1] The default date format in django is '`2009-10-10' when

Re: displaying tree data in admin

2009-10-14 Thread Михаил Лукин
There is no sucj feature in admin interface On Wed, Oct 14, 2009 at 9:18 PM, ev wrote: > > I've created model Structure referenced to itself and filled it with > my data. > > class Structure(models.Model): >parent=models.ForeignKey('self', blank=True, null=True,

Re: How to confirm a successfull/failed database insert call to the user

2009-10-13 Thread Михаил Лукин
First of all, you don't need to check request.method == 'POST' twice; you don't need to check action here. Finally, you can use user messages to add and display confirmations: in view: http://docs.djangoproject.com/en/dev/topics/auth/#messages Put messages in base template and you can see them

Re: Apply decorator to view functions in third-party apps?

2009-10-13 Thread Михаил Лукин
no way to pass them. > > > On Oct 13, 3:10 pm, Михаил Лукин <mihail.lu...@googlemail.com> wrote: > > Seems that any solution would be dirty, so why don't you set threadlocal > > variable with request and monkey-patch template loader? > > > -- regards, Miha

Re: Apply decorator to view functions in third-party apps?

2009-10-13 Thread Михаил Лукин
Seems that any solution would be dirty, so why don't you set threadlocal variable with request and monkey-patch template loader? On Tue, Oct 13, 2009 at 11:03 PM, Nan wrote: > > > The trouble is that I've got third-party apps that have their own > views that don't include

Re: How to get ./manage.py test to stop spewing "Installing index for whatever"

2009-10-13 Thread Михаил Лукин
./manage.py help test Does changing verbosity help? On Tue, Oct 13, 2009 at 10:59 PM, Phlip wrote: > > Djangoids: > > Unit tests should run as silent as possible, so we don't get too > familiar with their spew. Ideally, any spew should raise your index of > suspicion, and a

Re: new permission

2009-10-13 Thread Михаил Лукин
Try ./manage reset auth On Tue, Oct 13, 2009 at 1:08 PM, elminio wrote: > > hi, > > It didnt help :/ > > On Oct 9, 10:33 am, "Bogdan I. Bursuc" > wrote: > > Try to delete the auth_permissions table the sync db > > see if it helps > > > > On

Re: directory name with space

2009-10-13 Thread Михаил Лукин
You're definitely right, that's why I mentioned additional tests in view function. I'm not sure about win and NTFS, but on *nix os.path.exists() will likely return False on such weird things as '\x01\x02', while whitelisting characters may lead to problems with internationalization (or we'll get a

Re: directory name with space

2009-10-13 Thread Михаил Лукин
Well, I don't know what is under scarico/(\d+)/ - single file or a directory tree. In case of directory tree ".+" seems to be the best way, which is also documented at http://docs.djangoproject.com/en/dev/howto/static-files/ In case of single file "[^/]+" instead of ".+" can be used. I think

Re: directory name with space

2009-10-13 Thread Михаил Лукин
Maybe you should try smth like this: (r'^scarico/(\d+)/(.+)/$', 'sitonorme.gestnorme.views.scarico'), On Tue, Oct 13, 2009 at 7:59 PM, luca72 wrote: > > Hello i have a small application where in the urls i have this : > > (r'^scarico/(\d+)/(\w+)/$',