Rename tables of moved models in database only
- Start new app
- add new app in config
- move models
- adjust references in models, admins, views, serializers, forms, tests etc.
- run makemigrations
- run makemigrations --empty old_app
import React from "react"; | |
// Same level of complexity for integration tests | |
export default function SetupBookDetail() { | |
const { state: book, fetchBook, deleteBook } = React.useContext(BookContext); | |
const bookUrl = utils.buildBookUrlFromUri(); | |
React.useEffect(() => { | |
fetchBook(bookUrl); | |
}, []); |
import React from "react"; | |
export default function SmartBookDetail() { | |
const [isDeleteClicked, setDeleteClicked] = React.useState(false); | |
const { state: book, fetchBook, deleteBook } = React.useContext(BookContext); | |
const bookUrl = utils.buildBookUrlFromUri(); | |
React.useEffect(() => { | |
fetchBook(bookUrl); | |
}, []); |
import React from "react"; | |
// Can not really write good unit tests | |
// Every test should start with a mock of the API call to fetch the `book` | |
export default function BookDetail() { | |
const [isDeleteClicked, setDeleteClicked] = React.useState(false); | |
const { state: book, fetchBook, deleteBook } = React.useContext(BookContext); | |
const bookUrl = utils.buildBookUrlFromUri(); | |
React.useEffect(() => { |
elements = content.split('\n’).filter(r => r.trim() !== ‘').map(r => r.split('=')); | |
for (var i=0; i<elements.length; i++) { | |
$('awsui-control-group[label="Env Variables"]').find('input').eq(i*2).val(elements[i][0]).trigger('input').trigger('change'); | |
$('awsui-control-group[label="Env Variables"]').find('input').eq(i*2 + 1).val(elements[i][1]).trigger('input').trigger('change'); | |
} |
from django.db import models | |
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser | |
class UserManager(BaseUserManager): | |
def create_user(self, email, password=None): | |
if not email: | |
raise ValueError('Users must have an email address') | |
user = self.model(email=self.normalize_email(email)) |
+ import LoginRequiredRoute from './LoginRequiredRoute'; | |
<Switch> | |
<Route path="/login/" component={Login} /> | |
+ <LoginRequiredRoute component={App} /> | |
- <Route component={App} /> | |
</Switch> |
// only the changes here | |
+import { Route, Switch, withRouter } from 'react-router-dom'; | |
-import { Route, Switch } from 'react-router-dom'; | |
export default withRouter(connect( | |
state => ({ | |
loggedIn: state.loggedIn, | |
}), { | |
changeLoggedIn, |
import React, { Component } from 'react'; | |
import { Route, Switch } from 'react-router-dom'; | |
import { connect } from 'react-redux'; | |
import Loading from './Loading'; | |
import Login from './Login'; | |
import App from './App'; | |
import { changeLoggedIn } from './actions'; | |
import React from 'react'; | |
import { Link, Redirect, Route, Switch } from 'react-router-dom'; | |
const Nav = () => ( | |
<ul> | |
<Link to="/friends/"><li>Friends</li></Link> | |
<Link to="/books/"><li>Books</li></Link> | |
</ul> | |
) |