Re: Setting up jQuery in debian with virtualenv

2016-11-09 Thread Javier Guerra Giraldez
On 9 November 2016 at 13:54, Gary Roach wrote: > I want to know how to use the pip installed version of the jquery file if > possible. you can check what the admin templates do. probably something like {% url "admin/js/vendor/jquery/jquery.min.js" %} -- Javier --

Re: Negative User ID's

2016-11-06 Thread Javier Guerra Giraldez
On 4 November 2016 at 18:28, wrote: > > Unfortunately, the apps are currently in different DB's. > > On Friday, November 4, 2016 at 10:26:34 AM UTC-7, Javier Guerra wrote: >> >> that's what foreign keys are for even so, a foreign key field is the answer. i see three

Re: Negative User ID's

2016-11-04 Thread Javier Guerra Giraldez
On 4 November 2016 at 17:17, wrote: > To support future integration, I need to ID's to be common across the two > apps. that's what foreign keys are for -- Javier -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Compressing images before saving to database

2016-09-16 Thread Javier Guerra Giraldez
On 16 September 2016 at 05:45, Isaac Tetteh wrote: > I have a project where users upload photos of any type. But i want to > compress the images before saving them. Is pillow the best i can use or Is > there a built in or 3rd party library to do this. Its link to

Re: Disadvantages of using model name rather than model class for FK field?

2016-09-01 Thread Javier Guerra Giraldez
On 1 September 2016 at 11:55, James Beith wrote: > By using a model name there are fewer imports at the top of the module and > fewer occurrences of circular import dependencies between Django > applications. What are the disadvantages to using a model name and why not > always

Re: Best way to keep the current selection

2016-07-27 Thread Javier Guerra Giraldez
On 27 July 2016 at 02:02, Lee Hinde wrote: > To maintain state, after any ad-hoc query, I store the ids for the found > records: > > self.request.session['query.classes.last_ids'] = > list(queryset.values_list('id', flat=True)) add a new model: Previous_Searchs or something

Re: deploy django with nginx

2016-07-15 Thread Javier Guerra Giraldez
On 15 July 2016 at 11:47, 1351552...@qq.com <1351552...@qq.com> wrote: > and with the message in file /var/log/nginx/error.log : > connect() to unix:///home/wangwei/yaohang/yaohang.sock failed (13: > Permission denied check under what user is running nginx, and make sure that it has r/w

Re: Document storage and data mining

2016-07-15 Thread Javier Guerra Giraldez
On 15 July 2016 at 00:02, Gary Roach wrote: > While - with the exception of the metafile - these are static files, we are > talking about hundreds of documents. I do not think that storing them as > static files will work. They have to be searchable. I assume that I

Re: resetting table id (SOLVED)

2016-07-04 Thread Javier Guerra Giraldez
On 4 July 2016 at 01:09, Gary Roach wrote: > All of this drove home the fact that db.sqlite3 is no more than a text file > and can be thrown away and recreated any time I like wrong. SQLite keeps the database on a single file, but its nowhere near a "text file". you

Re: Making queries with custom SQL

2016-06-16 Thread Javier Guerra Giraldez
On 16 June 2016 at 16:21, TheBeardedTemplar wrote: > I'm using postgreSQL and have found that recursive queries are exactly what > I need In most cases it's much better to use a more efficient form of tree. A common one is called MPTT, for which there are Django

Re: sub accounts in django

2016-05-19 Thread Javier Guerra Giraldez
On 18 May 2016 at 17:02, Mehdy M. Haghy wrote: > Creating sub accounts is a pretty common scenario. > you have clients like (copmany1, company2, ..., company N) > and they have their own users, roles and permissions. > any recommendation on how to implement this or any package

Re: MTV and MVC difference

2016-04-19 Thread Javier Guerra Giraldez
On 19 April 2016 at 12:53, Mukul Chakravarty wrote: > What is the difference between Models in django MTV architecture and Models > in rails MVC architecture ? IMNSHO, mostly about the realization that "controller" (as defined in the original, GUI-oriented formulation of

Re: Question about users system

2016-04-15 Thread Javier Guerra Giraldez
On 15 April 2016 at 12:17, Eduardo Leones wrote: > I am developing a system in which my clients are companies. Every company > needs to have its isolated from other business data. google for "multi-tenant" web applications. warning: there are quite strong opinions

Re: Debugging DJango app on production for High CPU Usage

2016-02-24 Thread Javier Guerra Giraldez
On 24 February 2016 at 13:18, Avraham Serour wrote: >> sometimes going beyond 100% > > how?? if it's what top reports, 100% refers to a whole core. a multiforking server (like uWSGI) can easily go well beyond that. and that's not a bad thing -- Javier -- You received

Re: Why does Django allow Circular Model Relation

2016-02-19 Thread Javier Guerra Giraldez
On 19 February 2016 at 13:00, Eddilbert Macharia wrote: > Hello All, > > I was working on a project, and realized that Django does not complain when > you create Circular Model relationship even when creating migrations where i > expected to have this complain why would it

Re: Django deployment

2015-09-18 Thread Javier Guerra Giraldez
On Fri, Sep 18, 2015 at 4:51 PM, monoBOT wrote: > The guide Mario Gudelj shared is probably the best you can find on internet. (the best if you like gunicorn) -- Javier -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Prefetch() with through models

2015-09-17 Thread Javier Guerra Giraldez
On Thu, Sep 17, 2015 at 2:07 AM, Erik Cederstrand wrote: >> Den 16/09/2015 kl. 16.45 skrev Mike Dewhirst : >> >> On 16/09/2015 9:53 AM, Erik Cederstrand wrote: >>> issues because the prefetch query does something along the lines of >>> "SELECT ...

Re: Angular.js advanced tutorials?

2015-09-11 Thread Javier Guerra Giraldez
On Fri, Sep 11, 2015 at 5:03 PM, ThomasTheDjangoFan wrote: > I am searching for an angular.js tutorial that shows me how to do some > enhanced ui stuff: i think both angular and react are oriented primarily not to "enhanced ui", but to whole frontend

Re: What frontend-tools to use for a new CRM project? Shall I use Django OR switch to Meteor.js?

2015-09-09 Thread Javier Guerra Giraldez
On Wed, Sep 9, 2015 at 9:32 AM, 'Tom Evans' via Django users wrote: > We have (different!) django projects using react, backbone and > angular. and lots more! i've found riot.js a very refreshing foundation for those of us that hate JS. -- Javier -- You

Re: Serving uploaded files from multiple storages

2015-08-11 Thread Javier Guerra Giraldez
On Tue, Aug 11, 2015 at 6:17 PM, 'Hugo Osvaldo Barrera' via Django users wrote: > I've an app where files are uploaded to differente storages: i would create a new storage object with a configuration that associates some prefix with other 'backend' storage

Re: Invalid syntax in url.py

2015-08-06 Thread Javier Guerra Giraldez
On Thu, Aug 6, 2015 at 2:03 PM, Matthew Yankey wrote: > url(r'^', .newsletter.views.home, name="home") .newsletter looks like import syntax, but this isn't valid in an expression at the top include a line like from .newsletter.views import home and then the url

Re: how to descript the many to one relationship in model when there are more than 1 tables

2015-08-06 Thread Javier Guerra Giraldez
On Thu, Aug 6, 2015 at 8:18 AM, Holland_zwz wrote: > But i am not got the main point. The problem is the table C's oid column > data comes from A or B. I don't think SQL works that way. at least, it's very much against any normalization guideline. -- Javier -- You

Re: Using django as a socket server and not HTTP server

2015-08-05 Thread Javier Guerra Giraldez
On Wed, Aug 5, 2015 at 10:14 AM, Idan Shimon wrote: > Hi i am interested to setup my own socket protocol against a peripheral > device > The socket server would be online and exposed to the web, however it will > not work on http. not as it is currently. the issue is that

Re: same field in two classes

2015-08-03 Thread Javier Guerra Giraldez
On Sun, Aug 2, 2015 at 5:54 PM, Robin Lery wrote: > You can use inheritance. Or content type. Or use signals to get the value of > salary from one model and save it to another model. or choose the right place to store it and don't duplicate information. -- Javier --

Re: DB Design question

2015-08-01 Thread Javier Guerra Giraldez
On Sat, Aug 1, 2015 at 4:53 AM, James Schneider wrote: > If you are talking about potentially having enough rows to extend past the > AutoPK limits, you should consider instead using a UUID field as the PK: note that this is only good advice if your DB handles it

Re: One-time tasks at varying times with Uwsgi Spooler

2015-07-31 Thread Javier Guerra Giraldez
On Fri, Jul 31, 2015 at 7:26 PM, thinkwell wrote: > a_long_task.spool({'hello':'world', 'at':timedelta(hours=5)) the 'at' parameter should be _outside_ the callable dictionay, and it must be the unix timestamp, not a timedelta:

Re: How to save data from form FileField to DB Django

2015-07-30 Thread Javier Guerra Giraldez
On Thu, Jul 30, 2015 at 10:40 AM, user07285 wrote: > I have a model and have added a Form FileField to take a file and save all > their contents for a particular object. The FileField doesn't need to be in > the database hence not added as a model.fileField. The content from

Re: Testing related models without saving

2015-07-16 Thread Javier Guerra Giraldez
On Thu, Jul 16, 2015 at 8:18 AM, Roland Swingler wrote: > I understand that the test db uses a different schema (it's the same in > rails), the point is to be able to run tests isolated from having a database > at all. there are several testing styles, each one with

Re: Django formset hidden id field

2015-07-04 Thread Javier Guerra Giraldez
On Sat, Jul 4, 2015 at 1:42 AM, Peter of the Norse wrote: > You can’t have it both ways. Either exposing the PK is a security flaw or it > isn’t. It’s just as easy for nefarious n’er-do-wells to edit the form’s URL > as a hidden field. In either case, if you are using

Re: Help me develop a Job Tracker (?)

2015-07-03 Thread Javier Guerra Giraldez
On Fri, Jul 3, 2015 at 2:50 AM, Softeisbieger wrote: > Thanks for your input! Indeed, a linear pipeline should be sufficient. What > do you think of my idea of organizing this in two database tables? One table > models a work flow. A work flow points to the currently active

Re: Help me develop a Job Tracker (?)

2015-07-02 Thread Javier Guerra Giraldez
On Thu, Jul 2, 2015 at 10:26 AM, Softeisbieger wrote: > I am currently thinking about the database representation. I don't think I > can solve this with django-viewflow: I need to be able to specify in advance > a deadline and an assignee for each task of a work flow. first

Re: How To Activate Django Server.

2015-06-26 Thread Javier Guerra Giraldez
On Fri, Jun 26, 2015 at 4:56 PM, Steve Burrus wrote: > I AM able to create a new virtual env. but I gfet this error message when I > try to create a new project! have you installed django in this virtualenv? -- Javier -- You received this message because you are

Re: help with e-library

2015-06-26 Thread Javier Guerra Giraldez
On Fri, Jun 26, 2015 at 6:55 AM, Mane Said wrote: > where is the best place to start definitely, the Django tutorial. your project sounds like a very straightforward database application. after finishing the tutorial you might easily model your concepts, or you can always ask

Re: Help me develop a Job Tracker (?)

2015-06-26 Thread Javier Guerra Giraldez
On Fri, Jun 26, 2015 at 3:01 AM, Softeisbieger wrote: > I am uncertain how to handle different work flows, though. The user should > be able to define these 'on the fly' and I have no idea how to express this > in terms of django. What I know about a workflow: there's a thing

Re: Scaling/Parallel patterns for a View executing complex database transaction

2015-06-14 Thread Javier Guerra Giraldez
On Sun, Jun 14, 2015 at 3:13 PM, Peter of the Norse wrote: > Almost all of them are faster at key/value returns than PostgreSQL. i seriously doubt that. most "fast" key-value databases are only fast if you either: keep all data in RAM, forget about durability, or

Re: "&" string to template adds "" in the html

2015-05-22 Thread Javier Guerra Giraldez
On Fri, May 22, 2015 at 1:11 PM, dk wrote: > I fixed doing this > > {% autoescape off %} > {{ my_var_with_& }} > {% endautoescape%} the "right" way is: {{ my_var_with_anything|safe }} -- Javier -- You received this message because you are subscribed to the Google

Re: Logout user on tab closing

2015-05-19 Thread Javier Guerra Giraldez
On Tue, May 19, 2015 at 8:23 AM, Miloš Milovanović wrote: > I want to logout a user from application when the application tab is closed. the browser doesn't notify the server when the tab (or window) is closed. remember that the original web architecture was simply

Re: Embeding HSQLDB in a standalone App

2015-05-19 Thread Javier Guerra Giraldez
On Tue, May 19, 2015 at 6:49 AM, Kapil Solanki wrote: > I need to embed hsqldb in my project. I have been looking for solution > online but couldnt find a proper one. AFAICT, hsqldb is a Java library, you need a Java program to call it. Maybe it's possible to call the

Re: Multiple databases

2015-05-18 Thread Javier Guerra Giraldez
On Mon, May 18, 2015 at 7:35 PM, Roger Dunn wrote: > The use case is that the normalized data will be fetched often, is very > tabular in nature, and the additional data is more document centric and will > be fetch less often, by quite a margin. have you considered

Re: The best way to mock querysets

2015-05-01 Thread Javier Guerra Giraldez
On Fri, May 1, 2015 at 5:17 AM, Avraham Serour wrote: > In my opinion you shouldn't, you should set the test data and make a real > query then compare results, you shouldn't care how the function got the > data, but that it got it correctly. that's part of a much bigger

Re: Django runserver needs restart on psql data changes

2015-04-29 Thread Javier Guerra Giraldez
On Wed, Apr 29, 2015 at 12:35 PM, Arnab Banerji wrote: > The rendering happens perfectly, but the problem is - when the client user > does a browser refresh, the new data does not get reloaded until I restart > the runserver. Is there something I am doing wrong with respect to

Re: Migrations During Development

2015-04-25 Thread Javier Guerra Giraldez
On Sat, Apr 25, 2015 at 12:28 PM, Timothy W. Cook <t...@mlhim.org> wrote: > On Sat, Apr 25, 2015 at 2:15 PM, Javier Guerra Giraldez <jav...@guerrag.com> > wrote: >> if you don't store migrations, then you have to generate them on each >> production update, righ

Re: Migrations During Development

2015-04-25 Thread Javier Guerra Giraldez
On Sat, Apr 25, 2015 at 12:08 PM, Timothy W. Cook wrote: > > On Sat, Apr 25, 2015 at 9:48 AM, Jorge Andrés Vergara Ebratt > wrote: >> >> Are you using version control like GIT? I save the migration folder with the >> __init__.py in GIT, nothing else,

Re: Concept of partial views to be resolved from other views or template tags

2015-04-25 Thread Javier Guerra Giraldez
On Sat, Apr 25, 2015 at 3:11 AM, Stephan Herzog wrote: > I like that approach because it leads to any partial being a separated piece > of logic that can be tested and developed on a dedicated url. If necessary > it can be wrapped in a templatetag, which makes it easy to use

Re: Model with two e-mail fields uniques

2015-04-08 Thread Javier Guerra Giraldez
On Wed, Apr 8, 2015 at 12:18 PM, Luis Zárate wrote: > > if you know that only have two emails for user and you check his email a lot > then the cost of join in time and machine resources increase innecessarily "normalize until it hurts, denormalize until it runs" here the

Re: Model with two e-mail fields uniques

2015-04-07 Thread Javier Guerra Giraldez
On Tue, Apr 7, 2015 at 2:20 PM, victor menezes wrote: > What would be the best way to make a model with two e-mail fields uniques? I > was thinking about writing some validation in the save() method but would > like to know whether Django has some built-in way to deal

Re: newbie question

2015-03-19 Thread Javier Guerra Giraldez
On Wed, Mar 18, 2015 at 9:41 PM, VMD wrote: > I have skimmed the tutorial and didn't find (notice) the answer. Why not > point me to an answer to my question? that's exactly the point. your question assumes Django works in some specific way, and there should be a

Re: Future for Django, Jobs, Confused :/

2015-03-04 Thread Javier Guerra Giraldez
On Wed, Mar 4, 2015 at 5:40 PM, François Schiettecatte wrote: > commit to learning a new one every couple of years (or more often if you can). this. even if I write Python as a requisite when hiring, I expect any new recruit to be able to pick languages as needed. Of

Re: Django sometimes shows partial (incomplete) json data in production env

2015-02-24 Thread Javier Guerra Giraldez
On Mon, Feb 23, 2015 at 11:54 PM, George Mejia wrote: > > Besides, this only happens on production env ... The code is fine and works > on production env, and the behaviour was normal before ... this also happens > for others queries (all only in production), I wonder what

Re: Using class based views.

2015-02-24 Thread Javier Guerra Giraldez
On Tue, Feb 24, 2015 at 1:51 AM, James Schneider wrote: > However, if you have working view functions, what is the"need" to switch to > CBV's? this. the switch to CBV, wasn't "modern Django views are classes instead of functions; Get rid of your functions!, FBV are

Re: Restrict downloading files in Django?

2015-01-31 Thread Javier Guerra Giraldez
On Sat, Jan 31, 2015 at 11:52 AM, Robert Rössler wrote: > what is the best way to restrict downloading files only to authorized users? it's not hard to do if you manage the file downloading with a view. of course, file serving within Django is very inefficient, your

Re: Model to create forms

2015-01-08 Thread Javier Guerra Giraldez
On Thu, Jan 8, 2015 at 1:03 PM, Collin Anderson wrote: > 2) Also keeping all the experiments data in only one table and getting all > the information for one experiment by finding all the row with the same uid > looks a little bit a time consuming process but for now we used

Re: Two Django projects with common models and business logic

2014-12-24 Thread Javier Guerra Giraldez
On Wed, Dec 24, 2014 at 11:18 AM, andy wrote: > Thank you. Since it's only me that'd be using the apps do can I bypass the > 'deploy using pip' thing and somehow directly use it in my other projects? you could just set links or add to your `sys.path` list, but that makes it

Re: Two Django projects with common models and business logic

2014-12-23 Thread Javier Guerra Giraldez
On Tue, Dec 23, 2014 at 1:22 PM, andy wrote: > Now, both the projects have some models and some business logic common > between them. I don't want to duplicate the code and data which shall be > chaotic going forward. Also, I want the models and code (business logic) to > be

Re: Raw access to cache table

2014-12-18 Thread Javier Guerra Giraldez
On Thu, Dec 18, 2014 at 6:20 AM, Erik Cederstrand wrote: > I'm using Django as a hub to synchronize data between various external > systems. To do this, I have some long-running Django management commands that > are started as cron jobs. To ensure that only one job is

Re: Django and SSL

2014-12-10 Thread Javier Guerra Giraldez
On Wed, Dec 10, 2014 at 1:22 PM, pythonista wrote: > Is there a need for ssl if apache (https) and a proxy are between django and > the outside world. if they're serving Django with apache, they should be using mod_wsgi, in that case not only there's no more needs

Re: Need help with unique_together - on ForeignKey and Boolean field

2014-11-17 Thread Javier Guerra Giraldez
On Mon, Nov 17, 2014 at 6:10 AM, ThomasTheDjangoFan wrote: > > How would you do this? Can you give me a hint? 4 different ways: - don't do it as a flag, add a 'defaultImage=ForeignKey(ProductImage)' to the Product class. - don't use False for

Re: need precise advice before final decision on Django

2014-11-13 Thread Javier Guerra Giraldez
On Thu, Nov 13, 2014 at 1:32 PM, Krishnakant Mane wrote: > I guess it is obvious that I only need the view and template part here. and forms. they're often used with models (i.e. subclassing ModelForm), but that's not a requirement. also note that doing XMLRPC calls in

Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-10-29 Thread Javier Guerra Giraldez
On Wed, Oct 29, 2014 at 1:11 PM, Glen Jungels wrote: > the javascript frameworks (Node, Angular, etc) differ in that the execution > is done client side Node.js is a server framework. -- Javier -- You received this message because you are subscribed to the Google

Re: Django builds incorrect sql-query

2014-10-20 Thread Javier Guerra Giraldez
On Mon, Oct 20, 2014 at 3:43 AM, Алексей Широков wrote: > Javier, I am unable combine 2 parameters in a single call filter(), because > It is built on different levels of code. > > Is there another solution??? you can build up a dictionary and expand as parameters on a

Re: Django builds incorrect sql-query

2014-10-20 Thread Javier Guerra Giraldez
On Mon, Oct 20, 2014 at 1:53 AM, Алексей Широков wrote: > SELECT ... > FROM "document_document" > INNER JOIN "document_sending" ON ("document_document"."id" = > "document_sending"."document_id") > INNER JOIN "document_sending" T4 ON ("document_document"."id" = >

Re: Unable to store static

2014-10-16 Thread Javier Guerra Giraldez
On Thu, Oct 16, 2014 at 4:21 AM, Sachin Tiwari wrote: > > > > And added a below line in /settings.py, > > STATICFILES_DIRS = ( >os.path.join(PROJECT_PATH, "static"), >) I think you're repeating the 'static' subdirectory name. in the HTML try --

Re: best aproach to pass an email from the url to a view?

2014-10-10 Thread Javier Guerra Giraldez
On Fri, Oct 10, 2014 at 6:21 PM, dk wrote: > I been fighting to the get the email and passing it if you want to keep a value from one request to another, check the Session feature. In short, it works (almost) like a persistent dictionary private for each web user. --

Re: Config: DB or git?

2014-09-29 Thread Javier Guerra Giraldez
On Mon, Sep 29, 2014 at 8:15 AM, Alejandro Varas G. wrote: >> But where does configuration belong? > > "To the environment" this is the currently fashionable answer, but I haven't seen any justification for it. Unfortunately, the 12factors manifesto tells the how, but

Re: What is *the* django 1.7 IDE which is opensource & multiplattform

2014-09-24 Thread Javier Guerra Giraldez
On Wed, Sep 24, 2014 at 4:58 PM, John Schmitt wrote: > I put my projects in virtualenvs which are in my VMs. It's not like one VM > can only host one project. > > Is that what you mean? not exactly. if you're using virtualenv, you can directly run the project in your

Re: What is *the* django 1.7 IDE which is opensource & multiplattform

2014-09-24 Thread Javier Guerra Giraldez
On Wed, Sep 24, 2014 at 4:30 PM, John Schmitt wrote: > When I'm creating a dummy project to test my apache configuration and/or my > management commands, or trying to assemble a complicated query, I do it > "live" on the VM on which I created the playground project. why

Re: Javascript requests after user login

2014-09-09 Thread Javier Guerra Giraldez
On Tue, Sep 9, 2014 at 4:29 PM, Sarfraz Nawaz wrote: > The problem is that I keep getting forbidden 403. Having looked around it > seems that it is because this request does not include the sessionid cookie > which is an http only cookie. have you checked the response

Re: Concern about FastCGI deprecation

2014-09-02 Thread Javier Guerra Giraldez
On Tue, Sep 2, 2014 at 2:15 PM, Shawn H wrote: > Please provide a lifeline to those of us who love Django but have to use > IIS. Thanks. FastCGI isn't a Django concern, as it is a WSGI-only framework (like most Python frameworks). flup used to be a reasonable FastCGI

Re: Custom management commands provided as only .pyc files?

2014-08-13 Thread Javier Guerra Giraldez
On Wed, Aug 13, 2014 at 3:59 AM, Russell Keith-Magee wrote: > As I see it, you have four options: there's also option #2.5: * distribute .pyc files as required, but include a call to uncompyle2 (or any alternative .pyc to .py decoder) at setup time, so Django finds

Re: What is the difference between running manage.py and ./manage.py?

2014-08-03 Thread Javier Guerra Giraldez
On Sun, Aug 3, 2014 at 9:03 PM, Malik Rumi wrote: > Is this a Linux thing? on it's about the PATH variable. it's usually considered less safe to include '.' (the current directory) in PATH. Of course, that doesn't stop MS to put it right in the head of the default PATH

Re: django beginner

2014-07-07 Thread Javier Guerra Giraldez
On Mon, Jul 7, 2014 at 8:17 AM, ngangsia akumbo wrote: > But i have just created a separate app call photo, but when i run syncdb > nothing happens have you added it to INSTALLED_APPS in settings.py? -- Javier -- You received this message because you are subscribed to

Re: Advanced SQL Question

2014-06-19 Thread Javier Guerra Giraldez
On Thu, Jun 19, 2014 at 4:49 PM, G Z wrote: > how do I deal with concatenated foreign keys to form a primary key how do i > even register that in the models.py? i guess you mean composite keys. if so, then no; the Django ORM doesn't support composite primary keys. -- Javier

Re: Re: Django Python roop

2014-06-11 Thread Javier Guerra Giraldez
On Wed, Jun 11, 2014 at 8:12 AM, moqianc...@gmail.com wrote: > write right code, write clean code, It's a basic rule for our develope > work. for that you have to learn what the code means. "while x !=[]:" will always be an endless loop. the "[]" doesn't do what you

Re: execute a code at a particular date and time (aperidic task) in django

2014-06-10 Thread Javier Guerra Giraldez
On Tue, Jun 10, 2014 at 6:43 AM, Rini Michael wrote: > Thanks for your reply,i have been looking into celery as well,but i found > that celery is used for periodic task and i am looking to execute aperiodic > task.please correct me if i am wrong check the

Re: problem with django, nginx and gunicorn

2014-05-01 Thread Javier Guerra Giraldez
On Thu, May 1, 2014 at 9:06 AM, 'ReneMarxis' via Django users wrote: > I started reading a little bit related to GIL. I think this is the root of > my problem. I'm using xhtml2pdf to generate some large pdf's (up to 200 > pages). no, the problem isn't the GIL.

Re: Relationships exposed over RESTful interface

2014-04-11 Thread Javier Guerra Giraldez
On Fri, Apr 11, 2014 at 8:31 AM, Conrad Rowlands wrote: > As you can see the queryset is loading all from the database What I > would prefer to be able to do is to share the first queryset from the > ManufacturerModelViewSet (which should have all of the

Re: Remind the users when their accounts are expiring

2014-04-11 Thread Javier Guerra Giraldez
On Fri, Apr 11, 2014 at 6:39 AM, pije76 wrote: > How to remind the users via email when their accounts are expiring based on > the time schedule (such as: 2 weeks away from deactivation & the day before > the deactivation itself). I wouldn't bother with searching for an

Re: Relationships exposed over RESTful interface

2014-04-11 Thread Javier Guerra Giraldez
On Fri, Apr 11, 2014 at 3:51 AM, Conrad Rowlands wrote: > I would still be keen to know if there is any know method that would allow > me to load this data using only the 1 queries bringing in all of the related > fields in the original query. what's the first

Re: Relationships exposed over RESTful interface

2014-04-10 Thread Javier Guerra Giraldez
On Thu, Apr 10, 2014 at 8:29 AM, Conrad Rowlands wrote: > Why is this and how can I stop this behaviour but still bring back the > Manufacturer Details. I expected instead the first query to load all of the > data. override the get_collection() method in your

Re: Making functions callable

2014-03-26 Thread Javier Guerra Giraldez
On Wed, Mar 26, 2014 at 5:53 PM, Anthony wrote: > I've yet to test it but I read a few people stating to use lambdas > variables/properties. Is it definitely the case that it will only evaluate > once? from the python docs (2.7): Default parameter values are evaluated

Re: Class that extends a model that is not a model

2014-03-05 Thread Javier Guerra Giraldez
On Wed, Mar 5, 2014 at 10:52 AM, Tom Evans wrote: > Your derived classes are models, and they should be models. What they > shouldn't be is have different tables for each model type, there > should be one table that all instances are stored in to, as the data > for each

Re: big legacy database with complex many to many relationships

2014-02-24 Thread Javier Guerra Giraldez
On Mon, Feb 24, 2014 at 2:54 PM, Sells, Fred wrote: > I have to integrate to a large read only legacy mssql database . while certainly it's possible to configure this as a second database and use the ORM, I've found that it's more work than usually needed.

Re: looking for recommendations for django app for managing tv commercial post production

2014-02-20 Thread Javier Guerra Giraldez
On Thu, Feb 20, 2014 at 1:38 PM, Adam Teale wrote: > We are 10 people working in tv commercial post production. We work with > reasonable amount of data from video, photos, graphics, audio. > I'm hoping to find something that gets us off to a good start regarding user >

Re: what is the Fastest django application server?

2014-02-17 Thread Javier Guerra Giraldez
the fastest server is the one that doesn't do anything useful. as soon as you've got an application to handle requests, the magnitude of any difference between all these (and others) drops below random noise levels. -- Javier -- You received this message because you are subscribed to the

Re: FieldError, But Only In Production

2014-02-13 Thread Javier Guerra Giraldez
On Thu, Feb 13, 2014 at 7:09 PM, Rich Jones wrote: > We're good now. No idea what the hell was happening, but this works now. > Humbling to realize how little I know about the ORM internals. are you using virtualenv? it's possible that mod_wsgi was executing in a different

Re: FieldError, But Only In Production

2014-02-13 Thread Javier Guerra Giraldez
On Thu, Feb 13, 2014 at 5:49 PM, Rich Jones wrote: > Since this seems to happening at a pretty deep level, would it be uncouth to > kick this over do django-dev? django-dev is not 'django support, level 2'. it's about the development of the Django framework. if you have a

Re: Dyanmically changing Django Storage?

2014-01-27 Thread Javier Guerra Giraldez
On Mon, Jan 27, 2014 at 3:07 PM, zweb wrote: > During run time, based on file size and type, I want to use a different > storage backend. How to do it? write a storage backend proxy that picks which 'real' backend to use for each file. note that during upload, you have

Re: failure of auto increment in inndb (mysql)

2014-01-27 Thread Javier Guerra Giraldez
On Mon, Jan 27, 2014 at 2:13 PM, Tom Lockhart wrote: > MySQL started as a non-ACID query server (not a full relational database in > the accepted sense) and these kinds of issues likely stem from that history. > Folks getting started with databases and django may want

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-16 Thread Javier Guerra Giraldez
On Thu, Jan 16, 2014 at 11:50 AM, Johannes Schneider wrote: > The point is, I have to distinguish between an instance which is created, > but its save method is not yet called. And an instance coming from the > database via a manager. AFAIK, if it has a 'pk'

Re: need django.cache advice

2014-01-09 Thread Javier Guerra Giraldez
On Thu, Jan 9, 2014 at 4:43 PM, Sells, Fred wrote: > > Fred: I was unclear. The initial join is 1 x 1000 x 20 x 100 ... which > gets reduced to about 1000 records. A few records are changed every second. are the 'interesting' 1000 out-records always the

Re: migrating DailyStockSelect.com to django

2013-12-23 Thread Javier Guerra Giraldez
On Mon, Dec 23, 2013 at 6:02 AM, d ss wrote: > best would be to provide me directly with the recommended tools to perform > the following: honestly, no matter how experienced you are in Python, if you're new to Django, the best and fastest way to get you running is to do the

Re: Trying to run jobs in the background using multiprocessing

2013-11-28 Thread Javier Guerra Giraldez
On Thu, Nov 28, 2013 at 2:42 AM, Pau Creixell wrote: > I guess if there isn't another simpler way, I'll have to dig into Celery. there _are_ simpler alternatives to Celery: - worker threads: similar to your proposal, but with very well-thought process control. pros: no

Re: Problem with raw query and using in

2013-11-16 Thread Javier Guerra Giraldez
On Sat, Nov 16, 2013 at 7:40 AM, Thorsten Sanders wrote: > realms=[1] > data = AuctionData.objects.filter(itemid__exact=itemid,realm__in=realms) > data2 = AuctionData.objects.raw('SELECT * FROM auctiondata_auctiondata WHERE > itemid_id=%s AND realm_id in %s

Re: Streaming images with HttpResponse?

2013-11-15 Thread Javier Guerra Giraldez
On Fri, Nov 15, 2013 at 12:08 PM, Jorge Cardoso Leitão wrote: > I believe that is not possible with Django views. Views are made for > request-response, i.e. the client sends a request, the view returns a > response, and that's it, end of connection. i think the WSGI

Re: Fixture extraction

2013-11-14 Thread Javier Guerra Giraldez
On Thu, Nov 14, 2013 at 3:12 AM, Anton Pirker wrote: > The optimal solution would be that I can give a number of auth_users to a > script, and it will extract all data neccessary to have a complete set of > data for the given users. > > A plus would be, if the email addresses of

Re: Stroring images in the database

2013-11-12 Thread Javier Guerra Giraldez
On Tue, Nov 12, 2013 at 8:57 AM, m1chael wrote: > People have always recommended to me that storing images directly in a > database is a bad idea. it IS a bad idea, but that doesn't mean it shouldn't be possible. there are several Storage subclasses that do that, and it's not

Re: Complex query reduction

2013-11-08 Thread Javier Guerra Giraldez
On Fri, Nov 8, 2013 at 1:44 AM, Robin St.Clair wrote: > The last time I checked the use of IN, all the records from the database in > the query were brought back to the workstation, rather than being processed > on the backend and only the results returned to the workstation.

Re: Seeking reviewers for a "Guide to Idiomatic Django Deployment"

2013-11-06 Thread Javier Guerra Giraldez
On Tue, Nov 5, 2013 at 7:34 PM, George London wrote: > > I think it would be really helpful for new-comers to have a clear, > opinionated guide to "commonly accepted (i.e. idiomatic)" deployment best > practices. Or at least I know it would have really helped me.

Re: Complex query reduction

2013-11-01 Thread Javier Guerra Giraldez
On Fri, Nov 1, 2013 at 12:45 PM, Daniele Procida wrote: > In practice I use some tweaks (such as values_list) to speed this up, and > caching, but the fundamental pattern is the same. It's slow, because there > are 30 thousand BibliographicRecords. the total number of

Re: Defining new project as a service at nignx

2013-10-14 Thread Javier Guerra Giraldez
On Mon, Oct 14, 2013 at 12:17 PM, Muhammed TÜFEKYAPAN wrote: > I use digitalocean as a server. I upload my django project files on my > server and start to setup. Made postgresql settings etc but I can't define > my new project as a new service on nginx. How can I define my

  1   2   3   4   5   >